Skip to content

shreyamalogi/Full-Stack-Authentication-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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! ⭐🌟