This is a simple login/signup application built using Express.js, Firebase, and bcrypt for password hashing. It allows users to sign up, log in, and log out securely.
- User authentication with Firebase Firestore
- Password hashing with bcrypt
- Session management with Express session
- Static file serving for login/signup and dashboard pages
Before running this application, make sure you have the following:
- Node.js installed on your machine
- Firebase project set up with Firestore and Service Account JSON file
- Basic knowledge of Express.js and Firebase
-
Clone this repository to your local machine:
git clone https://github.com/Varshi45/Basic-Authentication-System
-
Navigate to the project directory:
cd Basic-Authentication-System
-
Install dependencies:
npm install
-
Add your Firebase Service Account JSON file to the project directory and name it
firebase-key.json
.
Before running the application, you need to configure Firebase. Update the firebase-key.json
file with your Firebase project credentials.
To start the server, run:
npm start
This will start the Express server on port 3000 by default.
POST /signup
: Allows users to sign up with a new account.POST /login
: Allows users to log in with existing credentials.GET /dashboard
: Serves the dashboard page if the user is logged in.POST /logout
: Logs out the user and destroys the session.
Basic-Authentication-System/
├── firebase-key.json
├── dashboard.html
├── main.html
├── package.json
├── server.js
└── Login-Signup/
├── css/
├── js/
└── images/