A simple authentication app built with Node.js, Express, EJS, and MongoDB. This project provides basic user authentication features, including login and logout functionality.
Check out the live demo here.
- express
- express-session
- ejs
- cors
- connect-mongodb-session
- dotenv
- mongoose
- uuid
- crypto (core Node.js module)
The bcryptjs
package was causing authentication issues, so it was replaced with two custom functions using the core Node.js module crypto
. The functions, encryptFunction()
and decryptFunction()
, are located in the "config/hashdata.js" file.
- config/hashdata.js: Contains the custom encryption and decryption functions.
- config/database.js: Database connection code.
- model/user.js: User model code.
- public/styles/main.css: CSS styles for the application.
- public/js/script.js: JavaScript codes, including confetti effects.
- views/index.ejs: Landing page code.
- views/sign-in.ejs: Sign-in page code.
- views/sign-up.ejs: Sign-up page code.
- app.js: Main application file containing routes, middleware, and package imports.
- Install dependencies:
npm install
- Set up your MongoDB connection string in a
.env
file. - Run the app:
npm start
- Open your browser and navigate to
http://localhost:3000
Contributions are welcome! If you find any issues or would like to suggest improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.