Skip to content

mayankgorana/SecureUserAuthentication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” Secure Authentication System – React & Node.js

This project is a full-stack user authentication system built using React, Node.js, Express, and MongoDB as part of Task 1 for Prodigy Infotech Internship. It implements secure login, registration, session management, and protected routes.

πŸš€ Tech Stack

  • Frontend: React, Axios, React Router DOM
  • Backend: Node.js, Express.js, MongoDB, bcrypt, express-session, connect-mongo

βœ… Features

  • πŸ” User Registration with hashed passwords using bcrypt
  • πŸ”‘ User Login with session-based authentication
  • πŸ›‘οΈ Protected Routes with React Router
  • πŸ”„ Session Handling with express-session and connect-mongo
  • 🌐 CORS configured for cross-origin requests
  • ✨ Clean and user-friendly UI for Login & Register
  • πŸ” Seamless navigation between Login ↔️ Register ↔️ Dashboard

πŸ“‚ Project Structure

secure-authentication/ β”œβ”€β”€ client/ # React frontend β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ Login.js β”‚ β”‚ └── Register.js β”‚ β”œβ”€β”€ styles/ β”‚ β”‚ └── Login.css β”‚ β”‚ └── Register.css β”‚ β”œβ”€β”€ App.js β”‚ └── index.js β”œβ”€β”€ server/ # Node.js backend β”‚ └── server.js β”œβ”€β”€ .env β”œβ”€β”€ package.json └── README.md

βš™οΈ Installation Steps

  1. Clone the repository git clone https://github.com/your-username/secure-authentication.git cd secure-authentication

  2. Install Backend Dependencies cd server npm install

  3. Set up Environment Variables Create a .env file in the server folder: SESSION_SECRET=your_secret_key

4.Run Backend npm start

  1. Install Frontend Dependencies cd ../client npm install

6.Start React App npm start

Make sure your backend runs on http://localhost:3000 and frontend on http://localhost:3001.

About

Secure User Authentication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors