This repository contains a demonstration of authentication using JSON Web Tokens (JWT) and MongoDB in a Next.js web application with TypeScript.
- Project Details
- Description
- Technologies Used
- Environment Variables
- Installation
- Running the Application
- Demo
- Contact
- Repository Name: Next.js Authentication
- Bootstraped with: Next.js version 13
This Next.js web application with TypeScript demonstrates authentication using JSON Web Tokens (JWT) and MongoDB. It emphasizes the importance of configuring environment variables.
- Next.js
- React.js
- Tailwind CSS
- TypeScript
- JSON Web Tokens (JWT)
- MongoDB
Create a .env
file in the root directory with the following environment variables:
MONGODB_URI=<Your MongoDB connection URI>
SECRET=<Your JWT secret key>
Replace <Your MongoDB connection URI>
with your MongoDB database's connection URI and <Your JWT secret key>
with a secure key for JWT token operations.
Note: The .env
file should not be committed to version control as it may contain sensitive information.
To set up the project locally, you can use one of the following package managers:
- Yarn:
yarn install
- npm:
npm install
- pnpm (preferred):
pnpm install
After installation, run the Next.js application using this command:
npm run dev
Visit http://localhost:3000 in your browser to see the application in action.
Explore the live demo of the project: Next.js Authentication Demo
For inquiries or issues, feel free to contact us at shaikhabubakar2380@gmail.com. I'd love to hear from you!