nestjs-starter-kit

1.2.1 • Public • Published

Nest.js Starter Kit

Nest.js Starter Kit is a comprehensive boilerplate for kickstarting Nest.js projects with ease. With just one command, you can initialize a new Nest.js project with essential configurations and commonly used modules, saving you time and effort in setting up your project structure.

Features

  • Quick Setup: Initialize a new Nest.js project instantly with one simple command.
  • Modular Architecture: Built with a modular architecture for easy scalability and maintainability.
  • Dependency Injection: Utilizes Nest.js' powerful dependency injection system for better code organization and testability.

Preconfigured

  • JWT Authentication: Integrated JWT authentication for securing endpoints.
  • Two-Factor Authentication: Added support for two-factor authentication for enhanced security.
  • Role-Based Authentication: Implemented role-based authentication to control access based on user roles.
  • Database Configuration: Configured database connection using TypeORM, a popular Object-Relational Mapping (ORM) library for seamless interaction with the database.
  • Validation Pipes and DTOs: Included validation pipes and DTOs for validating incoming requests and ensuring data integrity.
  • Api-Key Authentication: IImplemented Api-Key authentication for additional security measures.

Installation

To create a new Nest.js project using the starter kit, simply run the following command:

npx nestjs-starter-kit project_name

Replace project_name with the desired name for your project.

Getting Started

After initializing your project using the starter kit, follow these steps to start developing your Nest.js application:

  1. Create the Database: Create the database, then add the database name to the env file in the DB_NAME field.

  2. Start the Development Server: Run the following command to start the development server:

    npm run start:dev
    
  3. Start Coding: Begin developing your Nest.js application! The starter kit comes preconfigured with essential files and directories to help you get started quickly.

Directory Structure

The directory structure of the project generated by the starter kit is as follows:

├──src
      ├──config
      ├──app
            ├──common
                  ├──decorators
                  ├──docs
                  ├──exception
            ├──constants
            ├──modules
                  ├──auth
                  ├──shared
                  ├──user
            ├──app.module.ts
      ├──database

  • src/: Directory containing the source files of your Nest.js application.
  • config/: Directory for configuration files.
  • constants/: Directory for constant files.
  • dto/: Directory for Data Transfer Object files.
  • entities/: Directory for entity files.
  • guards/: Directory for guard files.
  • middlewares/: Directory for middleware files.
  • modules/: Directory for module files.
  • services/: Directory for service files.
  • types/: Directory for type definition files.
  • database/: Directory for database-related files.

Contributing

Contributions are welcome! If you have any ideas, improvements, or bug fixes, feel free to open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Nest.js Starter Kit - Created by Karimov Farda

Package Sidebar

Install

npm i nestjs-starter-kit

Weekly Downloads

11

Version

1.2.1

License

MIT

Unpacked Size

8.48 kB

Total Files

3

Last publish

Collaborators

  • fardakarimov