@cubocicloide/stack-react-fastapi 13.0.6

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.
Files changed (295) hide show
  1. package/LICENSE +33 -0
  2. package/README.md +66 -0
  3. package/dist/commands/lint/checks/BE/001.d.ts +6 -0
  4. package/dist/commands/lint/checks/BE/001.js +95 -0
  5. package/dist/commands/lint/checks/BE/001.js.map +1 -0
  6. package/dist/commands/lint/checks/BE/002.d.ts +6 -0
  7. package/dist/commands/lint/checks/BE/002.js +30 -0
  8. package/dist/commands/lint/checks/BE/002.js.map +1 -0
  9. package/dist/commands/lint/checks/BE/003.d.ts +11 -0
  10. package/dist/commands/lint/checks/BE/003.js +46 -0
  11. package/dist/commands/lint/checks/BE/003.js.map +1 -0
  12. package/dist/commands/lint/checks/BE/004.d.ts +6 -0
  13. package/dist/commands/lint/checks/BE/004.js +27 -0
  14. package/dist/commands/lint/checks/BE/004.js.map +1 -0
  15. package/dist/commands/lint/checks/BE/005.d.ts +6 -0
  16. package/dist/commands/lint/checks/BE/005.js +107 -0
  17. package/dist/commands/lint/checks/BE/005.js.map +1 -0
  18. package/dist/commands/lint/checks/BE/006.d.ts +6 -0
  19. package/dist/commands/lint/checks/BE/006.js +27 -0
  20. package/dist/commands/lint/checks/BE/006.js.map +1 -0
  21. package/dist/commands/lint/checks/BE/007.d.ts +31 -0
  22. package/dist/commands/lint/checks/BE/007.js +109 -0
  23. package/dist/commands/lint/checks/BE/007.js.map +1 -0
  24. package/dist/commands/lint/checks/BE/008.d.ts +12 -0
  25. package/dist/commands/lint/checks/BE/008.js +57 -0
  26. package/dist/commands/lint/checks/BE/008.js.map +1 -0
  27. package/dist/commands/lint/checks/BE/009.d.ts +12 -0
  28. package/dist/commands/lint/checks/BE/009.js +104 -0
  29. package/dist/commands/lint/checks/BE/009.js.map +1 -0
  30. package/dist/commands/lint/checks/BE/010.d.ts +12 -0
  31. package/dist/commands/lint/checks/BE/010.js +54 -0
  32. package/dist/commands/lint/checks/BE/010.js.map +1 -0
  33. package/dist/commands/lint/checks/BE/011.d.ts +16 -0
  34. package/dist/commands/lint/checks/BE/011.js +46 -0
  35. package/dist/commands/lint/checks/BE/011.js.map +1 -0
  36. package/dist/commands/lint/checks/E2E/001.d.ts +6 -0
  37. package/dist/commands/lint/checks/E2E/001.js +35 -0
  38. package/dist/commands/lint/checks/E2E/001.js.map +1 -0
  39. package/dist/commands/lint/checks/E2E/002.d.ts +6 -0
  40. package/dist/commands/lint/checks/E2E/002.js +37 -0
  41. package/dist/commands/lint/checks/E2E/002.js.map +1 -0
  42. package/dist/commands/lint/checks/E2E/003.d.ts +6 -0
  43. package/dist/commands/lint/checks/E2E/003.js +42 -0
  44. package/dist/commands/lint/checks/E2E/003.js.map +1 -0
  45. package/dist/commands/lint/checks/E2E/004.d.ts +6 -0
  46. package/dist/commands/lint/checks/E2E/004.js +37 -0
  47. package/dist/commands/lint/checks/E2E/004.js.map +1 -0
  48. package/dist/commands/lint/checks/E2E/005.d.ts +6 -0
  49. package/dist/commands/lint/checks/E2E/005.js +47 -0
  50. package/dist/commands/lint/checks/E2E/005.js.map +1 -0
  51. package/dist/commands/lint/checks/E2E/006.d.ts +6 -0
  52. package/dist/commands/lint/checks/E2E/006.js +28 -0
  53. package/dist/commands/lint/checks/E2E/006.js.map +1 -0
  54. package/dist/commands/lint/checks/E2E/007.d.ts +6 -0
  55. package/dist/commands/lint/checks/E2E/007.js +47 -0
  56. package/dist/commands/lint/checks/E2E/007.js.map +1 -0
  57. package/dist/commands/lint/checks/FE/001.d.ts +6 -0
  58. package/dist/commands/lint/checks/FE/001.js +56 -0
  59. package/dist/commands/lint/checks/FE/001.js.map +1 -0
  60. package/dist/commands/lint/checks/FE/002.d.ts +6 -0
  61. package/dist/commands/lint/checks/FE/002.js +80 -0
  62. package/dist/commands/lint/checks/FE/002.js.map +1 -0
  63. package/dist/commands/lint/checks/FE/003.d.ts +6 -0
  64. package/dist/commands/lint/checks/FE/003.js +65 -0
  65. package/dist/commands/lint/checks/FE/003.js.map +1 -0
  66. package/dist/commands/lint/checks/FE/004.d.ts +6 -0
  67. package/dist/commands/lint/checks/FE/004.js +72 -0
  68. package/dist/commands/lint/checks/FE/004.js.map +1 -0
  69. package/dist/commands/lint/checks/FE/005.d.ts +6 -0
  70. package/dist/commands/lint/checks/FE/005.js +103 -0
  71. package/dist/commands/lint/checks/FE/005.js.map +1 -0
  72. package/dist/commands/lint/checks/FE/006.d.ts +6 -0
  73. package/dist/commands/lint/checks/FE/006.js +102 -0
  74. package/dist/commands/lint/checks/FE/006.js.map +1 -0
  75. package/dist/commands/lint/checks/FE/007.d.ts +6 -0
  76. package/dist/commands/lint/checks/FE/007.js +60 -0
  77. package/dist/commands/lint/checks/FE/007.js.map +1 -0
  78. package/dist/commands/lint/checks/FE/008.d.ts +6 -0
  79. package/dist/commands/lint/checks/FE/008.js +115 -0
  80. package/dist/commands/lint/checks/FE/008.js.map +1 -0
  81. package/dist/commands/lint/checks/FE/009.d.ts +6 -0
  82. package/dist/commands/lint/checks/FE/009.js +83 -0
  83. package/dist/commands/lint/checks/FE/009.js.map +1 -0
  84. package/dist/commands/lint/checks/FE/010.d.ts +6 -0
  85. package/dist/commands/lint/checks/FE/010.js +105 -0
  86. package/dist/commands/lint/checks/FE/010.js.map +1 -0
  87. package/dist/commands/lint/checks/FE/011.d.ts +6 -0
  88. package/dist/commands/lint/checks/FE/011.js +43 -0
  89. package/dist/commands/lint/checks/FE/011.js.map +1 -0
  90. package/dist/commands/lint/checks/FE/012.d.ts +6 -0
  91. package/dist/commands/lint/checks/FE/012.js +150 -0
  92. package/dist/commands/lint/checks/FE/012.js.map +1 -0
  93. package/dist/index.d.ts +5 -0
  94. package/dist/index.js +3491 -0
  95. package/dist/index.js.map +1 -0
  96. package/dude.stack.json +7 -0
  97. package/package.json +43 -0
  98. package/templates/aws-eks/backend/Dockerfile.prod.hbs +22 -0
  99. package/templates/aws-eks/docs/docs/deploy.md.hbs +159 -0
  100. package/templates/aws-eks/frontend/Dockerfile.prod +28 -0
  101. package/templates/aws-eks/frontend/nginx.conf +19 -0
  102. package/templates/aws-eks/iac/README.md.hbs +311 -0
  103. package/templates/aws-eks/iac/_gitignore +24 -0
  104. package/templates/aws-eks/iac/helm/app/.helmignore +7 -0
  105. package/templates/aws-eks/iac/helm/app/Chart.yaml.hbs +6 -0
  106. package/templates/aws-eks/iac/helm/app/templates/NOTES.txt +23 -0
  107. package/templates/aws-eks/iac/helm/app/templates/backend-deployment.yaml +44 -0
  108. package/templates/aws-eks/iac/helm/app/templates/backend-service.yaml +16 -0
  109. package/templates/aws-eks/iac/helm/app/templates/celery-beat-deployment.yaml +34 -0
  110. package/templates/aws-eks/iac/helm/app/templates/celery-worker-deployment.yaml +31 -0
  111. package/templates/aws-eks/iac/helm/app/templates/configmap.yaml +15 -0
  112. package/templates/aws-eks/iac/helm/app/templates/flower-deployment.yaml +28 -0
  113. package/templates/aws-eks/iac/helm/app/templates/flower-service.yaml +19 -0
  114. package/templates/aws-eks/iac/helm/app/templates/frontend-deployment.yaml +34 -0
  115. package/templates/aws-eks/iac/helm/app/templates/frontend-service.yaml +16 -0
  116. package/templates/aws-eks/iac/helm/app/templates/helpers.tpl +90 -0
  117. package/templates/aws-eks/iac/helm/app/templates/hpa.yaml +23 -0
  118. package/templates/aws-eks/iac/helm/app/templates/ingress.yaml +30 -0
  119. package/templates/aws-eks/iac/helm/app/templates/migration-job.yaml +38 -0
  120. package/templates/aws-eks/iac/helm/app/templates/redis-deployment.yaml +33 -0
  121. package/templates/aws-eks/iac/helm/app/templates/redis-service.yaml +18 -0
  122. package/templates/aws-eks/iac/helm/app/templates/secret.yaml +17 -0
  123. package/templates/aws-eks/iac/helm/app/templates/serviceaccount.yaml +12 -0
  124. package/templates/aws-eks/iac/helm/app/values-dev.yaml.hbs +35 -0
  125. package/templates/aws-eks/iac/helm/app/values.yaml.hbs +130 -0
  126. package/templates/aws-eks/iac/runner/Dockerfile +53 -0
  127. package/templates/aws-eks/iac/terraform/bootstrap/main.tf.hbs +101 -0
  128. package/templates/aws-eks/iac/terraform/bootstrap/outputs.tf +19 -0
  129. package/templates/aws-eks/iac/terraform/bootstrap/variables.tf.hbs +17 -0
  130. package/templates/aws-eks/iac/terraform/environments/dev/backend.hcl.hbs +12 -0
  131. package/templates/aws-eks/iac/terraform/environments/dev/terraform.tfvars.hbs +32 -0
  132. package/templates/aws-eks/iac/terraform/main.tf.hbs +305 -0
  133. package/templates/aws-eks/iac/terraform/outputs.tf.hbs +52 -0
  134. package/templates/aws-eks/iac/terraform/providers.tf +47 -0
  135. package/templates/aws-eks/iac/terraform/variables.tf.hbs +181 -0
  136. package/templates/aws-eks/iac/terraform/versions.tf +27 -0
  137. package/templates/base/.claude/agents/issue-fixer.md +190 -0
  138. package/templates/base/.claude/agents/security-fixer.md +250 -0
  139. package/templates/base/.claude/rules/BE/001.md +25 -0
  140. package/templates/base/.claude/rules/BE/002.md +15 -0
  141. package/templates/base/.claude/rules/BE/003.md +18 -0
  142. package/templates/base/.claude/rules/BE/004.md +14 -0
  143. package/templates/base/.claude/rules/BE/005.md +15 -0
  144. package/templates/base/.claude/rules/BE/006.md +17 -0
  145. package/templates/base/.claude/rules/BE/007.md +21 -0
  146. package/templates/base/.claude/rules/BE/008.md +19 -0
  147. package/templates/base/.claude/rules/BE/009.md +27 -0
  148. package/templates/base/.claude/rules/BE/010.md +16 -0
  149. package/templates/base/.claude/rules/BE/011.md +15 -0
  150. package/templates/base/.claude/rules/E2E/001.md +13 -0
  151. package/templates/base/.claude/rules/E2E/002.md +14 -0
  152. package/templates/base/.claude/rules/E2E/003.md +10 -0
  153. package/templates/base/.claude/rules/E2E/004.md +23 -0
  154. package/templates/base/.claude/rules/E2E/005.md +15 -0
  155. package/templates/base/.claude/rules/E2E/006.md +13 -0
  156. package/templates/base/.claude/rules/E2E/007.md +18 -0
  157. package/templates/base/.claude/rules/FE/001.md +22 -0
  158. package/templates/base/.claude/rules/FE/002.md +39 -0
  159. package/templates/base/.claude/rules/FE/003.md +19 -0
  160. package/templates/base/.claude/rules/FE/004.md +21 -0
  161. package/templates/base/.claude/rules/FE/005.md +33 -0
  162. package/templates/base/.claude/rules/FE/006.md +24 -0
  163. package/templates/base/.claude/rules/FE/007.md +19 -0
  164. package/templates/base/.claude/rules/FE/008.md +26 -0
  165. package/templates/base/.claude/rules/FE/009.md +30 -0
  166. package/templates/base/.claude/rules/FE/010.md +25 -0
  167. package/templates/base/.claude/rules/FE/011.md +22 -0
  168. package/templates/base/.claude/rules/FE/012.md +32 -0
  169. package/templates/base/.claude/settings.json +53 -0
  170. package/templates/base/.claude/skills/clean-branches/SKILL.md +100 -0
  171. package/templates/base/.claude/skills/create/SKILL.md +47 -0
  172. package/templates/base/.claude/skills/create-jira-issue/SKILL.md +174 -0
  173. package/templates/base/.claude/skills/create-page/SKILL.md +195 -0
  174. package/templates/base/.claude/skills/create-route/SKILL.md +199 -0
  175. package/templates/base/.claude/skills/draft-email/SKILL.md +104 -0
  176. package/templates/base/.claude/skills/fix-issues/SKILL.md +238 -0
  177. package/templates/base/.claude/skills/security-scan/SKILL.md +297 -0
  178. package/templates/base/.claude/skills/verify-security-fixes/SKILL.md +180 -0
  179. package/templates/base/.dude/commands/README.md +85 -0
  180. package/templates/base/.dude/commands/hello.ts +34 -0
  181. package/templates/base/.dude/lint/checks/PRJ/001.ts +26 -0
  182. package/templates/base/.dude/lint/checks/README.md +69 -0
  183. package/templates/base/.vscode/tasks.json +44 -0
  184. package/templates/base/.worktreeinclude +2 -0
  185. package/templates/base/CLAUDE.md.hbs +364 -0
  186. package/templates/base/README.md.hbs +187 -0
  187. package/templates/base/_env.example.hbs +29 -0
  188. package/templates/base/_env.hbs +25 -0
  189. package/templates/base/_gitignore +31 -0
  190. package/templates/base/_npmrc +2 -0
  191. package/templates/base/backend/Dockerfile.hbs +22 -0
  192. package/templates/base/backend/README.md.hbs +74 -0
  193. package/templates/base/backend/_dockerignore +11 -0
  194. package/templates/base/backend/app/__init__.py +1 -0
  195. package/templates/base/backend/app/core/__init__.py +0 -0
  196. package/templates/base/backend/app/core/config.py.hbs +23 -0
  197. package/templates/base/backend/app/fixtures/__init__.py +0 -0
  198. package/templates/base/backend/app/main.py.hbs +41 -0
  199. package/templates/base/backend/app/management/__init__.py +0 -0
  200. package/templates/base/backend/app/models/__init__.py +0 -0
  201. package/templates/base/backend/app/queries/__init__.py +0 -0
  202. package/templates/base/backend/app/routers/__init__.py +0 -0
  203. package/templates/base/backend/app/routers/health.py +13 -0
  204. package/templates/base/backend/app/schemas/__init__.py +0 -0
  205. package/templates/base/backend/app/schemas/health.py +7 -0
  206. package/templates/base/backend/app/tasks/__init__.py +1 -0
  207. package/templates/base/backend/app/tests/__init__.py +0 -0
  208. package/templates/base/backend/app/tests/conftest.py +13 -0
  209. package/templates/base/backend/app/tests/models/__init__.py +0 -0
  210. package/templates/base/backend/app/tests/queries/__init__.py +0 -0
  211. package/templates/base/backend/app/tests/routers/__init__.py +0 -0
  212. package/templates/base/backend/app/tests/routers/test_health.py +10 -0
  213. package/templates/base/backend/app/tests/tasks/__init__.py +1 -0
  214. package/templates/base/backend/app/tests/utils/__init__.py +0 -0
  215. package/templates/base/backend/app/utils/__init__.py +0 -0
  216. package/templates/base/backend/pyproject.toml.hbs +40 -0
  217. package/templates/base/docker-compose.yml.hbs +128 -0
  218. package/templates/base/docs/docs/api.md +21 -0
  219. package/templates/base/docs/docs/dude.md.hbs +316 -0
  220. package/templates/base/docs/docs/index.md.hbs +100 -0
  221. package/templates/base/docs/docs/mkdocs.md +238 -0
  222. package/templates/base/docs/mkdocs.yml.hbs +52 -0
  223. package/templates/base/e2e/.prettierrc.json +1 -0
  224. package/templates/base/e2e/_prettierignore +3 -0
  225. package/templates/base/e2e/cucumber.js +21 -0
  226. package/templates/base/e2e/eslint.config.mjs +14 -0
  227. package/templates/base/e2e/features/example.feature +13 -0
  228. package/templates/base/e2e/package.json.hbs +30 -0
  229. package/templates/base/e2e/pages/ExamplePage.ts +16 -0
  230. package/templates/base/e2e/playwright.config.ts +27 -0
  231. package/templates/base/e2e/steps/common.steps.ts +32 -0
  232. package/templates/base/e2e/steps/example.steps.ts +4 -0
  233. package/templates/base/e2e/support/hooks.ts +72 -0
  234. package/templates/base/e2e/support/world.ts +24 -0
  235. package/templates/base/e2e/tsconfig.json +22 -0
  236. package/templates/base/frontend/.prettierrc.json +6 -0
  237. package/templates/base/frontend/Dockerfile +10 -0
  238. package/templates/base/frontend/_dockerignore +4 -0
  239. package/templates/base/frontend/eslint.config.js +32 -0
  240. package/templates/base/frontend/index.html.hbs +13 -0
  241. package/templates/base/frontend/package.json.hbs +38 -0
  242. package/templates/base/frontend/public/favicon.svg +5 -0
  243. package/templates/base/frontend/src/$components/Layout/$assets/logo.svg +5 -0
  244. package/templates/base/frontend/src/$components/Layout/constants.tsx.hbs +10 -0
  245. package/templates/base/frontend/src/$components/Layout/index.tsx +80 -0
  246. package/templates/base/frontend/src/$components/Layout/types.tsx +9 -0
  247. package/templates/base/frontend/src/$components/index.tsx +1 -0
  248. package/templates/base/frontend/src/$hooks/index.tsx +2 -0
  249. package/templates/base/frontend/src/$hooks/useCounterStore/index.tsx +28 -0
  250. package/templates/base/frontend/src/$hooks/useCounterStore/types.tsx +7 -0
  251. package/templates/base/frontend/src/$hooks/usePageTitle/index.tsx +21 -0
  252. package/templates/base/frontend/src/$types/vite-env.d.ts +10 -0
  253. package/templates/base/frontend/src/App.tsx.hbs +40 -0
  254. package/templates/base/frontend/src/main.tsx +10 -0
  255. package/templates/base/frontend/src/openapi/utils/openapi.yaml.hbs +28 -0
  256. package/templates/base/frontend/src/pages/constants.tsx +31 -0
  257. package/templates/base/frontend/src/pages/index.tsx +192 -0
  258. package/templates/base/frontend/src/pages/types.tsx +6 -0
  259. package/templates/base/frontend/src/styles.module.css +7 -0
  260. package/templates/base/frontend/src/utils/constants.tsx +11 -0
  261. package/templates/base/frontend/src/utils/formatters/index.tsx +49 -0
  262. package/templates/base/frontend/src/utils/functions.tsx +70 -0
  263. package/templates/base/frontend/src/utils/index.tsx +3 -0
  264. package/templates/base/frontend/tsconfig.json +24 -0
  265. package/templates/base/frontend/vite.config.ts +20 -0
  266. package/templates/base/package.json.hbs +11 -0
  267. package/templates/base/security/baseline.json +4 -0
  268. package/templates/celery/backend/app/tasks/__init__.py +1 -0
  269. package/templates/celery/backend/app/tasks/example.py +21 -0
  270. package/templates/celery/backend/app/tests/tasks/test_example.py +7 -0
  271. package/templates/celery/backend/app/worker.py.hbs +33 -0
  272. package/templates/celerybeat/backend/app/tasks/scheduled.py +16 -0
  273. package/templates/celerybeat/backend/app/tests/tasks/test_scheduled.py +7 -0
  274. package/templates/postgres/.dude/commands/reset.ts +76 -0
  275. package/templates/postgres/backend/alembic/env.py +55 -0
  276. package/templates/postgres/backend/alembic/script.py.mako +27 -0
  277. package/templates/postgres/backend/alembic/versions/0001_create_user_table.py +38 -0
  278. package/templates/postgres/backend/alembic.ini +42 -0
  279. package/templates/postgres/backend/app/core/database.py +15 -0
  280. package/templates/postgres/backend/app/models/__init__.py +5 -0
  281. package/templates/postgres/backend/app/models/user.py +15 -0
  282. package/templates/postgres/backend/app/queries/__init__.py +5 -0
  283. package/templates/postgres/backend/app/queries/users.py +18 -0
  284. package/templates/postgres/backend/app/routers/users.py +19 -0
  285. package/templates/postgres/backend/app/routers/users__id.py +20 -0
  286. package/templates/postgres/backend/app/tests/conftest.py +33 -0
  287. package/templates/postgres/backend/app/tests/models/test_user.py +12 -0
  288. package/templates/postgres/backend/app/tests/queries/test_users.py +12 -0
  289. package/templates/postgres/backend/app/tests/routers/test_users.py +10 -0
  290. package/templates/postgres/backend/app/tests/routers/test_users__id.py +9 -0
  291. package/templates/postgres/backend/start.sh +32 -0
  292. package/templates/postgres/frontend/src/openapi/utils/openapi.yaml.hbs +138 -0
  293. package/templates/postgres/frontend/src/pages/users/[id]/index.tsx +51 -0
  294. package/templates/postgres/frontend/src/pages/users/index.tsx +54 -0
  295. package/templates/postgres/frontend/src/pages/users/types.tsx +4 -0
