/MERN-AUTH

This MERN authentication app ensures security with Vite, React, and Material-UI. Utilizing JWT and bcrypt for authentication, it features XSS protection for enhanced security.

Primary LanguageJavaScript

MERN Stack Auth App

This MERN (MongoDB, Express.js, React, Node.js) stack authentication app is built with Vite for the frontend, React for UI components, Redux Toolkit for state management, and Material-UI for the user interface. The app implements authentication and authorization features using JWT (JSON Web Tokens) and bcrypt for password hashing.

Features

  • User registration and login
  • Token-based authentication and authorization
  • Secure storage of tokens in HTTP-only cookies
  • JWT for secure communication between the frontend and backend
  • bcrypt for secure password hashing
  • Material-UI components for a clean and responsive user interface

Tech Stack

Getting Started

Prerequisites

  • Node.js (install from here)
  • MongoDB (install from here)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/your-mern-auth-app.git
    cd your-mern-auth-app

cd frontend npm install cd ../backend npm install

  1. et up MongoDB:

    Create a .env file in the backend directory and add your MongoDB connection string:

    env

MONGODB_URI=your_mongodb_connection_string

3.Certainly! Here's a README template that you can copy and paste for your MERN stack app:

markdown

MERN Stack Auth App

This MERN (MongoDB, Express.js, React, Node.js) stack authentication app is built with Vite for the frontend, React for UI components, Redux Toolkit for state management, and Material-UI for the user interface. The app implements authentication and authorization features using JWT (JSON Web Tokens) and bcrypt for password hashing.

Features

  • User registration and login
  • Token-based authentication and authorization
  • Secure storage of tokens in HTTP-only cookies
  • JWT for secure communication between the frontend and backend
  • bcrypt for secure password hashing
  • Material-UI components for a clean and responsive user interface

Tech Stack

Getting Started

Prerequisites

  • Node.js (install from here)
  • MongoDB (install from here)

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/your-mern-auth-app.git
    cd your-mern-auth-app
    
     Install dependencies for both frontend and backend:
    
     bash
    
  2. cd frontend npm install cd ../backend npm install

  3. Set up MongoDB:

    Create a .env file in the backend directory and add your MongoDB connection string:

    env

    MONGODB_URI=your_mongodb_connection_string

Start the frontend and backend:

bash

In the frontend directory

cd frontend npm run dev

In the backend directory

cd backend npm start

  1. Access the app:

Open your browser and navigate to http://localhost:3000.