@iconsulting-dev/forgekit 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -5,8 +5,8 @@
5
5
  <h1 align="center">ForgeKit</h1>
6
6
 
7
7
  <p align="center">
8
- CLI de scaffolding full-stack qui génère des projets <strong>Spring Boot + Angular</strong> préconfigurés et prêts à l'emploi.<br/>
9
- Fini la configuration répétitive : une commande, un projet complet.
8
+ CLI de scaffolding full-stack qui génère des projets préconfigurés et prêts à l'emploi.<br/>
9
+ Choisissez votre backend (Spring Boot ou FastAPI), votre frontend, et lancez.
10
10
  </p>
11
11
 
12
12
  ## Installation
@@ -38,9 +38,10 @@ Un wizard vous guide avec des valeurs par défaut modifiables :
38
38
  ```
39
39
  ? Nom du projet : (mon-app)
40
40
  ? Description : (Mon application)
41
- ? Stack à générer : (Backend + Frontend)
42
- ? Group ID : (com.example)
43
- ? Fonctionnalités backend : (Flyway ✓ OpenAPI ✓ JWT ✗ MapStruct ✓)
41
+ ? Backend : (Spring Boot (Java 21) | FastAPI (Python) | Aucun)
42
+ ? Inclure le frontend Angular ? (Oui)
43
+ ? Group ID : (com.example) ← Spring Boot uniquement
44
+ ? Fonctionnalités backend : (Flyway ✓ OpenAPI ✓ JWT ✗ MapStruct ✓) ← Spring Boot uniquement
44
45
  ? Framework UI : (PrimeNG)
45
46
  ? Preset PrimeNG : (Aura)
46
47
  ? Inclure NgRx SignalStore ? (Non)
@@ -50,36 +51,44 @@ Un wizard vous guide avec des valeurs par défaut modifiables :
50
51
  ### Mode commande directe
51
52
 
52
53
  ```bash
53
- forgekit new mon-app --group com.salim --backend --frontend --docker --claude-code
54
+ # Projet Spring Boot + Angular
55
+ forgekit new mon-app --spring-boot --group com.salim --frontend --docker --claude-code
56
+
57
+ # Projet FastAPI + Angular
58
+ forgekit new mon-app --fastapi --frontend --docker --claude-code
59
+
60
+ # Backend FastAPI seul
61
+ forgekit new mon-api --fastapi --no-frontend --no-docker
54
62
  ```
55
63
 
56
64
  ### Options disponibles
57
65
 
58
66
  | Flag | Description |
59
67
  |---|---|
60
- | `--group <id>` | Group ID Java (ex: `com.salim`) |
68
+ | `--spring-boot` | Backend Spring Boot (Java 21) |
69
+ | `--fastapi` | Backend FastAPI (Python 3.12) |
70
+ | `--frontend` / `--no-frontend` | Inclure/exclure le frontend Angular |
71
+ | `--group <id>` | Group ID Java (ex: `com.salim`) — Spring Boot uniquement |
61
72
  | `--description <desc>` | Description du projet |
62
- | `--backend` | Inclure le backend Spring Boot |
63
- | `--frontend` | Inclure le frontend Angular |
64
73
  | `--auth` | Inclure Spring Security + interceptors Angular |
65
74
  | `--flyway` / `--no-flyway` | Inclure/exclure Flyway (migrations SQL) |
66
75
  | `--openapi` / `--no-openapi` | Inclure/exclure OpenAPI / Swagger UI |
67
76
  | `--mapstruct` / `--no-mapstruct` | Inclure/exclure MapStruct |
68
- | `--ngrx` | Inclure NgRx SignalStore |
77
+ | `--ngrx` / `--no-ngrx` | Inclure/exclure NgRx SignalStore |
69
78
  | `--ui <framework>` | Framework UI : `primeng` \| `tailwind` \| `none` |
70
79
  | `--preset <preset>` | Preset PrimeNG : `Aura` \| `Lara` \| `Nora` |
71
- | `--docker` | Inclure Docker Compose |
72
- | `--ci` | Inclure GitHub Actions CI |
73
- | `--claude-code` | Inclure la config Claude Code |
80
+ | `--docker` / `--no-docker` | Inclure/exclure Docker Compose |
81
+ | `--ci` / `--no-ci` | Inclure/exclure GitHub Actions CI |
82
+ | `--claude-code` / `--no-claude-code` | Inclure/exclure la config Claude Code |
74
83
  | `--no-git` | Ne pas initialiser Git |
75
84
 
76
85
  ## Projet généré
77
86
 
78
87
  ```
79
88
  mon-projet/
80
- ├── backend/ # Spring Boot 4.x / Java 21
89
+ ├── backend/ # Spring Boot 4.x / Java 21 — ou — FastAPI / Python 3.12
81
90
  ├── frontend/ # Angular 21 / PrimeNG 21
82
- ├── docker-compose.yml # PostgreSQL 17 + pgAdmin
91
+ ├── docker-compose.yml # PostgreSQL 17 + pgAdmin (+ service api si FastAPI)
83
92
  ├── .github/workflows/ # CI GitHub Actions
84
93
  ├── CLAUDE.md # Conventions Claude Code
85
94
  ├── .claude/settings.json # Permissions Claude Code
@@ -119,6 +128,35 @@ backend/src/main/java/com/{group}/{name}/
119
128
  - `application-dev.yml` — Profil dev pointant vers Docker Compose
120
129
  - `db/migration/V1__init.sql` — Migration Flyway prête
121
130
 
131
+ ### Backend — FastAPI
132
+
133
+ **Stack :** FastAPI, uvicorn, pydantic-settings, pytest, httpx
134
+
135
+ **Structure :**
136
+
137
+ ```
138
+ backend/
139
+ ├── app/
140
+ │ ├── __init__.py
141
+ │ ├── main.py # Entrée FastAPI
142
+ │ ├── config.py # pydantic-settings
143
+ │ └── routers/
144
+ │ └── health.py # GET /health
145
+ ├── tests/
146
+ │ └── test_health.py # pytest + TestClient
147
+ ├── requirements.txt # Dépendances épinglées
148
+ ├── Dockerfile # python:3.12-slim + uvicorn
149
+ └── .python-version # 3.12
150
+ ```
151
+
152
+ **Démarrage :**
153
+ ```bash
154
+ cd backend
155
+ pip install -r requirements.txt
156
+ uvicorn app.main:app --reload # port 8000
157
+ pytest # tests
158
+ ```
159
+
122
160
  ### Frontend — Angular
123
161
 
124
162
  **Framework UI (choix exclusif) :**
@@ -148,44 +186,19 @@ frontend/src/app/
148
186
  └── home/ # Page d'accueil par défaut