@@ -0,0 +1,316 @@
1
+ # Working with dude
2
+
3
+ [`dude`](https://github.com/cubocicloide/dude) is the project CLI — a single
4
+ entry point for all development tasks. Run `dude help` for a live overview, and
5
+ `dude help <command>` (or `dude help <group> <sub>`) for a command's flags.
6
+
7
+ ---
8
+
9
+ ## Installation
10
+
11
+ `dude` is published on the public npm registry. What you install
12
+ globally is the tiny **launcher** (`@cubocicloide/dude-launcher`); it then runs
13
+ each project's *pinned* CLI + stack automatically — no manual version switching.
14
+
15
+ ```bash
16
+ # 1. Install the launcher globally (the only global install).
17
+ npm install -g @cubocicloide/dude-launcher
18
+ ```
19
+
20
+ Then, inside this project, provision the pinned toolchain (the launcher would
21
+ also do this on the first `dude` command, but doing it explicitly is clearer):
22
+
23
+ ```bash
24
+ pnpm install # installs the pinned @cubocicloide/dude CLI + stack
25
+ dude version # verify the resolved CLI + stack versions
26
+ ```
27
+
28
+
29
+ ---
30
+
31
+ ## Getting started
32
+
33
+ ### First run
34
+
35
+ ```bash
36
+ # Build images and start all services — required the very first time
37
+ dude up
38
+ ```
39
+ {{#if withPostgres}}
40
+
41
+ `dude up` applies pending Alembic migrations automatically on every start, so
42
+ the schema is always current — but a fresh database has no data. Run
43
+ `dude reset` once after this first `dude up` to drop the database, re-apply
44
+ migrations, and seed demo users (see [Database](#database-migrations) below).
45
+ {{/if}}
46
+
47
+ From the second run onward:
48
+
49
+ ```bash
50
+ dude up
51
+ ```
52
+
53
+ Also re-run `dude up --build` whenever you change a `Dockerfile` or
54
+ `pyproject.toml`.
55
+
56
+ ### Services
57
+
58
+ Once the stack is up, open these URLs:
59
+
60
+ | Service | URL | Notes |
61
+ |---------|-----|-------|
62
+ | **Frontend** | http://localhost:5173 | React + Vite — HMR active |
63
+ | **API** | http://localhost:8000 | FastAPI |
64
+ | **Swagger UI** | http://localhost:8000/api/docs | Interactive API explorer |
65
+ | **ReDoc** | http://localhost:8000/api/redoc | API reference docs |
66
+ | **Health** | http://localhost:8000/api/health | JSON health check |
67
+ {{#if withCelery}}| **Flower** | http://localhost:5555 | Celery task monitor |
68
+ {{/if}}
69
+
70
+ ### Hot reload
71
+
72
+ - **Frontend** — Vite HMR is active. Edit any file under `frontend/src/` and
73
+ the browser updates instantly without a full page reload.
74
+ - **Backend** — Uvicorn runs with `--reload`. Edit any Python file under
75
+ `backend/app/` and the API restarts automatically within ~1 second.
76
+
77
+ ---
78
+
79
+ ## Infrastructure
80
+
81
+ All services run in Docker. The `docker-compose.yml` at the project root
82
+ defines every service.
83
+
84
+ | Command | Description |
85
+ |---------|-------------|
86
+ | `dude up --build` | Build images and start all services |
87
+ | `dude up` | Start all services (detached) |
88
+ | `dude down` | Stop and remove containers |
89
+ | `dude logs` | Follow logs for all services |
90
+ | `dude logs backend` | Follow logs for a specific service |
91
+ | `dude shell backend` | Open an interactive shell inside a running container |
92
+
93
+ ---
94
+
95
+ ## Code quality
96
+
97
+ | Command | Description |
98
+ |---------|-------------|
99
+ | `dude lint` | Run all structural lint checks (naming, layout conventions) |
100
+ | `dude format` | Format code — `ruff` (backend) + `prettier` (frontend) |
101
+ | `dude upgrade` | Update the pinned `dude` CLI and stack versions for this project |
102
+ | `dude review` | Run lint + ESLint + API contract review in one pass |
103
+
104
+ ### Project lint rules
105
+
106
+ `dude lint` also runs any rules you define under `.dude/lint/checks/` — the
107
+ rule code is derived from the path (`.dude/lint/checks/PRJ/001.ts` → `PRJ001`)
108
+ and the contract is the same one the stack's own checks use. See
109
+ `.dude/lint/checks/README.md` and the `PRJ/001.ts` example. To disable a
110
+ built-in rule, list its code in `dude.json`:
111
+
112
+ ```json
113
+ { "lint": { "disable": ["BE003"] } }
114
+ ```
115
+
116
+ ### Upgrading pinned versions
117
+
118
+ `dude upgrade` updates version pins only. It does **not** migrate existing
119
+ project files.
120
+
121
+ | Command | Description |
122
+ |---------|-------------|
123
+ | `dude upgrade` | Upgrade both the CLI pin in `package.json` and the stack pin in `dude.json` |
124
+ | `dude upgrade --cli` | Upgrade only `@cubocicloide/dude` |
125
+ | `dude upgrade --stack` | Upgrade only the active stack version |
126
+ | `dude upgrade --cli --cli-version 0.6.1` | Pin the CLI to an explicit version |
127
+ | `dude upgrade --stack --stack-version 5.0.5` | Pin the stack to an explicit version |
128
+ | `dude upgrade --next` | Target the newest published candidate instead of the latest stable release |
129
+
130
+ If a newer version causes issues, roll back by pinning the previous one again:
131
+
132
+ ```bash
133
+ dude upgrade --cli --cli-version 0.6.0
134
+ dude upgrade --stack --stack-version 5.0.4
135
+ pnpm install
136
+ ```
137
+
138
+ ---
139
+
140
+ ## API contract (OpenAPI)
141
+
142
+ The frontend uses a typed API client that is auto-generated from the backend's
143
+ OpenAPI spec. **Never edit files under `frontend/src/openapi/` by hand.**
144
+
145
+ | Command | Description |
146
+ |---------|-------------|
147
+ | `dude api sync` | Fetch OpenAPI spec from the running backend and regenerate the client |
148
+ | `dude api review` | Validate the generated client against the saved spec |
149
+
150
+ **Workflow** — every time you change a backend route:
151
+
152
+ ```bash
153
+ dude api sync
154
+ dude api review
155
+ git add frontend/src/openapi/
156
+ git commit -m "chore(api): sync generated client"
157
+ ```
158
+ {{#if withPostgres}}
159
+
160
+ ---
161
+
162
+ ## Database (migrations)
163
+
164
+ Schema changes are managed with Alembic. These commands run inside the backend
165
+ container.
166
+
167
+ | Command | Description |
168
+ |---------|-------------|
169
+ | `dude reset` | Drop the database, re-apply all migrations, and seed demo data |
170
+ | `dude db makemigration --message "<text>"` | Autogenerate a new migration from model changes |
171
+ | `dude db migrate` | Apply all pending migrations (default target: `head`) |
172
+ | `dude db migrate --revision <rev>` | Migrate up to a specific revision |
173
+ | `dude db rollback` | Downgrade by one revision |
174
+ | `dude db rollback --revision <rev>` | Downgrade to a specific revision |
175
+
176
+ `dude reset` is the fastest way to get a clean database with demo data — use
177
+ it after the first `dude up`, or any time your local data gets into a bad
178
+ state. `dude up` alone only ever applies migrations; it never seeds data or
179
+ touches an existing database.
180
+
181
+ **Workflow** — after changing a SQLAlchemy model:
182
+
183
+ ```bash
184
+ dude db makemigration --message "add users table"
185
+ dude db migrate
186
+ git add backend/app/migrations/
187
+ ```
188
+ {{/if}}
189
+
190
+ ---
191
+
192
+ ## Testing
193
+
194
+ | Command | Description |
195
+ |---------|-------------|
196
+ | `dude test` | Run all test suites (backend + e2e) |
197
+ | `dude test --backend` | pytest only |
198
+ | `dude test --e2e` | Playwright + Cucumber only |
199
+ | `dude test --e2e --headed` | E2e in a visible browser window |
200
+ | `dude test --e2e --report` | E2e with HTML + JSON output to `e2e/reports/` |
201
+
202
+ ---
203
+
204
+ ## Security scanning
205
+
206
+ All scanners run inside Docker — no host-level tool installation required.
207
+ Results are written to `private/sast-reports/latest/`.
208
+
209
+ | Command | Description |
210
+ |---------|-------------|
211
+ | `dude security scan` | Run all scanners; exit 1 if new findings ≥ HIGH |
212
+ | `dude security scan --only bandit,semgrep` | Run a subset of scanners |
213
+ | `dude security scan --fail-on CRITICAL` | Raise the failure threshold |
214
+ | `dude security accept` | Re-scan and absorb all findings into the baseline |
215
+ | `dude security verify --rule-id B105` | Confirm a specific finding has been fixed |
216
+ | `dude security verify --rule-id B105 --remove-resolved` | Fix confirmed → prune from baseline |
217
+
218
+ **Scanners**:
219
+
220
+ | Scanner | What it checks |
221
+ |---------|---------------|
222
+ | `bandit` | Python AST — common security anti-patterns |
223
+ | `semgrep` | Multi-language rules (backend + frontend) |
224
+ | `trivy-fs` | Filesystem: vulnerabilities, IaC misconfigs, secrets |
225
+ | `trivy-image` | Container image CVEs (requires built image) |
226
+
227
+ **Baseline workflow**:
228
+
229
+ ```bash
230
+ dude security scan # review new findings
231
+ # triage: fix what matters, accept acceptable risks
232
+ dude security accept # absorb remaining into security/baseline.json
233
+ git add security/baseline.json && git commit -m "chore(security): update baseline"
234
+ ```
235
+
236
+ !!! note "Baseline"
237
+ `security/baseline.json` must be committed — it is the source of truth for
238
+ accepted findings. Subsequent scans only flag findings that are **not** in the
239
+ baseline.
240
+ {{#if withIac}}
241
+
242
+ ---
243
+
244
+ ## Deploy (infrastructure as code)
245
+
246
+ This project can provision cloud infrastructure and release the app with the
247
+ `dude iac` command group. The commands below are the **stable, target-agnostic
248
+ interface** — what each one *means*. For the concrete infrastructure this
249
+ project provisions (the cloud resources, sizing, and the end-to-end runbook),
250
+ see the **Deploy** page.
251
+
252
+ Every `iac` command is **scoped to one environment via `--env <name>`, which is
253
+ required** (there is no default — this prevents acting on the wrong environment
254
+ by accident). Run any `iac` command **without** `--env` to list the environments
255
+ discovered on disk. Most commands also accept `--profile <name>` to pick the
256
+ cloud credentials profile.
257
+
258
+ ### Lifecycle
259
+
260
+ | Command | Description |
261
+ |---------|-------------|
262
+ | `dude iac login --env <e>` | Configure/verify cloud credentials for an environment |
263
+ | `dude iac bootstrap --env <e> --state-bucket-prefix <p> --yes` | One-time: create the shared remote-state backend (+ container registries) |
264
+ | `dude iac new-env --env <name> [--from <env>]` | Scaffold a new environment by copying an existing one (default source: `dev`) |
265
+ | `dude iac init --env <e>` | Initialise the infra toolchain for the environment |
266
+ | `dude iac plan --env <e>` | Preview the infrastructure changes |
267
+ | `dude iac apply --env <e> [--yes]` | Create/update the infrastructure |
268
+ | `dude iac output --env <e> [--json]` | Show provisioned values (cluster, registry URLs, DB endpoint…) |
269
+ | `dude iac fmt --env <e>` | Format the infra source files |
270
+ | `dude iac validate --env <e>` | Validate the infra configuration |
271
+ | `dude iac destroy --env <e> [--yes]` | Tear the environment down |
272
+
273
+ ### Release the application
274
+
275
+ | Command | Description |
276
+ |---------|-------------|
277
+ | `dude iac kubeconfig --env <e>` | Point your local tooling at the provisioned cluster |
278
+ | `dude iac build --env <e> [--tag <t>]` | Build the backend + frontend production images |
279
+ | `dude iac push --env <e> [--tag <t>]` | Push the images to the registry |
280
+ | `dude iac deploy --env <e> [--tag <t>]` | Release the application to the cluster |
281
+ | `dude iac ship --env <e> [--tag <t>]` | Build + push + deploy in one step (the inner loop) |
282
+ | `dude iac status --env <e>` | Show the deployed release status and pods |
283
+
284
+ > Image tags default to the current git short SHA (with `-dirty` when the working
285
+ > tree has uncommitted changes). Pass `--tag <t>` to override — useful for
286
+ > promoting one already-built image across environments.
287
+
288
+ See the **Deploy** page for the full first-time runbook, how to add new
289
+ environments, and what gets provisioned.
290
+ {{/if}}
291
+
292
+ ---
293
+
294
+ ## Documentation
295
+
296
+ | Command | Description |
297
+ |---------|-------------|
298
+ | `dude docs` | Serve this documentation in dev mode at <http://localhost:8001> |
299
+ | `dude docs --port 9000` | Use a custom port |
300
+ | `dude help --format md` | Print the full command reference as Markdown |
301
+ | `dude help --format json` | Print the same catalog as JSON (for tooling / LLMs) |
302
+
303
+ The **Command reference** page in this site is auto-generated from the live
304
+ command catalog every time you run `dude docs`, so it always matches your
305
+ project's actual commands — including your `dude init` choices and any
306
+ project-local commands under `.dude/commands/`. (It is gitignored; regenerate it
307
+ any time with `dude docs` or `dude help --format md`.)
308
+
309
+ The docs site live-reloads when you edit files under `docs/docs/`.
310
+
311
+ ```bash
312
+ dude docs
313
+ # → open http://localhost:8001
314
+ # → edit docs/docs/*.md
315
+ # → browser refreshes automatically
316
+ ```
@@ -0,0 +1,100 @@
1
+ # Welcome
2
+
3
+ This is the documentation for **{{projectName}}** — a full-stack web application built with React + FastAPI, scaffolded with [`dude`](https://github.com/cubocicloide/dude).
4
+
5
+ ---
6
+
7
+ ## Getting started
8
+
9
+ `dude` is the project CLI, published on the public npm registry. Install the
10
+ global launcher, then provision and start the app.
11
+
12
+ ```bash
13
+ # 1. Install the dude launcher globally (the only global install).
14
+ npm install -g @cubocicloide/dude-launcher
15
+
16
+ # 2. Scaffold the project (how {{projectName}} was created). Already inside it
17
+ # or cloned it? Skip this and go straight to `pnpm install`.
18
+ dude init {{projectName}}
19
+ cd {{projectName}}
20
+
21
+ # 3. Provision the project's pinned toolchain (CLI + stack) from the lockfile.
22
+ pnpm install
23
+
24
+ # 4. Build the images and start every service (first run).
25
+ dude up
26
+ {{#if withPostgres}}
27
+
28
+ # 5. Apply migrations and seed demo data (first run only — see below).
29
+ dude reset
30
+ {{/if}}
31
+ ```
32
+
33
+ From then on, `dude up` starts everything and `dude down` stops it. See
34
+ [Working with dude](dude.md) for the full command reference and
35
+ [the README](https://github.com/cubocicloide/dude) for prerequisites.
36
+ {{#if withPostgres}}
37
+
38
+ !!! tip "First run with PostgreSQL"
39
+ The backend applies pending Alembic migrations automatically on every
40
+ `dude up`, so the schema is always in sync — but a brand-new database has
41
+ no data in it. Run `dude reset` once after the first `dude up` to drop the
42
+ database, re-apply migrations, and seed demo users; otherwise pages like
43
+ **Users** simply render empty until you create data yourself.
44
+ {{/if}}
45
+
46
+ To serve this documentation site:
47
+
48
+ ```bash
49
+ dude docs # → http://localhost:8001
50
+ ```
51
+
52
+ !!! info "Extending this site"
53
+ This site is served straight from `docs/docs/` — add or edit Markdown
54
+ files there and `dude docs` picks them up on save. See
55
+ [Writing docs](mkdocs.md) for the supported syntax and how to add pages.
56
+
57
+ ---
58
+
59
+ ## Contents
60
+
61
+ - [Working with dude](dude.md) — CLI reference: start the stack, run tests, scan for security issues, and more.
62
+ - [Command reference](api.md) — auto-generated list of every command available in this project.
63
+ - [Writing docs](mkdocs.md) — How to add pages to this documentation site and the Markdown syntax supported.
64
+ {{#if withIac}}
65
+ - [Deploy (AWS EKS)](deploy.md) — provision cloud infrastructure and ship the app.
66
+ {{/if}}
67
+
68
+ ---
69
+
70
+ ## Quick links
71
+
72
+ | Resource | URL |
73
+ |----------|-----|
74
+ | Frontend (dev) | <http://localhost:5173> |
75
+ | Backend API | <http://localhost:8000> |
76
+ | Swagger UI | <http://localhost:8000/api/docs> |
77
+ | API health | <http://localhost:8000/api/health> |
78
+ {{#if withCelery}}
79
+ | Flower | <http://localhost:5555> |
80
+ {{/if}}
81
+ | This docs site | <http://localhost:8001> |
82
+
83
+ ---
84
+
85
+ ## Tech stack
86
+
87
+ | Layer | Technology |
88
+ |-------|-----------|
89
+ | Frontend | React 19, Vite, TypeScript (strict), Ant Design, TanStack Query |
90
+ | Backend | FastAPI, SQLModel, Pydantic v2, Python ≥ 3.13, uv |
91
+ {{#if withPostgres}}
92
+ | Database | PostgreSQL, Alembic |
93
+ {{/if}}
94
+ {{#if withCelery}}
95
+ | Async jobs | Celery, Redis, Flower |
96
+ {{/if}}
97
+ | Infra | Docker Compose, Dockerfiles for frontend and backend |
98
+ | Testing | pytest · Playwright + Cucumber |
99
+ | Security | Bandit · Semgrep · Trivy |
100
+ | Docs | MkDocs Material |
@@ -0,0 +1,238 @@
1
+ # Writing docs
2
+
3
+ This project uses [MkDocs Material](https://squidfunk.github.io/mkdocs-material/)
4
+ for documentation. Pages are Markdown files stored under `docs/docs/`.
5
+
6
+ ---
7
+
8
+ ## Getting started
9
+
10
+ Start the live-reload server:
11
+
12
+ ```bash
13
+ dude docs
14
+ ```
15
+
16
+ Open [http://localhost:8001](http://localhost:8001), then edit any `.md` file —
17
+ the browser refreshes automatically.
18
+
19
+ ---
20
+
21
+ ## Adding a page
22
+
23
+ 1. Create a new `.md` file under `docs/docs/` (e.g. `docs/docs/api.md`).
24
+ 2. Add it to the `nav` section in `docs/mkdocs.yml`:
25
+
26
+ ```yaml
27
+ nav:
28
+ - Home: index.md
29
+ - Working with dude: dude.md
30
+ - Writing docs: mkdocs.md
31
+ - API reference: api.md # ← new entry
32
+ ```
33
+
34
+ That is all — MkDocs will include it in the sidebar automatically.
35
+
36
+ ---
37
+
38
+ ## Markdown syntax
39
+
40
+ ### Formatting
41
+
42
+ - **Bold**: `**text**`
43
+ - _Italic_: `_text_`
44
+ - `Code`: `` `text` ``
45
+ - ==Highlight==: `==text==`
46
+ - ^^Underline^^: `^^text^^`
47
+ - ~~Strikethrough~~: `~~text~~`
48
+
49
+ ---
50
+
51
+ ### Admonitions
52
+
53
+ Use admonitions to call out important information:
54
+
55
+ ```markdown
56
+ !!! note "Title"
57
+ Body text here.
58
+
59
+ !!! tip "Tip"
60
+ A helpful hint.
61
+
62
+ !!! warning "Warning"
63
+ Something to be careful about.
64
+
65
+ !!! danger "Danger"
66
+ A critical warning.
67
+ ```
68
+
69
+ Renders as:
70
+
71
+ !!! note "Note"
72
+ Use notes for supplementary information that is useful but not critical.
73
+
74
+ !!! tip "Tip"
75
+ Use tips for best practices and shortcuts.
76
+
77
+ !!! warning "Warning"
78
+ Use warnings for things that can cause unexpected behaviour.
79
+
80
+ !!! danger "Danger"
81
+ Use for actions that can cause data loss or security issues.
82
+
83
+ Collapsible variant (closed by default):
84
+
85
+ ```markdown
86
+ ??? info "Click to expand"
87
+ Hidden until clicked.
88
+ ```
89
+
90
+ Collapsible, open by default:
91
+
92
+ ```markdown
93
+ ???+ info "Expanded by default"
94
+ Visible, but collapsible.
95
+ ```
96
+
97
+ ---
98
+
99
+ ### Code blocks
100
+
101
+ Fenced code block with syntax highlighting:
102
+
103
+ ````markdown
104
+ ```python linenums="1"
105
+ def greet(name: str) -> str:
106
+ return f"Hello, {name}!"
107
+ ```
108
+ ````
109
+
110
+ Renders as:
111
+
112
+ ```python linenums="1"
113
+ def greet(name: str) -> str:
114
+ return f"Hello, {name}!"
115
+ ```
116
+
117
+ With line highlighting:
118
+
119
+ ````markdown
120
+ ```python hl_lines="2 3"
121
+ def example():
122
+ x = 1 # highlighted
123
+ y = 2 # highlighted
124
+ return x + y
125
+ ```
126
+ ````
127
+
128
+ ---
129
+
130
+ ### Diagrams (Mermaid)
131
+
132
+ MkDocs Material renders [Mermaid](https://mermaid.js.org/) diagrams natively:
133
+
134
+ ````markdown
135
+ ```mermaid
136
+ flowchart LR
137
+ A[Frontend] -->|HTTP| B[Backend API]
138
+ B -->|SQL| C[(Database)]
139
+ ```
140
+ ````
141
+
142
+ Renders as:
143
+
144
+ ```mermaid
145
+ flowchart LR
146
+ A[Frontend] -->|HTTP| B[Backend API]
147
+ B -->|SQL| C[(Database)]
148
+ ```
149
+
150
+ Sequence diagram:
151
+
152
+ ```mermaid
153
+ sequenceDiagram
154
+ participant Browser
155
+ participant API
156
+ Browser->>API: GET /api/items
157
+ API-->>Browser: 200 OK [items]
158
+ ```
159
+
160
+ ---
161
+
162
+ ### Tables
163
+
164
+ ```markdown
165
+ | Column A | Column B | Column C |
166
+ |----------|----------|----------|
167
+ | Value 1 | Value 2 | Value 3 |
168
+ | Value 4 | Value 5 | Value 6 |
169
+ ```
170
+
171
+ | Column A | Column B | Column C |
172
+ |----------|----------|----------|
173
+ | Value 1 | Value 2 | Value 3 |
174
+ | Value 4 | Value 5 | Value 6 |
175
+
176
+ ---
177
+
178
+ ### Task lists
179
+
180
+ ```markdown
181
+ - [x] Completed task
182
+ - [ ] Pending task
183
+ - [ ] Another pending task
184
+ ```
185
+
186
+ Renders as:
187
+
188
+ - [x] Completed task
189
+ - [ ] Pending task
190
+ - [ ] Another pending task
191
+
192
+ ---
193
+
194
+ ### Tabs
195
+
196
+ ```markdown
197
+ === "Python"
198
+ ```python
199
+ print("Hello, world!")
200
+ ```
201
+
202
+ === "TypeScript"
203
+ ```typescript
204
+ console.log("Hello, world!")
205
+ ```
206
+ ```
207
+
208
+ === "Python"
209
+ ```python
210
+ print("Hello, world!")
211
+ ```
212
+
213
+ === "TypeScript"
214
+ ```typescript
215
+ console.log("Hello, world!")
216
+ ```
217
+
218
+ ---
219
+
220
+ ### Search
221
+
222
+ Press <kbd>/</kbd> anywhere on the site to jump straight to the search box —
223
+ MkDocs Material indexes every page's content, not just titles.
224
+
225
+ ---
226
+
227
+ ## File structure
228
+
229
+ ```
230
+ docs/
231
+ ├── mkdocs.yml # MkDocs configuration
232
+ └── docs/ # Source pages (edit these)
233
+ ├── index.md # Home page
234
+ ├── dude.md # CLI reference
235
+ └── mkdocs.md # This page
236
+ ```
237
+
238
+ Add new `.md` files here and register them in `mkdocs.yml`.
@@ -0,0 +1,52 @@
1
+ site_name: "{{projectName}}"
2
+
3
+ theme:
4
+ name: material
5
+ features:
6
+ - content.code.annotate
7
+ - content.code.copy
8
+ - navigation.tabs
9
+ - navigation.top
10
+ - navigation.sections
11
+ - toc.integrate
12
+
13
+ plugins:
14
+ - search
15
+
16
+ nav:
17
+ - Home: index.md
18
+ - Working with dude: dude.md
19
+ - Command reference: api.md
20
+ - Writing docs: mkdocs.md
21
+ {{#if withIac}}
22
+ - Deploy (AWS EKS): deploy.md
23
+ {{/if}}
24
+
25
+ markdown_extensions:
26
+ - admonition
27
+ - attr_list
28
+ - def_list
29
+ - footnotes
30
+ - tables
31
+ - pymdownx.details
32
+ - pymdownx.highlight:
33
+ anchor_linenums: true
34
+ - pymdownx.inlinehilite
35
+ - pymdownx.snippets
36
+ - pymdownx.superfences:
37
+ custom_fences:
38
+ - name: mermaid
39
+ class: mermaid
40
+ format: !!python/name:pymdownx.superfences.fence_code_format
41
+ - pymdownx.tabbed:
42
+ alternate_style: true
43
+ - pymdownx.tasklist:
44
+ custom_checkbox: true
45
+ - pymdownx.critic
46
+ - pymdownx.caret
47
+ - pymdownx.mark
48
+ - pymdownx.tilde
49
+ - pymdownx.smartsymbols
50
+ - pymdownx.emoji:
51
+ emoji_index: !!python/name:material.extensions.emoji.twemoji
52
+ emoji_generator: !!python/name:material.extensions.emoji.to_svg
@@ -0,0 +1 @@
1
+ { "semi": false, "singleQuote": true, "tabWidth": 2, "trailingComma": "es5" }
@@ -0,0 +1,3 @@
1
+ reports/
2
+ dist/
3
+ node_modules/