Skip to content

bradlab/nest-devops-starter

Repository files navigation

Nest API Starter


Nest Logo


🧱 Stack technique

  • Langage : TypeScript
  • Framework : NestJS
  • Base de données : PostgreSQL
  • ORM : TypeORM
  • Conteneurisation : Docker + Docker Compose
  • Architecture : Architecture modulaire

🚀 Démarrage rapide

1. Cloner le dépôt

git clone https://github.com/bradlab/robassime-api.git
cd robassime-api

2. Installer les dépendances

Avec npm :

npm install

Avec yarn :

yarn install

3. Configurer les variables d’environnement

Crée un fichier .env à la racine du projet en t’inspirant du fichier .env.example :

# Exemple de configuration
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=postgres
DATABASE_NAME=robassime
PORT=3000

4. Lancer l’application en mode développement

Avec npm :

npm run start:dev

Avec yarn :

yarn start:dev

L’API sera accessible par défaut sur http://localhost:3000


🐳 Utilisation avec Docker

1. Lancer l’environnement complet

docker-compose up --build

Cela démarre :

  • L’API NestJS
  • La base de données PostgreSQL

2. Arrêter les conteneurs

docker-compose down

📁 Structure du projet

├── .gitignore                      # Fichiers à ignorer par Git
├── .husky/                         # Hooks Git (ex. : pre-commit)
├── .github/
│   └── workflows/                  # Fichiers de configuration GitHub Actions (CI/CD)
├── commitlint.config.cjs           # Configuration pour le lint des messages de commit
├── docker-compose.yml              # Configuration multi-conteneurs Docker (API + DB)
├── Dockerfile                      # Image Docker de l'application
├── jest.config.json                # Configuration de Jest (tests unitaires)
├── nest-cli.json                   # Configuration spécifique à NestJS CLI
├── package.json                    # Dépendances NPM et scripts de projet
├── releaserc.json                  # Configuration de Semantic Release
├── tsconfig.json                   # Configuration du compilateur TypeScript
├── yarn.lock                       # Verrouillage des versions Yarn
└── src/                  # Code source

      └───util

🛠️ Scripts utiles

Commande npm yarn
Start the project npm run start yarn start
Development mode npm run start:dev yarn start:dev
Compiler npm run build yarn build
Lint npm run lint yarn lint
Tests unitaires npm run test yarn test
Tests en mode watch npm run test:watch yarn test:watch
Typescript check npx tsc
Husky Hooks npm run init:hooks yarn init:hooks

🧪 Tests

Avec npm :

npm run test

Avec yarn :

yarn test

🧾 Migrations TypeORM

Create a migration :

npm run typeorm migration:create -- -n migratinName
# ou
yarn typeorm migration:create -n migratinName

Execute migrations :

npm run typeorm migration:run
# ou
yarn typeorm migration:run

Rollback the migration :

npm run typeorm migration:revert
# ou
yarn typeorm migration:revert

📫 Contact

For any questions or contributions :


📝 Licence

This project is licensed under the MIT license. See the LICENSE file for more information.

About

A modern boilerplate for building scalable NestJS applications with a clean DevOps setup. Includes Docker, CI/CD with GitHub Actions, Prettier, ESLint, Jest, and production-ready configuration. Perfect for quickly bootstrapping professional Node.js backends with best practices out of the box.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors