@cubocicloide/stack-react-django 3.0.4

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 (289) 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 +94 -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 +136 -0
  8. package/dist/commands/lint/checks/BE/002.js.map +1 -0
  9. package/dist/commands/lint/checks/BE/003.d.ts +6 -0
  10. package/dist/commands/lint/checks/BE/003.js +89 -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 +68 -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 +55 -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 +95 -0
  20. package/dist/commands/lint/checks/BE/006.js.map +1 -0
  21. package/dist/commands/lint/checks/BE/007.d.ts +6 -0
  22. package/dist/commands/lint/checks/BE/007.js +53 -0
  23. package/dist/commands/lint/checks/BE/007.js.map +1 -0
  24. package/dist/commands/lint/checks/BE/008.d.ts +6 -0
  25. package/dist/commands/lint/checks/BE/008.js +70 -0
  26. package/dist/commands/lint/checks/BE/008.js.map +1 -0
  27. package/dist/commands/lint/checks/BE/009.d.ts +6 -0
  28. package/dist/commands/lint/checks/BE/009.js +112 -0
  29. package/dist/commands/lint/checks/BE/009.js.map +1 -0
  30. package/dist/commands/lint/checks/BE/010.d.ts +6 -0
  31. package/dist/commands/lint/checks/BE/010.js +76 -0
  32. package/dist/commands/lint/checks/BE/010.js.map +1 -0
  33. package/dist/commands/lint/checks/BE/011.d.ts +6 -0
  34. package/dist/commands/lint/checks/BE/011.js +76 -0
  35. package/dist/commands/lint/checks/BE/011.js.map +1 -0
  36. package/dist/commands/lint/checks/BE/012.d.ts +6 -0
  37. package/dist/commands/lint/checks/BE/012.js +61 -0
  38. package/dist/commands/lint/checks/BE/012.js.map +1 -0
  39. package/dist/commands/lint/checks/BE/013.d.ts +6 -0
  40. package/dist/commands/lint/checks/BE/013.js +98 -0
  41. package/dist/commands/lint/checks/BE/013.js.map +1 -0
  42. package/dist/commands/lint/checks/BE/014.d.ts +6 -0
  43. package/dist/commands/lint/checks/BE/014.js +64 -0
  44. package/dist/commands/lint/checks/BE/014.js.map +1 -0
  45. package/dist/commands/lint/checks/E2E/001.d.ts +6 -0
  46. package/dist/commands/lint/checks/E2E/001.js +35 -0
  47. package/dist/commands/lint/checks/E2E/001.js.map +1 -0
  48. package/dist/commands/lint/checks/E2E/002.d.ts +6 -0
  49. package/dist/commands/lint/checks/E2E/002.js +37 -0
  50. package/dist/commands/lint/checks/E2E/002.js.map +1 -0
  51. package/dist/commands/lint/checks/E2E/003.d.ts +6 -0
  52. package/dist/commands/lint/checks/E2E/003.js +42 -0
  53. package/dist/commands/lint/checks/E2E/003.js.map +1 -0
  54. package/dist/commands/lint/checks/E2E/004.d.ts +6 -0
  55. package/dist/commands/lint/checks/E2E/004.js +37 -0
  56. package/dist/commands/lint/checks/E2E/004.js.map +1 -0
  57. package/dist/commands/lint/checks/E2E/005.d.ts +6 -0
  58. package/dist/commands/lint/checks/E2E/005.js +47 -0
  59. package/dist/commands/lint/checks/E2E/005.js.map +1 -0
  60. package/dist/commands/lint/checks/E2E/006.d.ts +6 -0
  61. package/dist/commands/lint/checks/E2E/006.js +28 -0
  62. package/dist/commands/lint/checks/E2E/006.js.map +1 -0
  63. package/dist/commands/lint/checks/E2E/007.d.ts +6 -0
  64. package/dist/commands/lint/checks/E2E/007.js +47 -0
  65. package/dist/commands/lint/checks/E2E/007.js.map +1 -0
  66. package/dist/commands/lint/checks/FE/001.d.ts +6 -0
  67. package/dist/commands/lint/checks/FE/001.js +56 -0
  68. package/dist/commands/lint/checks/FE/001.js.map +1 -0
  69. package/dist/commands/lint/checks/FE/002.d.ts +6 -0
  70. package/dist/commands/lint/checks/FE/002.js +80 -0
  71. package/dist/commands/lint/checks/FE/002.js.map +1 -0
  72. package/dist/commands/lint/checks/FE/003.d.ts +6 -0
  73. package/dist/commands/lint/checks/FE/003.js +65 -0
  74. package/dist/commands/lint/checks/FE/003.js.map +1 -0
  75. package/dist/commands/lint/checks/FE/004.d.ts +6 -0
  76. package/dist/commands/lint/checks/FE/004.js +72 -0
  77. package/dist/commands/lint/checks/FE/004.js.map +1 -0
  78. package/dist/commands/lint/checks/FE/005.d.ts +6 -0
  79. package/dist/commands/lint/checks/FE/005.js +103 -0
  80. package/dist/commands/lint/checks/FE/005.js.map +1 -0
  81. package/dist/commands/lint/checks/FE/006.d.ts +6 -0
  82. package/dist/commands/lint/checks/FE/006.js +102 -0
  83. package/dist/commands/lint/checks/FE/006.js.map +1 -0
  84. package/dist/commands/lint/checks/FE/007.d.ts +6 -0
  85. package/dist/commands/lint/checks/FE/007.js +60 -0
  86. package/dist/commands/lint/checks/FE/007.js.map +1 -0
  87. package/dist/commands/lint/checks/FE/008.d.ts +6 -0
  88. package/dist/commands/lint/checks/FE/008.js +115 -0
  89. package/dist/commands/lint/checks/FE/008.js.map +1 -0
  90. package/dist/commands/lint/checks/FE/009.d.ts +6 -0
  91. package/dist/commands/lint/checks/FE/009.js +83 -0
  92. package/dist/commands/lint/checks/FE/009.js.map +1 -0
  93. package/dist/commands/lint/checks/FE/010.d.ts +6 -0
  94. package/dist/commands/lint/checks/FE/010.js +105 -0
  95. package/dist/commands/lint/checks/FE/010.js.map +1 -0
  96. package/dist/commands/lint/checks/FE/011.d.ts +6 -0
  97. package/dist/commands/lint/checks/FE/011.js +43 -0
  98. package/dist/commands/lint/checks/FE/011.js.map +1 -0
  99. package/dist/commands/lint/checks/FE/012.d.ts +6 -0
  100. package/dist/commands/lint/checks/FE/012.js +150 -0
  101. package/dist/commands/lint/checks/FE/012.js.map +1 -0
  102. package/dist/index.d.ts +5 -0
  103. package/dist/index.js +3436 -0
  104. package/dist/index.js.map +1 -0
  105. package/dude.stack.json +13 -0
  106. package/package.json +43 -0
  107. package/templates/aws-ecs/backend/Dockerfile.prod +34 -0
  108. package/templates/aws-ecs/docs/docs/deploy.md.hbs +54 -0
  109. package/templates/aws-ecs/frontend/Dockerfile.prod +28 -0
  110. package/templates/aws-ecs/frontend/nginx.conf +21 -0
  111. package/templates/aws-ecs/iac/README.md.hbs +75 -0
  112. package/templates/aws-ecs/iac/_gitignore +14 -0
  113. package/templates/aws-ecs/iac/runner/Dockerfile +35 -0
  114. package/templates/aws-ecs/iac/terraform/bootstrap/main.tf.hbs +102 -0
  115. package/templates/aws-ecs/iac/terraform/bootstrap/outputs.tf +19 -0
  116. package/templates/aws-ecs/iac/terraform/bootstrap/variables.tf.hbs +17 -0
  117. package/templates/aws-ecs/iac/terraform/environments/dev/backend.hcl.hbs +12 -0
  118. package/templates/aws-ecs/iac/terraform/environments/dev/terraform.tfvars.hbs +43 -0
  119. package/templates/aws-ecs/iac/terraform/main.tf.hbs +949 -0
  120. package/templates/aws-ecs/iac/terraform/outputs.tf.hbs +71 -0
  121. package/templates/aws-ecs/iac/terraform/providers.tf +19 -0
  122. package/templates/aws-ecs/iac/terraform/variables.tf.hbs +113 -0
  123. package/templates/aws-ecs/iac/terraform/versions.tf +19 -0
  124. package/templates/base/.claude/agents/issue-fixer.md +190 -0
  125. package/templates/base/.claude/agents/security-fixer.md +250 -0
  126. package/templates/base/.claude/rules/BE/001.md +19 -0
  127. package/templates/base/.claude/rules/BE/002.md +21 -0
  128. package/templates/base/.claude/rules/BE/003.md +19 -0
  129. package/templates/base/.claude/rules/BE/004.md +16 -0
  130. package/templates/base/.claude/rules/BE/005.md +23 -0
  131. package/templates/base/.claude/rules/BE/006.md +13 -0
  132. package/templates/base/.claude/rules/BE/007.md +24 -0
  133. package/templates/base/.claude/rules/BE/008.md +19 -0
  134. package/templates/base/.claude/rules/BE/009.md +18 -0
  135. package/templates/base/.claude/rules/BE/010.md +15 -0
  136. package/templates/base/.claude/rules/BE/011.md +17 -0
  137. package/templates/base/.claude/rules/BE/012.md +18 -0
  138. package/templates/base/.claude/rules/BE/013.md +22 -0
  139. package/templates/base/.claude/rules/BE/014.md +15 -0
  140. package/templates/base/.claude/rules/E2E/001.md +13 -0
  141. package/templates/base/.claude/rules/E2E/002.md +14 -0
  142. package/templates/base/.claude/rules/E2E/003.md +10 -0
  143. package/templates/base/.claude/rules/E2E/004.md +23 -0
  144. package/templates/base/.claude/rules/E2E/005.md +15 -0
  145. package/templates/base/.claude/rules/E2E/006.md +13 -0
  146. package/templates/base/.claude/rules/E2E/007.md +18 -0
  147. package/templates/base/.claude/rules/FE/001.md +22 -0
  148. package/templates/base/.claude/rules/FE/002.md +39 -0
  149. package/templates/base/.claude/rules/FE/003.md +19 -0
  150. package/templates/base/.claude/rules/FE/004.md +21 -0
  151. package/templates/base/.claude/rules/FE/005.md +33 -0
  152. package/templates/base/.claude/rules/FE/006.md +24 -0
  153. package/templates/base/.claude/rules/FE/007.md +19 -0
  154. package/templates/base/.claude/rules/FE/008.md +26 -0
  155. package/templates/base/.claude/rules/FE/009.md +30 -0
  156. package/templates/base/.claude/rules/FE/010.md +25 -0
  157. package/templates/base/.claude/rules/FE/011.md +22 -0
  158. package/templates/base/.claude/rules/FE/012.md +32 -0
  159. package/templates/base/.claude/settings.json +53 -0
  160. package/templates/base/.claude/skills/clean-branches/SKILL.md +100 -0
  161. package/templates/base/.claude/skills/create/SKILL.md +47 -0
  162. package/templates/base/.claude/skills/create-jira-issue/SKILL.md +174 -0
  163. package/templates/base/.claude/skills/create-page/SKILL.md +195 -0
  164. package/templates/base/.claude/skills/create-route/SKILL.md +156 -0
  165. package/templates/base/.claude/skills/draft-email/SKILL.md +104 -0
  166. package/templates/base/.claude/skills/fix-issues/SKILL.md +238 -0
  167. package/templates/base/.claude/skills/security-scan/SKILL.md +297 -0
  168. package/templates/base/.claude/skills/verify-security-fixes/SKILL.md +180 -0
  169. package/templates/base/.dude/commands/README.md +85 -0
  170. package/templates/base/.dude/commands/hello.ts +34 -0
  171. package/templates/base/.dude/lint/checks/PRJ/001.ts +26 -0
  172. package/templates/base/.dude/lint/checks/README.md +69 -0
  173. package/templates/base/.vscode/tasks.json +44 -0
  174. package/templates/base/.worktreeinclude +2 -0
  175. package/templates/base/CLAUDE.md.hbs +391 -0
  176. package/templates/base/README.md.hbs +188 -0
  177. package/templates/base/_env.example.hbs +39 -0
  178. package/templates/base/_env.hbs +35 -0
  179. package/templates/base/_gitignore +31 -0
  180. package/templates/base/_npmrc +2 -0
  181. package/templates/base/backend/Dockerfile +16 -0
  182. package/templates/base/backend/README.md.hbs +90 -0
  183. package/templates/base/backend/_dockerignore +12 -0
  184. package/templates/base/backend/apps/__init__.py +0 -0
  185. package/templates/base/backend/apps/core/__init__.py +0 -0
  186. package/templates/base/backend/apps/core/apps.py +6 -0
  187. package/templates/base/backend/apps/core/serializers.py +7 -0
  188. package/templates/base/backend/apps/core/tests/__init__.py +0 -0
  189. package/templates/base/backend/apps/core/tests/test_views.py +16 -0
  190. package/templates/base/backend/apps/core/urls.py +9 -0
  191. package/templates/base/backend/apps/core/views.py +24 -0
  192. package/templates/base/backend/apps/users/__init__.py +0 -0
  193. package/templates/base/backend/apps/users/admin.py +6 -0
  194. package/templates/base/backend/apps/users/apps.py +6 -0
  195. package/templates/base/backend/apps/users/migrations/0001_initial.py +41 -0
  196. package/templates/base/backend/apps/users/migrations/__init__.py +0 -0
  197. package/templates/base/backend/apps/users/models.py +15 -0
  198. package/templates/base/backend/apps/users/serializers.py +16 -0
  199. package/templates/base/backend/apps/users/services.py +25 -0
  200. package/templates/base/backend/apps/users/tests/__init__.py +0 -0
  201. package/templates/base/backend/apps/users/tests/test_models.py +30 -0
  202. package/templates/base/backend/apps/users/tests/test_views.py +55 -0
  203. package/templates/base/backend/apps/users/urls.py +10 -0
  204. package/templates/base/backend/apps/users/views.py +20 -0
  205. package/templates/base/backend/config/__init__.py.hbs +5 -0
  206. package/templates/base/backend/config/asgi.py +9 -0
  207. package/templates/base/backend/config/settings/__init__.py +0 -0
  208. package/templates/base/backend/config/settings/base.py.hbs +197 -0
  209. package/templates/base/backend/config/settings/local.py +31 -0
  210. package/templates/base/backend/config/settings/production.py.hbs +37 -0
  211. package/templates/base/backend/config/urls.py.hbs +22 -0
  212. package/templates/base/backend/config/wsgi.py +9 -0
  213. package/templates/base/backend/manage.py +23 -0
  214. package/templates/base/backend/pyproject.toml.hbs +48 -0
  215. package/templates/base/backend/start.sh +5 -0
  216. package/templates/base/docker-compose.yml.hbs +196 -0
  217. package/templates/base/docs/docs/api.md +21 -0
  218. package/templates/base/docs/docs/dude.md.hbs +305 -0
  219. package/templates/base/docs/docs/index.md.hbs +92 -0
  220. package/templates/base/docs/docs/mkdocs.md +231 -0
  221. package/templates/base/docs/mkdocs.yml.hbs +52 -0
  222. package/templates/base/e2e/.prettierrc.json +1 -0
  223. package/templates/base/e2e/_prettierignore +3 -0
  224. package/templates/base/e2e/cucumber.js +21 -0
  225. package/templates/base/e2e/eslint.config.mjs +14 -0
  226. package/templates/base/e2e/features/example.feature +13 -0
  227. package/templates/base/e2e/package.json.hbs +30 -0
  228. package/templates/base/e2e/pages/ExamplePage.ts +16 -0
  229. package/templates/base/e2e/playwright.config.ts +27 -0
  230. package/templates/base/e2e/steps/common.steps.ts +32 -0
  231. package/templates/base/e2e/steps/example.steps.ts +4 -0
  232. package/templates/base/e2e/support/hooks.ts +72 -0
  233. package/templates/base/e2e/support/world.ts +24 -0
  234. package/templates/base/e2e/tsconfig.json +22 -0
  235. package/templates/base/frontend/.prettierrc.json +6 -0
  236. package/templates/base/frontend/Dockerfile +10 -0
  237. package/templates/base/frontend/_dockerignore +4 -0
  238. package/templates/base/frontend/eslint.config.js +32 -0
  239. package/templates/base/frontend/index.html.hbs +13 -0
  240. package/templates/base/frontend/package.json.hbs +38 -0
  241. package/templates/base/frontend/public/favicon.svg +5 -0
  242. package/templates/base/frontend/src/$components/Layout/$assets/logo.svg +5 -0
  243. package/templates/base/frontend/src/$components/Layout/constants.tsx +8 -0
  244. package/templates/base/frontend/src/$components/Layout/index.tsx +80 -0
  245. package/templates/base/frontend/src/$components/Layout/types.tsx +9 -0
  246. package/templates/base/frontend/src/$components/index.tsx +1 -0
  247. package/templates/base/frontend/src/$hooks/index.tsx +2 -0
  248. package/templates/base/frontend/src/$hooks/useCounterStore/index.tsx +28 -0
  249. package/templates/base/frontend/src/$hooks/useCounterStore/types.tsx +7 -0
  250. package/templates/base/frontend/src/$hooks/usePageTitle/index.tsx +21 -0
  251. package/templates/base/frontend/src/$types/vite-env.d.ts +10 -0
  252. package/templates/base/frontend/src/App.tsx +36 -0
  253. package/templates/base/frontend/src/main.tsx +10 -0
  254. package/templates/base/frontend/src/openapi/utils/openapi.yaml.hbs +129 -0
  255. package/templates/base/frontend/src/pages/constants.tsx +31 -0
  256. package/templates/base/frontend/src/pages/index.tsx +192 -0
  257. package/templates/base/frontend/src/pages/types.tsx +6 -0
  258. package/templates/base/frontend/src/pages/users/[id]/index.tsx +53 -0
  259. package/templates/base/frontend/src/pages/users/index.tsx +57 -0
  260. package/templates/base/frontend/src/pages/users/types.tsx +4 -0
  261. package/templates/base/frontend/src/styles.module.css +7 -0
  262. package/templates/base/frontend/src/utils/constants.tsx +11 -0
  263. package/templates/base/frontend/src/utils/formatters/index.tsx +49 -0
  264. package/templates/base/frontend/src/utils/functions.tsx +70 -0
  265. package/templates/base/frontend/src/utils/index.tsx +3 -0
  266. package/templates/base/frontend/tsconfig.json +24 -0
  267. package/templates/base/frontend/vite.config.ts +20 -0
  268. package/templates/base/package.json.hbs +11 -0
  269. package/templates/base/security/baseline.json +4 -0
  270. package/templates/celery/backend/apps/core/tasks.py +14 -0
  271. package/templates/celery/backend/apps/core/tests/test_tasks.py +6 -0
  272. package/templates/celery/backend/config/celery.py.hbs +26 -0
  273. package/templates/celerybeat/backend/apps/core/tasks_scheduled.py +18 -0
  274. package/templates/celerybeat/backend/apps/core/tests/test_tasks_scheduled.py +6 -0
  275. package/templates/postgres/.dude/commands/reset.ts +83 -0
  276. package/templates/s3/backend/apps/files/__init__.py +0 -0
  277. package/templates/s3/backend/apps/files/admin.py +9 -0
  278. package/templates/s3/backend/apps/files/apps.py +6 -0
  279. package/templates/s3/backend/apps/files/migrations/0001_initial.py +29 -0
  280. package/templates/s3/backend/apps/files/migrations/__init__.py +0 -0
  281. package/templates/s3/backend/apps/files/models.py +21 -0
  282. package/templates/s3/backend/apps/files/serializers.py +27 -0
  283. package/templates/s3/backend/apps/files/services.py +19 -0
  284. package/templates/s3/backend/apps/files/tests/__init__.py +0 -0
  285. package/templates/s3/backend/apps/files/tests/test_models.py +10 -0
  286. package/templates/s3/backend/apps/files/tests/test_views.py +32 -0
  287. package/templates/s3/backend/apps/files/urls.py +10 -0
  288. package/templates/s3/backend/apps/files/views.py +29 -0
  289. package/templates/s3/frontend/src/openapi/utils/openapi.yaml.hbs +253 -0
@@ -0,0 +1,305 @@
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
+
40
+ From the second run onward:
41
+
42
+ ```bash
43
+ dude up
44
+ ```
45
+
46
+ Also re-run `dude up --build` whenever you change a `Dockerfile` or
47
+ `pyproject.toml`.
48
+
49
+ ### Services
50
+
51
+ Once the stack is up, open these URLs:
52
+
53
+ | Service | URL | Notes |
54
+ |---------|-----|-------|
55
+ | **Frontend** | http://localhost:5173 | React + Vite — HMR active |
56
+ | **API** | http://localhost:8000 | Django REST Framework |
57
+ | **Swagger UI** | http://localhost:8000/api/docs/ | Interactive API explorer (drf-spectacular) |
58
+ | **OpenAPI schema** | http://localhost:8000/api/schema/ | Raw schema (YAML) |
59
+ | **Health** | http://localhost:8000/api/health/ | JSON health check |
60
+ | **Django admin** | http://localhost:8000/admin/ | Create an account with `dude db superuser` |
61
+ {{#if withS3}}| **MinIO console** | http://localhost:9001 | Object-storage UI (minioadmin/minioadmin) |
62
+ {{/if}}
63
+ {{#if withCelery}}| **Flower** | http://localhost:5555 | Celery task monitor |
64
+ {{/if}}
65
+
66
+ ### Hot reload
67
+
68
+ - **Frontend** — Vite HMR is active. Edit any file under `frontend/src/` and
69
+ the browser updates instantly without a full page reload.
70
+ - **Backend** — Django's development server auto-reloads. Edit any Python file
71
+ under `backend/apps/` or `backend/config/` and the API restarts within ~1
72
+ second. Migrations run automatically when the container boots (`start.sh`).
73
+
74
+ ---
75
+
76
+ ## Infrastructure
77
+
78
+ All services run in Docker. The `docker-compose.yml` at the project root
79
+ defines every service.
80
+
81
+ | Command | Description |
82
+ |---------|-------------|
83
+ | `dude up --build` | Build images and start all services |
84
+ | `dude up` | Start all services (detached) |
85
+ | `dude down` | Stop and remove containers |
86
+ | `dude logs` | Follow logs for all services |
87
+ | `dude logs backend` | Follow logs for a specific service |
88
+ | `dude shell backend` | Open an interactive shell inside a running container |
89
+
90
+ ---
91
+
92
+ ## Code quality
93
+
94
+ | Command | Description |
95
+ |---------|-------------|
96
+ | `dude lint` | Run all structural lint checks (naming, layout conventions) |
97
+ | `dude format` | Format code — `ruff` (backend) + `prettier` (frontend) |
98
+ | `dude upgrade` | Update the pinned `dude` CLI and stack versions for this project |
99
+ | `dude review` | Run lint + ESLint + API contract review in one pass |
100
+
101
+ ### Project lint rules
102
+
103
+ `dude lint` also runs any rules you define under `.dude/lint/checks/` — the
104
+ rule code is derived from the path (`.dude/lint/checks/PRJ/001.ts` → `PRJ001`)
105
+ and the contract is the same one the stack's own checks use. See
106
+ `.dude/lint/checks/README.md` and the `PRJ/001.ts` example. To disable a
107
+ built-in rule, list its code in `dude.json`:
108
+
109
+ ```json
110
+ { "lint": { "disable": ["BE003"] } }
111
+ ```
112
+
113
+ ### Upgrading pinned versions
114
+
115
+ `dude upgrade` updates version pins only. It does **not** migrate existing
116
+ project files.
117
+
118
+ | Command | Description |
119
+ |---------|-------------|
120
+ | `dude upgrade` | Upgrade both the CLI pin in `package.json` and the stack pin in `dude.json` |
121
+ | `dude upgrade --cli` | Upgrade only `@cubocicloide/dude` |
122
+ | `dude upgrade --stack` | Upgrade only the active stack version |
123
+ | `dude upgrade --cli --cli-version 0.6.1` | Pin the CLI to an explicit version |
124
+ | `dude upgrade --stack --stack-version 5.0.5` | Pin the stack to an explicit version |
125
+
126
+ If a newer version causes issues, roll back by pinning the previous one again:
127
+
128
+ ```bash
129
+ dude upgrade --cli --cli-version 0.6.0
130
+ dude upgrade --stack --stack-version 5.0.4
131
+ pnpm install
132
+ ```
133
+
134
+ ---
135
+
136
+ ## API contract (OpenAPI)
137
+
138
+ The frontend uses a typed API client that is auto-generated from the backend's
139
+ OpenAPI spec. **Never edit files under `frontend/src/openapi/` by hand.**
140
+
141
+ | Command | Description |
142
+ |---------|-------------|
143
+ | `dude api sync` | Fetch OpenAPI spec from the running backend and regenerate the client |
144
+ | `dude api review` | Validate the generated client against the saved spec |
145
+
146
+ **Workflow** — every time you change a backend route:
147
+
148
+ ```bash
149
+ dude api sync
150
+ dude api review
151
+ git add frontend/src/openapi/
152
+ git commit -m "chore(api): sync generated client"
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Database (migrations)
158
+
159
+ Schema changes are managed with Django migrations. These commands run inside
160
+ the backend container.
161
+
162
+ | Command | Description |
163
+ |---------|-------------|
164
+ | `dude db makemigration [--app <app>] [--name <text>]` | Autogenerate a migration from model changes |
165
+ | `dude db migrate` | Apply all pending migrations |
166
+ | `dude db migrate --app <app> --revision <rev>` | Migrate one app to a specific migration |
167
+ | `dude db rollback --app <app> --to <rev>` | Roll one app back (`--to zero` reverts it fully) |
168
+ | `dude db superuser` | Create a Django admin account (interactive) |
169
+
170
+ **Workflow** — after changing a model:
171
+
172
+ ```bash
173
+ dude db makemigration --app users --name "add nickname"
174
+ dude db migrate
175
+ git add backend/apps/users/migrations/
176
+ ```
177
+
178
+ ---
179
+
180
+ ## Testing
181
+
182
+ | Command | Description |
183
+ |---------|-------------|
184
+ | `dude test` | Run all test suites (backend + e2e) |
185
+ | `dude test --backend` | pytest only |
186
+ | `dude test --e2e` | Playwright + Cucumber only |
187
+ | `dude test --e2e --headed` | E2e in a visible browser window |
188
+ | `dude test --e2e --report` | E2e with HTML + JSON output to `e2e/reports/` |
189
+
190
+ ---
191
+
192
+ ## Security scanning
193
+
194
+ All scanners run inside Docker — no host-level tool installation required.
195
+ Results are written to `private/sast-reports/latest/`.
196
+
197
+ | Command | Description |
198
+ |---------|-------------|
199
+ | `dude security scan` | Run all scanners; exit 1 if new findings ≥ HIGH |
200
+ | `dude security scan --only bandit,semgrep` | Run a subset of scanners |
201
+ | `dude security scan --fail-on CRITICAL` | Raise the failure threshold |
202
+ | `dude security accept` | Re-scan and absorb all findings into the baseline |
203
+ | `dude security verify --rule-id B105` | Confirm a specific finding has been fixed |
204
+ | `dude security verify --rule-id B105 --remove-resolved` | Fix confirmed → prune from baseline |
205
+
206
+ **Scanners**:
207
+
208
+ | Scanner | What it checks |
209
+ |---------|---------------|
210
+ | `bandit` | Python AST — common security anti-patterns |
211
+ | `semgrep` | Multi-language rules (backend + frontend) |
212
+ | `trivy-fs` | Filesystem: vulnerabilities, IaC misconfigs, secrets |
213
+ | `trivy-image` | Container image CVEs (requires built image) |
214
+
215
+ **Baseline workflow**:
216
+
217
+ ```bash
218
+ dude security scan # review new findings
219
+ # triage: fix what matters, accept acceptable risks
220
+ dude security accept # absorb remaining into security/baseline.json
221
+ git add security/baseline.json && git commit -m "chore(security): update baseline"
222
+ ```
223
+
224
+ !!! note "Baseline"
225
+ `security/baseline.json` must be committed — it is the source of truth for
226
+ accepted findings. Subsequent scans only flag findings that are **not** in the
227
+ baseline.
228
+ {{#if withIac}}
229
+
230
+ ---
231
+
232
+ ## Deploy (infrastructure as code)
233
+
234
+ This project can provision cloud infrastructure and release the app with the
235
+ `dude iac` command group. The commands below are the **stable, target-agnostic
236
+ interface** — what each one *means*. For the concrete infrastructure this
237
+ project provisions (the cloud resources, sizing, and the end-to-end runbook),
238
+ see the **Deploy** page.
239
+
240
+ Every `iac` command is **scoped to one environment via `--env <name>`, which is
241
+ required** (there is no default — this prevents acting on the wrong environment
242
+ by accident). Run any `iac` command **without** `--env` to list the environments
243
+ discovered on disk. Most commands also accept `--profile <name>` to pick the
244
+ cloud credentials profile.
245
+
246
+ ### Lifecycle
247
+
248
+ | Command | Description |
249
+ |---------|-------------|
250
+ | `dude iac login --env <e>` | Configure/verify cloud credentials for an environment |
251
+ | `dude iac bootstrap --env <e> --state-bucket-prefix <p> --yes` | One-time: create the shared remote-state backend (+ container registries) |
252
+ | `dude iac new-env --env <name> [--from <env>]` | Scaffold a new environment by copying an existing one (default source: `dev`) |
253
+ | `dude iac init --env <e>` | Initialise the infra toolchain for the environment |
254
+ | `dude iac plan --env <e>` | Preview the infrastructure changes |
255
+ | `dude iac apply --env <e> [--yes]` | Create/update the infrastructure |
256
+ | `dude iac output --env <e> [--json]` | Show provisioned values (cluster, registry URLs, DB endpoint…) |
257
+ | `dude iac fmt --env <e>` | Format the infra source files |
258
+ | `dude iac validate --env <e>` | Validate the infra configuration |
259
+ | `dude iac destroy --env <e> [--yes]` | Tear the environment down |
260
+
261
+ ### Release the application
262
+
263
+ | Command | Description |
264
+ |---------|-------------|
265
+ | `dude iac build --env <e> [--tag <t>]` | Build the backend + frontend production images |
266
+ | `dude iac push --env <e> [--tag <t>]` | Push the images to the registry |
267
+ | `dude iac deploy --env <e> [--tag <t>]` | Release the application (new task definitions, rolling deploy) |
268
+ | `dude iac ship --env <e> [--tag <t>]` | Build + push + deploy in one step (the inner loop) |
269
+ | `dude iac migrate --env <e>` | Run Django migrations as a one-off cloud task |
270
+ | `dude iac status --env <e> [--service <s>]` | Show a service's deployment state and events |
271
+ | `dude iac logs --env <e> [--service <s>] [--follow]` | Tail a service's logs |
272
+
273
+ > Image tags default to the current git short SHA (with `-dirty` when the working
274
+ > tree has uncommitted changes). Pass `--tag <t>` to override — useful for
275
+ > promoting one already-built image across environments.
276
+
277
+ See the **Deploy** page for the full first-time runbook, how to add new
278
+ environments, and what gets provisioned.
279
+ {{/if}}
280
+
281
+ ---
282
+
283
+ ## Documentation
284
+
285
+ | Command | Description |
286
+ |---------|-------------|
287
+ | `dude docs` | Serve this documentation in dev mode at <http://localhost:8001> |
288
+ | `dude docs --port 9000` | Use a custom port |
289
+ | `dude help --format md` | Print the full command reference as Markdown |
290
+ | `dude help --format json` | Print the same catalog as JSON (for tooling / LLMs) |
291
+
292
+ The **Command reference** page in this site is auto-generated from the live
293
+ command catalog every time you run `dude docs`, so it always matches your
294
+ project's actual commands — including your `dude init` choices and any
295
+ project-local commands under `.dude/commands/`. (It is gitignored; regenerate it
296
+ any time with `dude docs` or `dude help --format md`.)
297
+
298
+ The docs site live-reloads when you edit files under `docs/docs/`.
299
+
300
+ ```bash
301
+ dude docs
302
+ # → open http://localhost:8001
303
+ # → edit docs/docs/*.md
304
+ # → browser refreshes automatically
305
+ ```
@@ -0,0 +1,92 @@
1
+ # Welcome
2
+
3
+ This is the documentation for **{{projectName}}** — a full-stack web application built with React + Django REST Framework, 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
+ # Django migrations are applied automatically on boot.
26
+ dude up
27
+ ```
28
+
29
+ From then on, `dude up` starts everything and `dude down` stops it. See
30
+ [Working with dude](dude.md) for the full command reference and
31
+ [the README](https://github.com/cubocicloide/dude) for prerequisites.
32
+
33
+ To serve this documentation site:
34
+
35
+ ```bash
36
+ dude docs # → http://localhost:8001
37
+ ```
38
+
39
+ ---
40
+
41
+ ## Contents
42
+
43
+ - [Working with dude](dude.md) — CLI reference: start the stack, run tests, scan for security issues, and more.
44
+ - [Command reference](api.md) — auto-generated list of every command available in this project.
45
+ - [Writing docs](mkdocs.md) — How to add pages to this documentation site and the Markdown syntax supported.
46
+ {{#if withIac}}
47
+ - [Deploy (AWS ECS)](deploy.md) — provision cloud infrastructure and ship the app.
48
+ {{/if}}
49
+
50
+ ---
51
+
52
+ ## Quick links
53
+
54
+ | Resource | URL |
55
+ |----------|-----|
56
+ | Frontend (dev) | <http://localhost:5173> |
57
+ | Backend API | <http://localhost:8000> |
58
+ | Swagger UI (drf-spectacular) | <http://localhost:8000/api/docs/> |
59
+ | OpenAPI schema | <http://localhost:8000/api/schema/> |
60
+ | API health | <http://localhost:8000/api/health/> |
61
+ | Django admin | <http://localhost:8000/admin/> |
62
+ {{#if withS3}}
63
+ | MinIO console | <http://localhost:9001> |
64
+ {{/if}}
65
+ {{#if withCelery}}
66
+ | Flower | <http://localhost:5555> |
67
+ {{/if}}
68
+ | This docs site | <http://localhost:8001> |
69
+
70
+ ---
71
+
72
+ ## Tech stack
73
+
74
+ | Layer | Technology |
75
+ |-------|-----------|
76
+ | Frontend | React 19, Vite, TypeScript (strict), Ant Design, TanStack Query |
77
+ | Backend | Django 5, Django REST Framework, drf-spectacular, Python ≥ 3.13, uv |
78
+ {{#if withPostgres}}
79
+ | Database | PostgreSQL (Django migrations) |
80
+ {{else}}
81
+ | Database | SQLite (dev default — Django migrations) |
82
+ {{/if}}
83
+ {{#if withS3}}
84
+ | Object storage | S3 via django-storages (MinIO locally) |
85
+ {{/if}}
86
+ {{#if withCelery}}
87
+ | Async jobs | Celery, Redis, Flower |
88
+ {{/if}}
89
+ | Infra | Docker Compose, Dockerfiles for frontend and backend |
90
+ | Testing | pytest + pytest-django · Playwright + Cucumber |
91
+ | Security | Bandit · Semgrep · Trivy |
92
+ | Docs | MkDocs Material |
@@ -0,0 +1,231 @@
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
+ ## File structure
221
+
222
+ ```
223
+ docs/
224
+ ├── mkdocs.yml # MkDocs configuration
225
+ └── docs/ # Source pages (edit these)
226
+ ├── index.md # Home page
227
+ ├── dude.md # CLI reference
228
+ └── mkdocs.md # This page
229
+ ```
230
+
231
+ 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 ECS): 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/
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Cucumber.js CLI configuration.
3
+ *
4
+ * Conventions enforced by dude lint (ET002 / ET003):
5
+ * - features/ contains .feature files (Gherkin, snake_case names)
6
+ * - steps/ contains *.steps.ts step definitions (one per feature + common.steps.ts)
7
+ * - support/ contains world.ts and hooks.ts
8
+ */
9
+ module.exports = {
10
+ default: {
11
+ paths: ['features/**/*.feature'],
12
+ require: ['support/**/*.ts', 'steps/**/*.steps.ts'],
13
+ requireModule: ['ts-node/register'],
14
+ format: [
15
+ 'progress-bar',
16
+ 'html:reports/cucumber.html',
17
+ 'json:reports/cucumber.json',
18
+ ],
19
+ formatOptions: { snippetInterface: 'async-await' },
20
+ },
21
+ }