Skip to content

Latest commit

 

History

History
170 lines (110 loc) · 6.69 KB

README.md

File metadata and controls

170 lines (110 loc) · 6.69 KB

Full-Stack Authentication App:

GitHub stars

Project Details: 💻🌐📅

  • Functionality: Implements user authentication using Passport.js with local and Google OAuth 2.0 strategies. 🛡️🌐
  • Tech Stack: Node.js, Express.js, MongoDB, Passport.js, EJS, CSS 🚀💻
  • Author: @shreyamalogi 👩‍💻
  • Year of Project: 2022 📅

Table of Contents ✍️

  1. Introduction
  2. Challenges Faced during Authentication Evolution
  3. Dependencies
  4. Navigating Project Evolution
  5. How to Run
  6. How to Start from Scratch
  7. License
  8. Contribution

Introduction 🌐

This is a Node.js web application built by Shreya Malogi with Express.js, MongoDB, and Passport.js for user authentication. The application includes local authentication (username and password) and Google OAuth 2.0 authentication. 🚀🔐

Challenges Faced during Authentication Evolution: 🛡️

  1. Password Hashing Algorithm:

    • Challenge: Selecting a secure password hashing algorithm.
    • Solution: Started with md5 and transitioned to the more secure bcrypt for robust password hashing. 🔒🔐
  2. Passport.js Integration:

    • Challenge: Integrating Passport.js for user authentication.
    • Solution: Initially used md5 and bcrypt, later adopted Passport.js for a streamlined authentication process. 🤝🚀
  3. Environment Variables Security:

    • Challenge: Managing sensitive info like Google OAuth credentials.
    • Solution: Used dotenv to securely load environment variables from a .env file. 🔒🔐

Dependencies 📦🚀

  • express: Web application framework for Node.js. 🌐
  • body-parser: Node.js body parsing middleware. 🤖
  • ejs: Embedded JavaScript templates. 🎨
  • mongoose: MongoDB object modeling tool. 🍃
  • dotenv: Loads environment variables from a .env file. 🔒
  • express-session: Session middleware for Express.js. 🕐
  • passport: Simple, unobtrusive authentication middleware for Node.js. 🛡️
  • passport-local-mongoose: Passport.js plugin for simplifying username and password auth. 🤝
  • passport-google-oauth20: Passport.js for authenticating with Google using OAuth 2.0.🌐
  • mongoose-findorcreate: Mongoose plugin for simplifying the findOneOrCreate operation. 🔄

Navigating Project Evolution:

To view detailed information about each commit and understand what happened at each version, you can use the git log command without any additional filters. Here's how:

git log

🔄💡 This command will display a chronological list of all commits in your repository. Each commit entry includes information such as the commit hash, author, date, and commit message. The commit message typically provides a summary of the changes made in that commit.

Navigate through the log using the arrow keys. Press q to exit and return to the command line.

If you want to see a condensed version of the log, you can use:

git log --oneline

💻🔍 This will display each commit as a single line, showing only the commit hash and the first line of the commit message.

To see the changes introduced in a specific commit, you can use:

git show <commit-hash>

Replace <commit-hash> with the actual commit hash you want to inspect. This command will display detailed information about the specified commit, including the changes made to files.

This way, you can review the commit history, understand the changes made at each version, and inspect specific commits for detailed information about the modifications introduced.🚀📖👀

How to Run? 🚀🔐

Prerequisites:

  1. Start MongoDB Server:

    • Ensure that your MongoDB server is running. If not, start it using:
      mongod
      Keep the mongod server running throughout the setup.
  2. Clone the Repository:

    git clone https://github.com/shreyamalogi/Full-Stack-Authentication-App.git
  3. Navigate to the Project Directory:

    cd <project-directory>
  4. Install Dependencies:

    npm install
  5. Create a .env File:

    • In the root directory, create a .env file.
    • Add the following content:
      CLIENT_ID=<your-google-client-id>
      CLIENT_SECRET=<your-google-client-secret>
      Replace <your-google-client-id> and <your-google-client-secret> with your Google OAuth 2.0 credentials.
  6. Run the Application:

    node app.js
  7. Open Your Web Browser:

  8. Register and Login:

    • Click on "Register" and sign up with your username and password.
    • Log in to access the brand new secrets page. 🌟

🌐🔐

How you can make from scratch?

click here for secrets app guidelines/references

click her for secrets app overview

License 🕊️

This project is enchanted under the spell of the MIT License. Share the magic responsibly!

MIT License

Copyright (c) 2022 Shreya Malogi

Contribution - Show Your Support (Star This) ⭐🌟📜✨

Excited about web security spells? Contribute to this magical project and make it even more secure. Don't forget to star the project! ⭐🌟