Skip to content

A Node.js app using Google OAuth 2.0 for authentication and MongoDB for user data storage, with login/signup, session management, and secure password hashing.

Notifications You must be signed in to change notification settings

iamRahul21/google-auth-mongodb-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google Authentication with MongoDB

A simple Node.js application that provides user authentication using Google OAuth 2.0 through Firebase and stores user data in MongoDB. Features include login and signup via email and password, Google sign-in/sign-up, and password reset functionality.

Features

  • Email and password login and signup.
  • Google OAuth 2.0 authentication.
  • Password reset via email.
  • User data stored in MongoDB.
  • Session management with express-session.

Installation

Prerequisites

  • Node.js and npm installed.
  • MongoDB server running locally or a MongoDB Atlas account.
  • Firebase project set up with OAuth 2.0 credentials.

Clone the Repository

git clone https://github.com/iamRahul21/google-auth-mongodb-login.git
cd google-auth-mongodb-login

Set Up Environment Variables

Create a .env file in the root directory with the following content:

PORT=3000
MONGODB_URI=your-mongodb-uri
FIREBASE_API_KEY=your-firebase-api-key
FIREBASE_AUTH_DOMAIN=your-firebase-auth-domain
FIREBASE_PROJECT_ID=your-firebase-project-id
FIREBASE_STORAGE_BUCKET=your-firebase-storage-bucket
FIREBASE_MESSAGING_SENDER_ID=your-firebase-messaging-sender-id
FIREBASE_APP_ID=your-firebase-app-id
FIREBASE_MEASUREMENT_ID=your-firebase-measurement-id

Install Dependencies

npm install

Start the Application

node server.js

Usage

Launch the application by serving index.html through a local live server or by opening the file directly in your browser.

About

A Node.js app using Google OAuth 2.0 for authentication and MongoDB for user data storage, with login/signup, session management, and secure password hashing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published