A lightweight and modular backend template built with Nitro, designed to accelerate the development of secure and scalable APIs. This starter kit integrates essential features like JWT authentication, encryption, and database connectivity, making it an ideal foundation for modern web applications.
- Nitro-Powered: Utilizes Nitro, a next-generation server toolkit, for rapid development and deployment.
- JWT Authentication: Implements JSON Web Token (JWT) for secure user authentication.
- Nodemailer: Send email's pogrammitically.
- Encryption: Includes built-in mechanisms for data encryption to enhance security. (nodejs - crypto)
- Database Integration: Pre-configured to connect with databases, facilitating data management. ( mongodb with mongoose)
- Modular Structure: Organized codebase promoting scalability and maintainability.
-
Clone the Repository:
git clone https://github.com/r2hu1/nitro-backend.git cd nitro-backend -
Install Dependencies:
pnpm install
-
Configure Environment Variables:
Create a
.envfile in the root directory and populate it based on the.env.exampleprovided. -
Run the Development Server:
pnpm dev
The server should now be running at http://localhost:3000.
βββ server
βΒ Β βββ middleware
βΒ Β βΒ Β βββ cors.ts
βΒ Β βΒ Β βββ index.ts
βΒ Β βββ models
βΒ Β βΒ Β βββ otp.ts
βΒ Β βΒ Β βββ user.ts
βΒ Β βββ plugins
βΒ Β βΒ Β βββ env.ts
βΒ Β βΒ Β βββ mongoose.ts
βΒ Β βββ routes
βΒ Β βΒ Β βββ auth
βΒ Β βΒ Β βΒ Β βββ forgot-password.post.ts
βΒ Β βΒ Β βΒ Β βββ login.post.ts
βΒ Β βΒ Β βΒ Β βββ register.post.ts
βΒ Β βΒ Β βΒ Β βββ reset-password.post.ts
βΒ Β βΒ Β βββ email
βΒ Β βΒ Β βΒ Β βββ send-otp.get.ts
βΒ Β βΒ Β βββ index.ts
βΒ Β βΒ Β βββ user
βΒ Β βΒ Β βββ delete.delete.ts
βΒ Β βΒ Β βββ get.get.ts
βΒ Β βΒ Β βββ verify-otp.post.ts
βΒ Β βββ utils
βΒ Β βββ auth.ts
βΒ Β βββ crypto.ts
βΒ Β βββ db_helper
βΒ Β βΒ Β βββ connect.ts
βΒ Β βΒ Β βββ save-otp.ts
βΒ Β βββ mail_helper
βΒ Β βββ send-email.ts
βββ package.json
βββ nitro.config.ts
βββ pnpm-lock.yaml
βββ pnpm-workspace.yaml
βββ README.md
βββ tsconfig.json
- Start Development Server:
pnpm dev - Build for Production:
pnpm build - Start Production Server:
pnpm start
Contributions are welcome! If you have suggestions for improvements or encounter any issues, please open an issue or submit a pull request.
This project is licensed under the MIT License.