Skip to content

adarshsingh1706/Auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Authentication

This repository contains a full-stack web application built with ReactJS for the frontend and Node.js, Express, and MongoDB for the backend. The project focuses on implementing authentication features.

Technologies Used

  • Frontend: ReactJS
  • Backend: Node.js, Express
  • Database: MongoDB
  • Libraries: bcryptjs, jsonwebtoken (JWT), cookies
  • React Hooks: useState,useHistory, useNavigate

Overview

This project demonstrates the integration of frontend and backend technologies to create a secure authentication system using JSON Web Tokens (JWT) and secure cookie storage. The backend handles user registration, login, and authentication, while the frontend provides a user-friendly interface for these functionalities.

Key Features

  • Authentication: User registration and login using encrypted passwords stored in MongoDB.
  • Secure Cookies: Storing JWT tokens securely in HTTP-only cookies to prevent client-side access.
  • React Integration: Frontend communicates with the backend API using axios for HTTP requests.

Learning Outcomes

Throughout this project, we gained insights into various aspects of backend development:

  • Security: Implementing password hashing with bcryptjs for secure storage.
  • Authentication: Using JWT to manage user sessions and ensure secure communication between frontend and backend.
  • Frontend-Backend Integration: Integrating ReactJS with Node.js and Express to create a seamless user experience.
  • React Hooks: Utilizing useHistory and useNavigate (for react-router-dom v6>) hooks for client-side navigation after authentication.

Getting Started

  1. Clone the repository: git clone https://github.com/adarshsingh1706/Auth
  2. Navigate to the project directory: cd project-directory
  3. Install dependencies:
    • Backend: cd backend && npm install
    • Frontend: cd frontend && npm install
  4. Set up environment variables:
    • Create a .env file in the backend directory and define necessary variables (e.g., PORT, MONGO_DB_URL, SECRET_KEY).
  5. Start the backend server: cd backend && npm start
  6. Start the frontend development server: cd frontend && npm start
  7. Open your browser and go to http://localhost:4000 to view the application.

Contributing

Contributions are welcome! Please fork the repository and create a pull request with your improvements.

License

This project is licensed under the MIT License.

About

A repository containing authentication functionality for user login.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published