- Backend NestJS : CRUD api_entries + categories, upload YAML multi-fichiers, génération docs AsyncAPI (@asyncapi/cli@6.0.0) et OpenAPI (redocly) - Fix: route wildcard GET /api/apis/:id/*path pour servir les assets statiques (CSS/JS) générés par AsyncAPI HTML template (contournement bug path-to-regexp v8) - Frontend Angular 19 : pages catalog, browse, api-detail, doc-viewer, upload (DSFR) - Seeder de données de démo (idempotent) - Docker Compose dev + Dockerfiles + manifests K8s - Documentation : README, architecture, référence API REST Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
87 lines
2.5 KiB
Markdown
87 lines
2.5 KiB
Markdown
# Datacat
|
|
|
|
Catalogue de données d'API. Importez des fichiers YAML (AsyncAPI ou OpenAPI) et générez automatiquement de la documentation HTML interactive.
|
|
|
|
## Architecture
|
|
|
|
Monorepo pnpm avec quatre sous-projets :
|
|
|
|
```
|
|
datacat/
|
|
├── back/ # API REST — NestJS + TypeORM + PostgreSQL
|
|
├── front-public/ # Interface web — Angular 19 + DSFR
|
|
├── shared/ # Types TypeScript partagés (@datacat/shared)
|
|
└── infra/ # Docker Compose, Dockerfiles, Kubernetes
|
|
```
|
|
|
|
## Prérequis
|
|
|
|
- [Node.js 22 LTS](https://nodejs.org/)
|
|
- [pnpm 10](https://pnpm.io/)
|
|
- [Docker](https://www.docker.com/) (recommandé)
|
|
|
|
## Démarrage rapide
|
|
|
|
```bash
|
|
# Démarrer tous les services (PostgreSQL + backend + frontend)
|
|
docker compose -f infra/docker-compose.yml up -d
|
|
|
|
# Suivre les logs
|
|
docker compose -f infra/docker-compose.yml logs -f
|
|
```
|
|
|
|
## URLs de développement
|
|
|
|
| Service | URL |
|
|
|---------|-----|
|
|
| Frontend | http://localhost:4200 |
|
|
| API | http://localhost:3010/api |
|
|
| Health check | http://localhost:3010/health |
|
|
|
|
## Utilisation
|
|
|
|
1. Ouvrir http://localhost:4200
|
|
2. Naviguer par catégories via **Parcourir** ou voir toutes les APIs via **Catalogue**
|
|
3. Cliquer sur **Importer** pour ajouter un fichier YAML AsyncAPI ou OpenAPI
|
|
4. Une fois la génération terminée (statut **GENERATED**), cliquer sur **Voir la documentation**
|
|
|
|
## Stack technique
|
|
|
|
| Couche | Technologie |
|
|
|--------|-------------|
|
|
| Backend | NestJS 11, TypeORM 0.3, PostgreSQL 17 |
|
|
| Frontend | Angular 19, DSFR |
|
|
| Types partagés | TypeScript 5.8 strict |
|
|
| Génération docs AsyncAPI | `@asyncapi/cli@6.0.0` |
|
|
| Génération docs OpenAPI | `@redocly/cli` |
|
|
|
|
## Développement sans Docker
|
|
|
|
```bash
|
|
# Backend (port 3000)
|
|
cd back && pnpm install && pnpm run start:dev
|
|
|
|
# Frontend (port 4200, avec proxy vers l'API)
|
|
cd front-public && pnpm install && pnpm run start
|
|
```
|
|
|
|
> Créer `front-public/proxy.conf.json` si absent :
|
|
> ```json
|
|
> { "/api": { "target": "http://localhost:3010", "secure": false } }
|
|
> ```
|
|
|
|
## Rebuild complet
|
|
|
|
```bash
|
|
docker compose -f infra/docker-compose.yml down
|
|
docker volume rm datacat_front_node_modules datacat_back_node_modules
|
|
docker compose -f infra/docker-compose.yml build --no-cache
|
|
docker compose -f infra/docker-compose.yml up -d
|
|
```
|
|
|
|
## Documentation
|
|
|
|
- [`documentation/architecture.md`](documentation/architecture.md) — flux, schéma DB, services
|
|
- [`documentation/api-reference.md`](documentation/api-reference.md) — référence complète des endpoints REST
|
|
- [`documentation/CLAUDE.md`](documentation/CLAUDE.md) — guide d'implémentation interne
|