@iconsulting-dev/forgekit 1.4.2 → 1.6.0
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 +26 -13
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +44 -6
- package/dist/commands/new.js.map +1 -1
- package/dist/generators/backend/index.d.ts.map +1 -1
- package/dist/generators/backend/index.js +18 -5
- package/dist/generators/backend/index.js.map +1 -1
- package/dist/generators/ci/index.d.ts.map +1 -1
- package/dist/generators/ci/index.js +5 -1
- package/dist/generators/ci/index.js.map +1 -1
- package/dist/generators/claude-code/index.d.ts.map +1 -1
- package/dist/generators/claude-code/index.js +15 -2
- package/dist/generators/claude-code/index.js.map +1 -1
- package/dist/generators/docker/index.d.ts.map +1 -1
- package/dist/generators/docker/index.js +3 -1
- package/dist/generators/docker/index.js.map +1 -1
- package/dist/generators/fastapi/index.d.ts +3 -0
- package/dist/generators/fastapi/index.d.ts.map +1 -0
- package/dist/generators/fastapi/index.js +32 -0
- package/dist/generators/fastapi/index.js.map +1 -0
- package/dist/generators/frontend/index.d.ts.map +1 -1
- package/dist/generators/frontend/index.js +62 -1
- package/dist/generators/frontend/index.js.map +1 -1
- package/dist/generators/root/index.js +1 -1
- package/dist/generators/root/index.js.map +1 -1
- package/dist/prompts/project.d.ts.map +1 -1
- package/dist/prompts/project.js +110 -38
- package/dist/prompts/project.js.map +1 -1
- package/dist/templates/backend/application.yml.hbs +5 -1
- package/dist/templates/backend/pom.xml.hbs +12 -0
- package/dist/templates/ci/ci.yml.hbs +25 -1
- package/dist/templates/claude-code/CLAUDE.md.hbs +66 -22
- package/dist/templates/claude-code/settings.json.hbs +3 -2
- package/dist/templates/docker/docker-compose.yml.hbs +11 -0
- package/dist/templates/fastapi/Dockerfile.hbs +12 -0
- package/dist/templates/fastapi/config.py.hbs +12 -0
- package/dist/templates/fastapi/gitignore.hbs +13 -0
- package/dist/templates/fastapi/health.py.hbs +8 -0
- package/dist/templates/fastapi/main.py.hbs +6 -0
- package/dist/templates/fastapi/python-version.hbs +1 -0
- package/dist/templates/fastapi/requirements.txt.hbs +5 -0
- package/dist/templates/fastapi/test_health.py.hbs +11 -0
- package/dist/templates/frontend/app.config.ts.hbs +6 -2
- package/dist/templates/frontend/ngrx-app-store.ts.hbs +14 -0
- package/dist/templates/frontend/styles.scss.hbs +17 -0
- package/dist/types.d.ts +10 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/template-engine.d.ts.map +1 -1
- package/dist/utils/template-engine.js +1 -0
- package/dist/utils/template-engine.js.map +1 -1
- package/dist/versions.d.ts +3 -1
- package/dist/versions.d.ts.map +1 -1
- package/dist/versions.js +5 -1
- package/dist/versions.js.map +1 -1
- package/package.json +1 -1
package/dist/prompts/project.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { input, confirm, checkbox } from "@inquirer/prompts";
|
|
1
|
+
import { input, confirm, checkbox, select } from "@inquirer/prompts";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { loadConfig } from "../config.js";
|
|
4
4
|
import { validateProjectName, validateGroupId } from "../utils/validation.js";
|
|
5
5
|
export async function promptProjectConfig(defaults = {}) {
|
|
6
6
|
const saved = await loadConfig();
|
|
7
7
|
const currentDir = path.basename(process.cwd());
|
|
8
|
+
// ── Section 1: Projet ─────────────────────────────────────────────────────
|
|
8
9
|
const name = defaults.name ??
|
|
9
10
|
(await input({
|
|
10
11
|
message: "Nom du projet",
|
|
@@ -16,18 +17,25 @@ export async function promptProjectConfig(defaults = {}) {
|
|
|
16
17
|
message: "Description",
|
|
17
18
|
default: "Mon application",
|
|
18
19
|
}));
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
// ── Section 2: Stack ──────────────────────────────────────────────────────
|
|
21
|
+
const backendType = defaults.backendType !== undefined
|
|
22
|
+
? defaults.backendType
|
|
23
|
+
: await select({
|
|
24
|
+
message: "Backend",
|
|
23
25
|
choices: [
|
|
24
|
-
{ name: "
|
|
25
|
-
{ name: "
|
|
26
|
+
{ name: "Spring Boot (Java 21)", value: "spring-boot" },
|
|
27
|
+
{ name: "FastAPI (Python)", value: "fastapi" },
|
|
28
|
+
{ name: "Aucun", value: null },
|
|
26
29
|
],
|
|
30
|
+
default: "spring-boot",
|
|
27
31
|
});
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
const frontend = defaults.frontend !== undefined
|
|
33
|
+
? defaults.frontend
|
|
34
|
+
: await confirm({
|
|
35
|
+
message: "Inclure le frontend Angular ?",
|
|
36
|
+
default: true,
|
|
37
|
+
});
|
|
38
|
+
const groupId = backendType === "spring-boot"
|
|
31
39
|
? (defaults.groupId ??
|
|
32
40
|
(await input({
|
|
33
41
|
message: "Group ID",
|
|
@@ -35,42 +43,106 @@ export async function promptProjectConfig(defaults = {}) {
|
|
|
35
43
|
validate: validateGroupId,
|
|
36
44
|
})))
|
|
37
45
|
: "com.example";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
46
|
+
// ── Section 3: Backend features ───────────────────────────────────────────
|
|
47
|
+
let flyway = defaults.flyway ?? true;
|
|
48
|
+
let openapi = defaults.openapi ?? true;
|
|
49
|
+
let auth = defaults.auth ?? false;
|
|
50
|
+
let mapstruct = defaults.mapstruct ?? true;
|
|
51
|
+
if (backendType === "spring-boot" &&
|
|
52
|
+
defaults.flyway === undefined &&
|
|
53
|
+
defaults.openapi === undefined &&
|
|
54
|
+
defaults.auth === undefined &&
|
|
55
|
+
defaults.mapstruct === undefined) {
|
|
56
|
+
const backendFeatures = await checkbox({
|
|
57
|
+
message: "Fonctionnalités backend",
|
|
58
|
+
choices: [
|
|
59
|
+
{ name: "Flyway (migrations SQL)", value: "flyway", checked: true },
|
|
60
|
+
{ name: "OpenAPI / Swagger UI", value: "openapi", checked: true },
|
|
61
|
+
{ name: "JWT / Spring Security", value: "auth", checked: false },
|
|
62
|
+
{ name: "MapStruct (mappers)", value: "mapstruct", checked: true },
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
flyway = backendFeatures.includes("flyway");
|
|
66
|
+
openapi = backendFeatures.includes("openapi");
|
|
67
|
+
auth = backendFeatures.includes("auth");
|
|
68
|
+
mapstruct = backendFeatures.includes("mapstruct");
|
|
69
|
+
}
|
|
70
|
+
// ── Section 4: Frontend features ──────────────────────────────────────────
|
|
71
|
+
let uiFramework = defaults.uiFramework ?? "primeng";
|
|
72
|
+
let primeNGPreset = defaults.primeNGPreset ?? "Aura";
|
|
73
|
+
let ngrx = defaults.ngrx ?? false;
|
|
74
|
+
if (frontend) {
|
|
75
|
+
if (defaults.uiFramework === undefined) {
|
|
76
|
+
uiFramework = await select({
|
|
77
|
+
message: "Framework UI",
|
|
78
|
+
choices: [
|
|
79
|
+
{ name: "PrimeNG (recommandé)", value: "primeng" },
|
|
80
|
+
{ name: "Tailwind CSS v4", value: "tailwind" },
|
|
81
|
+
{ name: "Aucun (minimal)", value: "none" },
|
|
82
|
+
],
|
|
83
|
+
default: "primeng",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (uiFramework === "primeng" && defaults.primeNGPreset === undefined) {
|
|
87
|
+
primeNGPreset = await select({
|
|
88
|
+
message: "Preset PrimeNG",
|
|
89
|
+
choices: [
|
|
90
|
+
{ name: "Aura (recommandé)", value: "Aura" },
|
|
91
|
+
{ name: "Lara", value: "Lara" },
|
|
92
|
+
{ name: "Nora", value: "Nora" },
|
|
93
|
+
],
|
|
94
|
+
default: "Aura",
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
if (defaults.ngrx === undefined) {
|
|
98
|
+
ngrx = await confirm({
|
|
99
|
+
message: "Inclure NgRx SignalStore ?",
|
|
42
100
|
default: false,
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// ── Section 5: Infrastructure ─────────────────────────────────────────────
|
|
105
|
+
let docker = defaults.docker ?? true;
|
|
106
|
+
let ci = defaults.ci ?? true;
|
|
107
|
+
let claudeCode = defaults.claudeCode ?? true;
|
|
108
|
+
let gitInit = defaults.gitInit ?? true;
|
|
109
|
+
if (defaults.docker === undefined &&
|
|
110
|
+
defaults.ci === undefined &&
|
|
111
|
+
defaults.claudeCode === undefined &&
|
|
112
|
+
defaults.gitInit === undefined) {
|
|
113
|
+
const infra = await checkbox({
|
|
114
|
+
message: "Infrastructure",
|
|
115
|
+
choices: [
|
|
116
|
+
{
|
|
117
|
+
name: "Docker Compose (PostgreSQL + pgAdmin)",
|
|
118
|
+
value: "docker",
|
|
119
|
+
checked: true,
|
|
120
|
+
},
|
|
121
|
+
{ name: "GitHub Actions CI", value: "ci", checked: true },
|
|
122
|
+
{ name: "Claude Code", value: "claudeCode", checked: true },
|
|
123
|
+
{ name: "Initialiser Git", value: "gitInit", checked: true },
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
docker = infra.includes("docker");
|
|
127
|
+
ci = infra.includes("ci");
|
|
128
|
+
claudeCode = infra.includes("claudeCode");
|
|
129
|
+
gitInit = infra.includes("gitInit");
|
|
130
|
+
}
|
|
65
131
|
return {
|
|
66
132
|
name,
|
|
67
133
|
groupId,
|
|
68
134
|
description,
|
|
69
|
-
|
|
135
|
+
backendType,
|
|
70
136
|
frontend,
|
|
137
|
+
flyway,
|
|
138
|
+
openapi,
|
|
71
139
|
auth,
|
|
72
|
-
|
|
140
|
+
mapstruct,
|
|
141
|
+
uiFramework,
|
|
142
|
+
primeNGPreset,
|
|
143
|
+
ngrx,
|
|
73
144
|
docker,
|
|
145
|
+
ci,
|
|
74
146
|
claudeCode,
|
|
75
147
|
gitInit,
|
|
76
148
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/prompts/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/prompts/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAQ9E,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAAmC,EAAE;IAErC,MAAM,KAAK,GAAG,MAAM,UAAU,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAEhD,6EAA6E;IAC7E,MAAM,IAAI,GACR,QAAQ,CAAC,IAAI;QACb,CAAC,MAAM,KAAK,CAAC;YACX,OAAO,EAAE,eAAe;YACxB,OAAO,EAAE,UAAU;YACnB,QAAQ,EAAE,mBAAmB;SAC9B,CAAC,CAAC,CAAC;IAEN,MAAM,WAAW,GACf,QAAQ,CAAC,WAAW;QACpB,CAAC,MAAM,KAAK,CAAC;YACX,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE,iBAAiB;SAC3B,CAAC,CAAC,CAAC;IAEN,6EAA6E;IAC7E,MAAM,WAAW,GACf,QAAQ,CAAC,WAAW,KAAK,SAAS;QAChC,CAAC,CAAC,QAAQ,CAAC,WAAW;QACtB,CAAC,CAAC,MAAM,MAAM,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oBAC7C,KAAK,EAAE,QAAQ;oBACf,OAAO,EAAE,IAAI;iBACd;gBACD,EAAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;gBACzD,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE;gBAC3D,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;aAC7D;SACF,CAAC,CAAC;QACH,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAClC,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1B,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC1C,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,IAAI;QACJ,OAAO;QACP,WAAW;QACX,WAAW;QACX,QAAQ;QACR,MAAM;QACN,OAAO;QACP,IAAI;QACJ,SAAS;QACT,WAAW;QACX,aAAa;QACb,IAAI;QACJ,MAAM;QACN,EAAE;QACF,UAAU;QACV,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -11,16 +11,18 @@ spring:
|
|
|
11
11
|
|
|
12
12
|
jpa:
|
|
13
13
|
hibernate:
|
|
14
|
-
ddl-auto: validate
|
|
14
|
+
ddl-auto: {{#if flyway}}validate{{else}}update{{/if}}
|
|
15
15
|
open-in-view: false
|
|
16
16
|
properties:
|
|
17
17
|
hibernate:
|
|
18
18
|
format_sql: true
|
|
19
19
|
|
|
20
|
+
{{#if flyway}}
|
|
20
21
|
flyway:
|
|
21
22
|
enabled: true
|
|
22
23
|
locations: classpath:db/migration
|
|
23
24
|
|
|
25
|
+
{{/if}}
|
|
24
26
|
server:
|
|
25
27
|
port: 8080
|
|
26
28
|
|
|
@@ -30,8 +32,10 @@ management:
|
|
|
30
32
|
exposure:
|
|
31
33
|
include: health,info,metrics
|
|
32
34
|
|
|
35
|
+
{{#if openapi}}
|
|
33
36
|
springdoc:
|
|
34
37
|
api-docs:
|
|
35
38
|
path: /v3/api-docs
|
|
36
39
|
swagger-ui:
|
|
37
40
|
path: /swagger-ui.html
|
|
41
|
+
{{/if}}
|
|
@@ -19,8 +19,12 @@
|
|
|
19
19
|
|
|
20
20
|
<properties>
|
|
21
21
|
<java.version>21</java.version>
|
|
22
|
+
{{#if mapstruct}}
|
|
22
23
|
<mapstruct.version>{{versions.mapstruct}}</mapstruct.version>
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#if openapi}}
|
|
23
26
|
<springdoc.version>{{versions.springDoc}}</springdoc.version>
|
|
27
|
+
{{/if}}
|
|
24
28
|
</properties>
|
|
25
29
|
|
|
26
30
|
<dependencies>
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
<artifactId>postgresql</artifactId>
|
|
55
59
|
<scope>runtime</scope>
|
|
56
60
|
</dependency>
|
|
61
|
+
{{#if flyway}}
|
|
57
62
|
<dependency>
|
|
58
63
|
<groupId>org.flywaydb</groupId>
|
|
59
64
|
<artifactId>flyway-core</artifactId>
|
|
@@ -62,13 +67,16 @@
|
|
|
62
67
|
<groupId>org.flywaydb</groupId>
|
|
63
68
|
<artifactId>flyway-database-postgresql</artifactId>
|
|
64
69
|
</dependency>
|
|
70
|
+
{{/if}}
|
|
65
71
|
|
|
72
|
+
{{#if openapi}}
|
|
66
73
|
<!-- OpenAPI -->
|
|
67
74
|
<dependency>
|
|
68
75
|
<groupId>org.springdoc</groupId>
|
|
69
76
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
|
70
77
|
<version>${springdoc.version}</version>
|
|
71
78
|
</dependency>
|
|
79
|
+
{{/if}}
|
|
72
80
|
|
|
73
81
|
<!-- Lombok -->
|
|
74
82
|
<dependency>
|
|
@@ -77,12 +85,14 @@
|
|
|
77
85
|
<optional>true</optional>
|
|
78
86
|
</dependency>
|
|
79
87
|
|
|
88
|
+
{{#if mapstruct}}
|
|
80
89
|
<!-- MapStruct -->
|
|
81
90
|
<dependency>
|
|
82
91
|
<groupId>org.mapstruct</groupId>
|
|
83
92
|
<artifactId>mapstruct</artifactId>
|
|
84
93
|
<version>${mapstruct.version}</version>
|
|
85
94
|
</dependency>
|
|
95
|
+
{{/if}}
|
|
86
96
|
|
|
87
97
|
<!-- Test -->
|
|
88
98
|
<dependency>
|
|
@@ -122,6 +132,7 @@
|
|
|
122
132
|
<groupId>org.projectlombok</groupId>
|
|
123
133
|
<artifactId>lombok</artifactId>
|
|
124
134
|
</path>
|
|
135
|
+
{{#if mapstruct}}
|
|
125
136
|
<path>
|
|
126
137
|
<groupId>org.mapstruct</groupId>
|
|
127
138
|
<artifactId>mapstruct-processor</artifactId>
|
|
@@ -132,6 +143,7 @@
|
|
|
132
143
|
<artifactId>lombok-mapstruct-binding</artifactId>
|
|
133
144
|
<version>0.2.0</version>
|
|
134
145
|
</path>
|
|
146
|
+
{{/if}}
|
|
135
147
|
</annotationProcessorPaths>
|
|
136
148
|
</configuration>
|
|
137
149
|
</plugin>
|
|
@@ -33,7 +33,7 @@ jobs:
|
|
|
33
33
|
- 'frontend/**'
|
|
34
34
|
{{/if}}
|
|
35
35
|
|
|
36
|
-
{{#if
|
|
36
|
+
{{#if springBoot}}
|
|
37
37
|
backend:
|
|
38
38
|
needs: changes
|
|
39
39
|
if: needs.changes.outputs.backend == 'true'
|
|
@@ -55,6 +55,30 @@ jobs:
|
|
|
55
55
|
run: ./mvnw verify --batch-mode --no-transfer-progress
|
|
56
56
|
{{/if}}
|
|
57
57
|
|
|
58
|
+
{{#if fastapi}}
|
|
59
|
+
backend:
|
|
60
|
+
needs: changes
|
|
61
|
+
if: needs.changes.outputs.backend == 'true'
|
|
62
|
+
runs-on: ubuntu-latest
|
|
63
|
+
defaults:
|
|
64
|
+
run:
|
|
65
|
+
working-directory: backend
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
|
|
69
|
+
- name: Set up Python 3.12
|
|
70
|
+
uses: actions/setup-python@v5
|
|
71
|
+
with:
|
|
72
|
+
python-version: '3.12'
|
|
73
|
+
cache: pip
|
|
74
|
+
|
|
75
|
+
- name: Install dependencies
|
|
76
|
+
run: pip install -r requirements.txt
|
|
77
|
+
|
|
78
|
+
- name: Test
|
|
79
|
+
run: pytest
|
|
80
|
+
{{/if}}
|
|
81
|
+
|
|
58
82
|
{{#if frontend}}
|
|
59
83
|
frontend:
|
|
60
84
|
needs: changes
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
```
|
|
8
8
|
{{name}}/
|
|
9
9
|
{{#if backend}}
|
|
10
|
-
├── backend/ #
|
|
10
|
+
├── backend/ # Backend API
|
|
11
11
|
{{/if}}
|
|
12
12
|
{{#if frontend}}
|
|
13
13
|
├── frontend/ # Angular SPA
|
|
@@ -18,44 +18,63 @@
|
|
|
18
18
|
└── README.md
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
{{#if
|
|
21
|
+
{{#if springBoot}}
|
|
22
22
|
## Backend — Spring Boot {{versions.springBoot}}
|
|
23
23
|
|
|
24
|
-
- **Java 21**
|
|
25
|
-
- **Architecture:** Feature-based
|
|
26
|
-
- **DB:** PostgreSQL, Flyway migrations in `backend/src/main/resources/db/migration/`
|
|
27
|
-
- **Conventions:** Records for DTOs, Lombok
|
|
28
|
-
- **Validation:** Jakarta Bean Validation
|
|
29
|
-
- **
|
|
24
|
+
- **Java 21** — records, pattern matching, sealed classes, virtual threads
|
|
25
|
+
- **Architecture:** Feature-based packages — `com.<groupId>.<feature>.{domain,application,infrastructure}`
|
|
26
|
+
- **DB:** PostgreSQL{{#if flyway}}, Flyway migrations in `backend/src/main/resources/db/migration/`{{/if}}
|
|
27
|
+
- **Conventions:** Records for DTOs, Lombok, MapStruct for mappings
|
|
28
|
+
- **Validation:** Jakarta Bean Validation | **Logging:** `@Slf4j`
|
|
29
|
+
- **Skill:** apply `applying-java-conventions` for all Java code
|
|
30
30
|
|
|
31
31
|
### Commands
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
cd backend
|
|
35
35
|
./mvnw spring-boot:run # Start dev server
|
|
36
|
-
./mvnw test
|
|
37
|
-
./mvnw package -DskipTests
|
|
36
|
+
./mvnw test # Run tests
|
|
37
|
+
./mvnw package -DskipTests # Build JAR
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
{{/if}}
|
|
41
|
+
{{#if fastapi}}
|
|
42
|
+
## Backend — FastAPI (Python 3.12)
|
|
43
|
+
|
|
44
|
+
- **FastAPI** with uvicorn, pydantic-settings
|
|
45
|
+
- **Architecture:** `app/routers/`, `app/config.py`, `tests/`
|
|
46
|
+
- **Conventions:** Pydantic models, async endpoints, dependency injection
|
|
47
|
+
- **Skill:** apply `applying-python-conventions` for all Python code
|
|
48
|
+
|
|
49
|
+
### Commands
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cd backend
|
|
53
|
+
uvicorn app.main:app --reload # Start dev server (port 8000)
|
|
54
|
+
pytest # Run tests
|
|
55
|
+
pip install -r requirements.txt # Install dependencies
|
|
38
56
|
```
|
|
39
57
|
|
|
40
58
|
{{/if}}
|
|
41
59
|
{{#if frontend}}
|
|
42
|
-
## Frontend — Angular
|
|
60
|
+
## Frontend — Angular {{versions.angular}}
|
|
43
61
|
|
|
44
|
-
- **Angular {{versions.angular}}**
|
|
62
|
+
- **Angular {{versions.angular}}** — strict mode, standalone components, signals
|
|
45
63
|
- **UI:** PrimeNG {{versions.primeng}}, theme Aura, PrimeFlex
|
|
64
|
+
{{#if ngrx}}
|
|
46
65
|
- **State:** NgRx SignalStore
|
|
47
|
-
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
66
|
+
{{/if}}
|
|
67
|
+
- **Conventions:** OnPush, `input()`/`output()`, `inject()`, `@if`/`@for` control flow
|
|
68
|
+
- **Skill:** apply `applying-angular-conventions` for all Angular/TypeScript code
|
|
50
69
|
|
|
51
70
|
### Commands
|
|
52
71
|
|
|
53
72
|
```bash
|
|
54
73
|
cd frontend
|
|
55
|
-
npm install
|
|
56
|
-
ng serve
|
|
57
|
-
ng build
|
|
58
|
-
ng test
|
|
74
|
+
npm install # Install dependencies
|
|
75
|
+
ng serve # Start dev server (port 4200)
|
|
76
|
+
ng build # Production build
|
|
77
|
+
ng test # Run tests
|
|
59
78
|
```
|
|
60
79
|
|
|
61
80
|
{{/if}}
|
|
@@ -63,17 +82,42 @@ ng test # Run tests
|
|
|
63
82
|
## Infrastructure
|
|
64
83
|
|
|
65
84
|
```bash
|
|
66
|
-
docker compose up -d
|
|
67
|
-
docker compose down
|
|
85
|
+
docker compose up -d # Start PostgreSQL + pgAdmin
|
|
86
|
+
docker compose down # Stop services
|
|
68
87
|
```
|
|
69
88
|
|
|
70
89
|
- **PostgreSQL:** localhost:5432
|
|
71
90
|
- **pgAdmin:** localhost:5050 (admin@admin.com / admin)
|
|
72
91
|
|
|
73
92
|
{{/if}}
|
|
93
|
+
## Workflow
|
|
94
|
+
|
|
95
|
+
| Scenario | Action |
|
|
96
|
+
|---|---|
|
|
97
|
+
| New feature | `/speckit.workflow` — routes automatiquement (fast track ou full workflow spec→PR) |
|
|
98
|
+
| Bug | Describe to Claude → apply `superpowers:systematic-debugging` |
|
|
99
|
+
| UI component | Apply `frontend-design:frontend-design` skill |
|
|
100
|
+
| Commit / PR | Use `commit-commands:commit-push-pr` skill |
|
|
101
|
+
|
|
102
|
+
## TDD
|
|
103
|
+
|
|
104
|
+
Write the failing test first — no implementation code before a red test.
|
|
105
|
+
**Red → Green → Refactor.** This is not optional.
|
|
106
|
+
|
|
107
|
+
## Source of Truth
|
|
108
|
+
|
|
109
|
+
{{#if springBoot}}
|
|
110
|
+
- **API contract:** OpenAPI annotations on controllers (Springdoc)
|
|
111
|
+
{{#if flyway}}
|
|
112
|
+
- **DB schema:** Flyway migrations — never modify existing migration files
|
|
113
|
+
{{/if}}
|
|
114
|
+
{{/if}}
|
|
115
|
+
- **Config:** `application.yml` (never `application.properties`)
|
|
116
|
+
- **Secrets:** environment variables only — never committed
|
|
117
|
+
|
|
74
118
|
## Conventions
|
|
75
119
|
|
|
76
120
|
- **Git:** Conventional commits (`feat:`, `fix:`, `refactor:`, `chore:`)
|
|
77
121
|
- **Branches:** `feature/`, `fix/`, `refactor/`, `chore/`
|
|
78
122
|
- **DB:** snake_case naming
|
|
79
|
-
- **Security:** Never commit secrets
|
|
123
|
+
- **Security:** Never commit secrets — use environment variables
|
|
@@ -29,6 +29,17 @@ services:
|
|
|
29
29
|
depends_on:
|
|
30
30
|
postgres:
|
|
31
31
|
condition: service_healthy
|
|
32
|
+
{{#if fastapi}}
|
|
33
|
+
|
|
34
|
+
api:
|
|
35
|
+
build: ./backend
|
|
36
|
+
container_name: {{name}}_api
|
|
37
|
+
restart: unless-stopped
|
|
38
|
+
ports:
|
|
39
|
+
- "8000:8000"
|
|
40
|
+
environment:
|
|
41
|
+
DEBUG: "false"
|
|
42
|
+
{{/if}}
|
|
32
43
|
|
|
33
44
|
volumes:
|
|
34
45
|
postgres_data:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
|
|
2
2
|
import { provideRouter, withComponentInputBinding } from '@angular/router';
|
|
3
3
|
import { provideHttpClient{{#if auth}}, withInterceptors{{/if}} } from '@angular/common/http';
|
|
4
|
+
{{#if uiPrimeNG}}
|
|
4
5
|
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
|
5
6
|
import { providePrimeNG } from 'primeng/config';
|
|
6
|
-
import
|
|
7
|
+
import {{primeNGPreset}} from '@primeuix/themes/{{lowerCase primeNGPreset}}';
|
|
8
|
+
{{/if}}
|
|
7
9
|
import { routes } from './app.routes';
|
|
8
10
|
{{#if auth}}
|
|
9
11
|
import { authInterceptor } from './core/interceptors/auth.interceptor';
|
|
@@ -19,14 +21,16 @@ export const appConfig: ApplicationConfig = {
|
|
|
19
21
|
{{else}}
|
|
20
22
|
provideHttpClient(),
|
|
21
23
|
{{/if}}
|
|
24
|
+
{{#if uiPrimeNG}}
|
|
22
25
|
provideAnimationsAsync(),
|
|
23
26
|
providePrimeNG({
|
|
24
27
|
theme: {
|
|
25
|
-
preset:
|
|
28
|
+
preset: {{primeNGPreset}},
|
|
26
29
|
options: {
|
|
27
30
|
darkModeSelector: false,
|
|
28
31
|
},
|
|
29
32
|
},
|
|
30
33
|
}),
|
|
34
|
+
{{/if}}
|
|
31
35
|
],
|
|
32
36
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { signalStore, withState } from '@ngrx/signals';
|
|
2
|
+
|
|
3
|
+
export type AppState = {
|
|
4
|
+
loading: boolean;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const initialState: AppState = {
|
|
8
|
+
loading: false,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const AppStore = signalStore(
|
|
12
|
+
{ providedIn: 'root' },
|
|
13
|
+
withState(initialState),
|
|
14
|
+
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
{{#if uiPrimeNG}}
|
|
1
2
|
@import "primeicons/primeicons.css";
|
|
2
3
|
|
|
3
4
|
html, body {
|
|
@@ -7,3 +8,19 @@ html, body {
|
|
|
7
8
|
background: var(--p-surface-ground);
|
|
8
9
|
color: var(--p-text-color);
|
|
9
10
|
}
|
|
11
|
+
{{/if}}
|
|
12
|
+
{{#if uiTailwind}}
|
|
13
|
+
@import "tailwindcss";
|
|
14
|
+
|
|
15
|
+
html, body {
|
|
16
|
+
height: 100%;
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
{{/if}}
|
|
20
|
+
{{#if uiNone}}
|
|
21
|
+
html, body {
|
|
22
|
+
height: 100%;
|
|
23
|
+
margin: 0;
|
|
24
|
+
font-family: sans-serif;
|
|
25
|
+
}
|
|
26
|
+
{{/if}}
|