Skip to content

Authentication System. A full-stack system for secure login, signup, and email verification using Node.js, React, and MongoDB.

Notifications You must be signed in to change notification settings

Dilusha-Ranasingha/authentication-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authentication System

This project is a robust Authentication System built with a full-stack approach, utilizing modern technologies to ensure security, scalability, and ease of use. The backend is built using Node.js, Express, and MongoDB, while the frontend leverages React, Vite, and TailwindCSS to provide a responsive and user-friendly interface.

📂 Project Structure

Authentication_System/
|-- backend/
|   |-- config/
|   |-- controllers/
|   |-- mailtrap/
|   |-- middleware/
|   |-- models/
|   |-- routes/
|   |-- utils/
|   |-- server.js
|
|-- frontend/
    |-- node_modules/
    |-- public/
    |-- src/
        |-- components/
        |-- pages/
        |-- store/
        |-- utils/
        |-- App.jsx
        |-- index.css
        |-- main.jsx
    |-- index.html
    |-- package.json
    |-- tailwind.config.js
    |-- vite.config.js

🌟 Key Features

  • User Authentication: Secure login and signup functionality.
  • Password Encryption: Utilizes bcrypt for secure password storage.
  • JWT Integration: Secure and scalable session handling with JSON Web Tokens.
  • Email Verification: Integration with Mailtrap for sending and verifying emails.
  • Forgot Password: Allows users to reset their passwords securely via email.
  • Responsive Design: A user-friendly interface powered by TailwindCSS.
  • Environment Configuration: Sensitive data securely managed using environment variables.

🔖 Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or above)
  • npm or yarn
  • A Mailtrap account for email testing

🚀 Setup and Installation

Backend

  1. Navigate to the root directory and install dependencies:

    npm install
  2. Create a .env file in the root directory and add the required environment variables:

    MONGO_URI=your_mongo_connection_string
    PORT=5000
    JWT_SECRET=your_jwt_secret
    NODE_ENV=development
    MAILTRAP_TOKEN=your_mailtrap_token
    MAILTRAP_ENDPOINT=your_mailtrap_endpoint
    CLIENT_URL=your_client_url
  3. Start the backend server:

    npm run dev

Frontend

  1. Navigate to the frontend folder:

    cd frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev

Usage

  • Visit the frontend URL (e.g., http://localhost:3000) in your browser.
  • Use the authentication features such as login and signup.

🛠️ Technologies Used

Backend

  • Node.js: JavaScript runtime for building the server-side application.
  • Express.js: Web framework for Node.js.
  • MongoDB: NoSQL database for data storage.
  • Mailtrap: Email testing platform.
  • JSON Web Tokens (JWT): Secure session handling.

Frontend

  • React.js: JavaScript library for building user interfaces.
  • TailwindCSS: Utility-first CSS framework for styling.
  • Vite: Fast build tool for modern web projects.

Contributing

Contributions are welcome! Follow these steps:

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m 'Add some feature'
  4. Push to the branch:
    git push origin feature-name
  5. Open a pull request.

🧰 Languages and Tools:

React Express.js Node.js Visual Studio Code Postman MongoDB Tailwind CSS

📧 Contact

For any inquiries or feedback, feel free to reach out at [email protected].

About

Authentication System. A full-stack system for secure login, signup, and email verification using Node.js, React, and MongoDB.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages