Skip to content

r2hu1/nitro-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

26 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nitro Backend Starter

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.

Features

  • 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.

Getting Started

Prerequisites

  • Node.js (version 16 or higher)
  • Package Manager: pnpm or npm

Installation

  1. Clone the Repository:

    git clone https://github.com/r2hu1/nitro-backend.git
    cd nitro-backend
  2. Install Dependencies:

    pnpm install
  3. Configure Environment Variables:

    Create a .env file in the root directory and populate it based on the .env.example provided.

  4. Run the Development Server:

    pnpm dev

The server should now be running at http://localhost:3000.

Project Structure

β”œβ”€β”€ 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

Scripts

  • Start Development Server: pnpm dev
  • Build for Production: pnpm build
  • Start Production Server: pnpm start

Contributing

Contributions are welcome! If you have suggestions for improvements or encounter any issues, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Acknowledgements

  • Nitro for the powerful server toolkit.
  • UnJS for maintaining Nitro and related tools.

About

πŸš€ Reusable backend template built with NitroJS – fast, modular, and ready for quick backend devlopment!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors