This project is a complete authentication system implemented using Node.js, Next.js, JWT, Tailwind CSS, and MongoDB. It includes user registration, login, token generation, and secure route protection using JWT. The project is organized into two main directories: client for the Next.js frontend and server for the Node.js backend.
Before you begin, ensure you have met the following requirements:
Getting Started
Clone the repository:
git clone https://github.com/sherii190/Full-Stack-Login-Flow-with-JWT-Authentication.git
Change into the project directory:
cd Full-Stack-Login-Flow-with-JWT-Authentication
Install dependencies for both the client and server:
cd client npm install cd ../server npm install
The project is organized into two main directories:
Before running the application, you need to configure it. Create a .env file in both the client and server directories to specify environment variables. Sample environment variables are provided in .env.example files in both directories.
To start the development servers for the client and server:
In the client directory:
cd client npm run dev
In the server directory:
cd server npm start
Visit http://localhost:3000 in your browser to access the application.
To run tests, use the following commands in the respective directories:
Follow best practices for deploying Next.js and Node.js applications to a production environment. Make sure to configure the necessary environment variables.