https://github.com/pras75299/nextjsauthentication
Fullstack Next Js Authentication with MongoDB, JWT, Bcrypt and NextJS Router
https://github.com/pras75299/nextjsauthentication
authentication bcryptjs jwt mailtrap mongodb moongose nextjs-starter nextjs-template nextjs14
Last synced: 7 months ago
JSON representation
Fullstack Next Js Authentication with MongoDB, JWT, Bcrypt and NextJS Router
- Host: GitHub
- URL: https://github.com/pras75299/nextjsauthentication
- Owner: pras75299
- Created: 2024-04-03T19:47:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-10T20:40:47.000Z (over 1 year ago)
- Last Synced: 2024-04-11T08:48:07.333Z (over 1 year ago)
- Topics: authentication, bcryptjs, jwt, mailtrap, mongodb, moongose, nextjs-starter, nextjs-template, nextjs14
- Language: TypeScript
- Homepage: https://nextjs-authentication-bay.vercel.app/
- Size: 225 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Next.js, MongoDB, bcrypt, JWT, and Mailtrap Project
This project is built using Next.js and integrates MongoDB for database operations, bcrypt for password hashing, JWT for authentication, and Mailtrap to simulate email sending in a development environment.
## Getting Started
First, install the dependencies:
```bash
npm install
```Then, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```Open [http://localhost:3000](http://localhost:3000) to see the application in action.
## Features
- User Authentication: Sign up, sign in, and sign out functionality using JWT.
- Password Hashing: Secure password hashing using bcrypt.
- Email Simulation: Email simulation for development purposes with Mailtrap.
- Database Integration: MongoDB integration for storing and managing user data.## Configuration
Ensure you have the following environment variables configured in your `.env` file:
- `MONGODB_URI`: Your MongoDB connection string.
- `DOMAIN`: Your localhost url connection string and in production update the url with production url.
- `JWT_SECRET`: A secret key for JWT signing and verification.
- `MAILTRAP_USER`: Your Mailtrap username.
- `MAILTRAP_PASS`: Your Mailtrap password.## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
## Deployment
For deployment instructions and best practices, refer to the [Next.js deployment documentation](https://nextjs.org/docs/deployment).
## License
This project is open-sourced under the MIT license.