MCPcopy Index your code
hub / github.com/GDGAlgiers/nest-init-cli

github.com/GDGAlgiers/nest-init-cli @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
136 symbols 399 edges 22 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Contributors Forks Stargazers MIT License


Nest-Init CLI

The Repository for Nest-Init CLI made using NestJS, NestJS Commander, Inquirer and Passport.js.

<a href="https://github.com/GDGAlgiers/nest-init/issues">Report Bug</a>
·
<a href="https://github.com/GDGAlgiers/nest-init/issues">Request Feature</a>

Table of Contents

About The Project

Nest-Init is a powerful CLI tool designed to streamline the creation and configuration of new NestJS projects. It simplifies the setup process, allowing you to integrate different databases with ORMs and set up authentication efficiently. Nest-Init equips you with essential tools to launch your next NestJS application with ease.

Features

  1. Database Configuration
  2. ORM Integration: Choose between MikroORM, TypeORM, Sequelize, Prisma, and Drizzle with automatic configuration and connection setup.
  3. ODM Integration: Setup Mongoose for MongoDB with pre-configured models and schemas.
  4. Authentication Setup
  5. Implement JWT authentication with pre-configured guards and strategies.
  6. Add social authentication for services like Google, Facebook and Github.

Built with

Getting Started

System Requirements

To get started with Nest-Init, ensure you have Node.js and npm installed on your machine.

Using Nest-Init in Your Project

  • In order to use Nest-Init within your NestJS project, install the package globally using the command:

bash npm install -g nest-init-cli

  • Once it is installed, follow the prompts to start configuring your project.

Contributing to Nest-Init

If you're interested in maintaining or developing the package, follow these steps:

  1. Clone the repository: bash git clone https://github.com/GDGAlgiers/nest-init.git cd nest-init
  2. Install dependencies: bash npm install
  3. Run the project locally: bash npm run start
  4. Make your changes and create a pull request:

  5. Make sure to follow the contribution guidelines in CONTRIBUTION.md

Usage

Once you have configured your project with Nest-Init, you can begin using the CLI within your NestJS project.

Initializing the CLI

In your project directory, execute the command:

nest-init

After initializing the CLI, you will see the following menu options:

1. Configure ORM with Database
2. Setup Authentication Strategies and Services

Choose the option that suits your project needs and follow the prompts to configure your NestJS application accordingly.

List of Commands

Configure ORM with Database

Use the following command to install and configure your chosen ORM with a specific database:

nest-init install-<ORM> -<database>

Below, you'll find detailed commands for each combination of ORM and supported databases.

MikroORM

Configure MikroORM with MySQL, PostgreSQL, or MongoDB.

  • MySQL

bash nest-init install-mikroorm -my

or

bash nest-init install-mikroorm --mysql

  • PostgreSQL

bash nest-init install-mikroorm -psql

or

bash nest-init install-mikroorm --postgresql

  • MongoDB bash nest-init install-mikroorm -m or bash nest-init install-mikroorm --mongodb

TypeORM

Configure TypeORM with MySQL, PostgreSQL, or MongoDB.

  • MySQL

bash nest-init install-typeorm -my

or

bash nest-init install-typeorm --mysql

  • PostgreSQL

bash nest-init install-typeorm -psql

or

bash nest-init install-typeorm --postgresql

  • MongoDB bash nest-init install-typeorm -m or bash nest-init install-typeorm --mongodb

Mongoose

Configure Mongoose with MongoDB.

nest-init install-mongoose -m

or

nest-init install-mongoose --mongodb

Sequelize

Configure Sequelize with MySQL, PostgreSQL, or MongoDB.

  • MySQL

bash nest-init install-sequelize -my

or

bash nest-init install-sequelize --mysql

  • PostgreSQL bash nest-init install-sequelize -psql or bash nest-init install-sequelize --postgresql

Prisma

Configure Prisma with PostgreSQL or MongoDB.

  • PostgreSQL

bash nest-init install-prisma -psql

or

bash nest-init install-prisma --postgresql

  • MongoDB bash nest-init install-prisma -m or bash nest-init install-prisma --mongodb

Drizzle

Configure Drizzle with MySQL, PostgreSQL, or MongoDB.

  • MySQL

bash nest-init install-drizzle -my

or

bash nest-init install-drizzle --mysql

  • PostgreSQL

bash nest-init install-drizzle -psql

or

bash nest-init install-drizzle --postgresql

  • MongoDB bash nest-init install-drizzle -m or bash nest-init install-drizzle --mongodb

Setup Authentication Strategies and Services

Nest-Init provides a guided questionnaire to configure authentication services and strategies for your NestJS project. To begin, run the following command:

nest-init add-auth

This command initiates a series of prompts where you can select the options that best fit your project requirements:

Normal Authentication

  • Implement local username/password authentication.

Social Authentication

  • Implement authentication using Facebook, Google, and Github OAuth services.

Resetting Password

  • Enable a built-in password resetting functionality for your project.

Authentication Strategies

  • Nest-Init provides flexible authentication strategies to secure your application based on your project's requirements:

JWT (JSON Web Tokens)

Implement stateless authentication using JWTs, which are compact tokens verified by the server based on contained claims.

Sessions

Supports session-based authentication for managing server-side session states, ideal for applications requiring stateful interactions with clients.

Contributors

Join our Community

Join us in the GDG Algiers' Community Discord here and feel free to ask any questions you may have.

Contributing

Thank you for considering contributing to the Nest-Init project. We welcome contributions from the community to make this project even better. Please take a moment to review our CONTRIBUTION.md file where the Contribution Guidelines are listed.

License

Distributed under the MIT License. See LICENSE for more information.

Contact

GDG Algiers - @gdg_algiers - gdg.algiers@esi.dz

Project Link: https://github.com/GDGAlgiers/nest-init

Core symbols most depended-on inside this repo

installDependency
called by 43
src/utils/packageManager.service.ts
createFile
called by 34
src/authStrategyMethods/authFileManager.ts
checkAndPromptEnvVariables
called by 16
src/utils/check-env-variables.ts
addImportsToAppModule
called by 16
src/utils/fileManager.service.ts
createDirectoryIfNotExists
called by 10
src/utils/fileManager.service.ts
addProviderToAuthModule
called by 8
src/authStrategyMethods/utils/fileManager.ts
asyncExecuteCommand
called by 7
src/utils/asyncExecuteCommand.ts
addProviderToAppModule
called by 6
src/utils/fileManager.service.ts

Shape

Method 99
Class 32
Function 5

Languages

TypeScript100%

Modules by API surface

src/commands/auth-config.command.ts15 symbols
src/commands/drizzle-config.command.ts14 symbols
src/commands/mikro-orm-config.command.ts13 symbols
src/authStrategyMethods/authFileManager.ts13 symbols
src/commands/sequelize-config.command.ts11 symbols
src/commands/typeOrm-config.command.ts10 symbols
src/commands/prisma-config.command.ts10 symbols
src/utils/fileManager.service.ts8 symbols
src/utils/packageManager.service.ts7 symbols
src/authStrategyMethods/utils/fileManager.ts7 symbols
src/commands/mongoose-config.command.ts6 symbols
src/commands/configure.command.ts6 symbols

Datastores touched

(mysql)Database · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add nest-init-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact