https://github.com/bradlab/sygdn-api
A digital tool that enables notaries to centralize, track, and manage their client files
https://github.com/bradlab/sygdn-api
dockerfile linter nestjs nestjs-graphql nodejs postgresql security typescript
Last synced: 3 months ago
JSON representation
A digital tool that enables notaries to centralize, track, and manage their client files
- Host: GitHub
- URL: https://github.com/bradlab/sygdn-api
- Owner: bradlab
- Created: 2025-05-09T20:11:50.000Z (about 1 year ago)
- Default Branch: develop
- Last Pushed: 2025-05-20T21:26:41.000Z (about 1 year ago)
- Last Synced: 2025-05-20T21:47:42.428Z (about 1 year ago)
- Topics: dockerfile, linter, nestjs, nestjs-graphql, nodejs, postgresql, security, typescript
- Language: TypeScript
- Homepage:
- Size: 469 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SyGDN-API
Gestion des dossiers dans les cabinets de notaire. Chaque dossier est créé dans un domaine ou sous-domaine spécifique. Pour chaque domaine/sous-domaine, il y a des étapes (avec une durée donnée) par lesquelles les dossiers passent avant la fin de leur traitement.
> API backend développée avec [NestJS](https://nestjs.com/) en TypeScript, suivant le principe de **Clean Architecture**.
> Elle utilise PostgreSQL comme base de données, TypeORM pour la couche ORM, et Docker pour l’environnement de développement et de production.
---
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
---
## 🧱 Stack technique
- **Langage** : TypeScript
- **Framework** : [NestJS](https://nestjs.com/)
- **Base de données** : PostgreSQL
- **ORM** : TypeORM
- **Conteneurisation** : Docker + Docker Compose
- **Architecture** : Clean Architecture (domain > application > infrastructure > interface)
---
## 🚀 Fonctionnalités principales
- 🔧 Framework : [NestJS](https://nestjs.com/)
- 🔍 Documentation REST via Swagger
- 🔮 Interface GraphQL via Apollo Server
- 🐘 Base de données PostgreSQL
- 📝 Journalisation avec Winston
- 🧪 Prise en charge des tests (unitaires et E2E)
- 🧩 Architecture modulaire
- 🔐 Validation et sécurité intégrées
### Prérequis
- Node.js >= 22
- PostgreSQL
- npm, yarn ou pnpm
## 🚀 Démarrage rapide
### 1. Cloner le dépôt
```bash
git clone https://github.com/bradlab/sygdn-api.git
cd sygdn-api
```
### 2. Installer les dépendances
#### Avec npm :
```bash
npm install
```
#### Avec yarn :
```bash
yarn install
```
---
### 3. Configurer les variables d’environnement
Crée un fichier `.env` à la racine du projet en t’inspirant du fichier `.env.example` :
```env
# Exemple de configuration
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USERNAME=db_user
DATABASE_PASSWORD=user_password
DATABASE_NAME=db_name
PORT=3000
```
Ajouter le nom du fichier .env dans la config de app.module.ts
---
### 4. Lancer l’application en mode développement
#### Avec npm :
```bash
npm run start:dev
```
#### Avec yarn :
```bash
yarn start:dev
```
---
## 🐳 Utilisation avec Docker
### 1. Lancer l’environnement complet
```bash
docker-compose up --build
```
Cela démarre :
- L’API NestJS
- La base de données PostgreSQL
---
### 2. Arrêter les conteneurs
```bash
docker-compose down
```
---
## 📁 Structure du projet (Clean Architecture)
## 🛠️ Scripts utiles
| Commande | npm | yarn |
|---------------------------------|---------------------------|--------------------------|
| Démarrer l'app | `npm run start` | `yarn start` |
| Mode développement | `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` |
---
Swagger (REST)
Accessible via :
[http://localhost:3000/doc](http://localhost:3000/doc)
GraphQL Playground
Accessible via :
[http://localhost:3000/graphql](http://localhost:3000/graphql)
## 🧪 Tests
#### Avec npm :
```bash
npm run test
```
#### Avec yarn :
```bash
yarn test
```
---
## 🧾 Migrations TypeORM
#### Créer une migration :
```bash
npm run typeorm migration:create -- -n NomMigration
# ou
yarn typeorm migration:create -n NomMigration
```
#### Exécuter les migrations :
```bash
npm run typeorm migration:run
# ou
yarn typeorm migration:run
```
#### Revenir en arrière :
```bash
npm run typeorm migration:revert
# ou
yarn typeorm migration:revert
```
---
## 📫 Contact
Pour toute question ou contribution :
- Auteur : **bradlab**
- Email : `matbradiouf@gmail.com`
- GitHub : [https://github.com/bradlab](https://github.com/bradlab)
---
## 📝 Licence
Ce projet est sous licence **MIT**. Voir le fichier `LICENSE` pour plus d’informations.