149
187
  ```
150
188
 
151
- **Prêt à l'emploi :**
152
- - Layout sidebar/topbar fonctionnel avec design tokens PrimeNG v20+
153
- - Page d'accueil avec cards de démarrage
154
- - Thème Aura PrimeNG appliqué via `providePrimeNG`
155
- - PrimeIcons intégrés
156
- - NgRx SignalStore prêt par feature
157
- - Standalone components, signals, `@if`/`@for`, OnPush
158
- - **Avec `--auth` :** Intercepteurs HTTP + guard + AuthService câblés
159
-
160
189
  ### Docker Compose
161
190
 
162
191
  | Service | Port | Description |
163
192
  |---|---|---|
164
193
  | PostgreSQL 17 | 5432 | Base de données avec volume persistant |
165
194
  | pgAdmin | 5050 | Interface web (admin@admin.com / admin) |
195
+ | api *(FastAPI)* | 8000 | Service FastAPI (si `--fastapi`) |
166
196
 
167
197
  ### Claude Code
168
198
 
169
199
  Génère automatiquement :
170
- - **`CLAUDE.md`** — Conventions du projet, commandes, structure
171
- - **`.claude/settings.json`** — Permissions préconfigurées (mvn, ng, npm, docker)
172
-
173
- ## Démarrage rapide d'un projet généré
174
-
175
- ```bash
176
- # Générer le projet
177
- forgekit new mon-app --group com.salim --backend --frontend --docker --claude-code
178
-
179
- # Démarrer l'infrastructure
180
- cd mon-app
181
- docker compose up -d
182
-
183
- # Démarrer le backend (port 8080)
184
- cd backend && ./mvnw spring-boot:run
185
-
186
- # Démarrer le frontend (port 4200)
187
- cd frontend && npm install && ng serve
188
- ```
200
+ - **`CLAUDE.md`** — Conventions du projet, commandes, structure, workflow speckit
201
+ - **`.claude/settings.json`** — Permissions préconfigurées selon le backend choisi
189
202
 
190
203
  ## Versions dynamiques
191
204
 
@@ -207,22 +220,25 @@ src/
207
220
  ├── prompts/project.ts # Wizard interactif avec validation
208
221
  ├── generators/
209
222
  │ ├── base-generator.ts # Classe abstraite commune
210
- │ ├── backend/index.ts # BackendGenerator
223
+ │ ├── backend/index.ts # BackendGenerator (Spring Boot)
224
+ │ ├── fastapi/index.ts # FastAPIGenerator
211
225
  │ ├── frontend/index.ts # FrontendGenerator
212
226
  │ ├── docker/index.ts # DockerGenerator
213
227
  │ ├── claude-code/index.ts # ClaudeCodeGenerator
214
228
  │ ├── root/index.ts # RootGenerator (README + .gitignore)
215
229
  │ └── git.ts # Initialisation Git
216
- ├── templates/ # 41 templates Handlebars (.hbs)
217
- │ ├── backend/ # 14 templates
218
- │ ├── frontend/ # 21 templates
219
- │ ├── docker/ # 1 template
220
- │ ├── claude-code/ # 2 templates
221
- └── root/ # 2 templates + 1 CI
230
+ ├── templates/ # Templates Handlebars (.hbs)
231
+ │ ├── backend/ # Spring Boot (14 templates)
232
+ │ ├── fastapi/ # FastAPI (8 templates)
233
+ │ ├── frontend/ # Angular (21 templates)
234
+ │ ├── docker/ # Docker Compose
235
+ ├── claude-code/ # CLAUDE.md + settings.json
236
+ │ ├── ci/ # GitHub Actions
237
+ │ └── root/ # README + .gitignore
222
238
  ├── utils/
223
239
  │ ├── template-engine.ts # Handlebars compile + render
224
240
  │ └── validation.ts # Validation inputs
225
- ├── types.ts
241
+ ├── types.ts # BackendType, ProjectConfig
226
242
  ├── versions.ts # Résolution dynamique Maven + NPM
227
243
  └── config.ts # Config persistante (~/.forgekit)
228
244
  ```
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/root/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAuC1D,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generators/root/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAyC1D,wBAAsB,YAAY,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -12,6 +12,8 @@ class RootGenerator extends BaseGenerator {
12
12
  name: this.config.name,
13
13
  description: this.config.description,
14
14
  backend: this.config.backendType !== null,
15
+ springBoot: this.config.backendType === "spring-boot",
16
+ fastapi: this.config.backendType === "fastapi",
15
17
  frontend: this.config.frontend,
16
18
  docker: this.config.docker,
17
19
  versions: this.versions,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/generators/root/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAIrD,MAAM,aAAc,SAAQ,aAAa;IACtB,QAAQ,CAAmB;IAE5C,YACE,UAAkB,EAClB,MAAqB,EACrB,QAA0B;QAE1B,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAC1B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,GAAG;YACX,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW;YACpC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,WAAW,KAAK,IAAI;YACzC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC9B,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;YAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;QAEF,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,cAAc,CACZ,oBAAoB,EACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,EACvC,IAAI,CACL;YACD,cAAc,CACZ,oBAAoB,EACpB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,EACxC,IAAI,CACL;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,UAAkB,EAClB,MAAqB,EACrB,QAA0B;IAE1B,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE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AC,CAAC;IACL,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,UAAkB,EAClB,MAAqB,EACrB,QAA0B;IAE1B,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClE,MAAM,SAAS,CAAC,QAAQ,EAAE,CAAC;AAC7B,CAAC"}
@@ -4,9 +4,12 @@
4
4
 
5
5
  ## Stack
6
6
 
7
- {{#if backend}}
7
+ {{#if springBoot}}
8
8
  - **Backend:** Spring Boot {{versions.springBoot}} / Java 21
9
9
  {{/if}}
10
+ {{#if fastapi}}
11
+ - **Backend:** FastAPI / Python 3.12
12
+ {{/if}}
10
13
  {{#if frontend}}
11
14
  - **Frontend:** Angular {{versions.angular}} / PrimeNG {{versions.primeng}}
12
15
  {{/if}}
@@ -22,16 +25,24 @@
22
25
  docker compose up -d
23
26
 
24
27
  {{/if}}
25
- {{#if backend}}
26
- # Démarrer le backend
28
+ {{#if springBoot}}
29
+ # Démarrer le backend (port 8080)
27
30
  cd backend && ./mvnw spring-boot:run
28
31
 
32
+ {{/if}}
33
+ {{#if fastapi}}
34
+ # Installer les dépendances Python
35
+ cd backend && pip install -r requirements.txt
36
+
37
+ # Démarrer le backend (port 8000)
38
+ uvicorn app.main:app --reload
39
+
29
40
  {{/if}}
30
41
  {{#if frontend}}
31
- # Démarrer le frontend
42
+ # Démarrer le frontend (port 4200)
32
43
  cd frontend && npm install && ng serve
33
44
  {{/if}}
34
45
  ```
35
46
 
36
47
  ---
37
- *Généré avec [ForgeKit](https://github.com/iconsulting/forgekit)*
48
+ *Généré avec [ForgeKit](https://github.com/salimomrani/forgekit)*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iconsulting-dev/forgekit",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "CLI de scaffolding full-stack pour projets Spring Boot + Angular",
5
5
  "type": "module",
6
6
  "bin": {