@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,129 @@
1
+ openapi: 3.0.3
2
+ info:
3
+ title: {{projectName}} API
4
+ version: 1.0.0
5
+ paths:
6
+ /api/health/:
7
+ get:
8
+ operationId: health_retrieve
9
+ description: Health-check endpoint.
10
+ tags:
11
+ - health
12
+ security:
13
+ - {}
14
+ responses:
15
+ "200":
16
+ content:
17
+ application/json:
18
+ schema:
19
+ $ref: "#/components/schemas/Health"
20
+ description: ""
21
+ /api/users/:
22
+ get:
23
+ operationId: users_list
24
+ description: List (paginated) and retrieve users.
25
+ parameters:
26
+ - name: page
27
+ required: false
28
+ in: query
29
+ description: A page number within the paginated result set.
30
+ schema:
31
+ type: integer
32
+ tags:
33
+ - users
34
+ security:
35
+ - {}
36
+ responses:
37
+ "200":
38
+ content:
39
+ application/json:
40
+ schema:
41
+ $ref: "#/components/schemas/PaginatedUserList"
42
+ description: ""
43
+ /api/users/{id}/:
44
+ get:
45
+ operationId: users_retrieve
46
+ description: List (paginated) and retrieve users.
47
+ parameters:
48
+ - name: id
49
+ in: path
50
+ required: true
51
+ description: A unique integer value identifying this user.
52
+ schema:
53
+ type: integer
54
+ tags:
55
+ - users
56
+ security:
57
+ - {}
58
+ responses:
59
+ "200":
60
+ content:
61
+ application/json:
62
+ schema:
63
+ $ref: "#/components/schemas/User"
64
+ description: ""
65
+ components:
66
+ schemas:
67
+ Health:
68
+ type: object
69
+ description: Response payload of the health-check endpoint.
70
+ properties:
71
+ status:
72
+ type: string
73
+ required:
74
+ - status
75
+ PaginatedUserList:
76
+ type: object
77
+ properties:
78
+ count:
79
+ type: integer
80
+ example: 123
81
+ next:
82
+ type: string
83
+ nullable: true
84
+ format: uri
85
+ example: http://api.example.org/accounts/?page=4
86
+ previous:
87
+ type: string
88
+ nullable: true
89
+ format: uri
90
+ example: http://api.example.org/accounts/?page=2
91
+ results:
92
+ type: array
93
+ items:
94
+ $ref: "#/components/schemas/User"
95
+ required:
96
+ - count
97
+ - results
98
+ User:
99
+ type: object
100
+ description: Public representation of a user.
101
+ properties:
102
+ id:
103
+ type: integer
104
+ readOnly: true
105
+ username:
106
+ type: string
107
+ description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_
108
+ only.
109
+ pattern: ^[\w.@+-]+$
110
+ maxLength: 150
111
+ email:
112
+ type: string
113
+ format: email
114
+ title: Email address
115
+ maxLength: 254
116
+ first_name:
117
+ type: string
118
+ maxLength: 150
119
+ last_name:
120
+ type: string
121
+ maxLength: 150
122
+ date_joined:
123
+ type: string
124
+ format: date-time
125
+ readOnly: true
126
+ required:
127
+ - date_joined
128
+ - id
129
+ - username
@@ -0,0 +1,31 @@
1
+ import type { Command } from './types'
2
+
3
+ export const COMMANDS: Command[] = [
4
+ // Infrastructure
5
+ { group: 'Infrastructure', cmd: 'dude up --build', desc: 'Build images and start all services' },
6
+ { group: 'Infrastructure', cmd: 'dude up', desc: 'Start all services (detached)' },
7
+ { group: 'Infrastructure', cmd: 'dude down', desc: 'Stop and remove containers' },
8
+ { group: 'Infrastructure', cmd: 'dude logs [service]', desc: 'Follow logs; omit service to follow all' },
9
+ { group: 'Infrastructure', cmd: 'dude shell <service>', desc: 'Open a shell inside a running container' },
10
+ // Quality
11
+ { group: 'Code quality', cmd: 'dude lint', desc: 'Structural lint checks (naming, layout)' },
12
+ { group: 'Code quality', cmd: 'dude format', desc: 'Format code — ruff (backend) + prettier (frontend)' },
13
+ { group: 'Code quality', cmd: 'dude review', desc: 'Lint + ESLint + API contract review in one pass' },
14
+ // API
15
+ { group: 'API contract', cmd: 'dude api sync', desc: 'Fetch OpenAPI spec → regenerate the typed client' },
16
+ { group: 'API contract', cmd: 'dude api review', desc: 'Validate frontend/src/openapi/ against the spec' },
17
+ // Testing
18
+ { group: 'Testing', cmd: 'dude test', desc: 'Run all test suites (backend + e2e)' },
19
+ { group: 'Testing', cmd: 'dude test --backend', desc: 'pytest only' },
20
+ { group: 'Testing', cmd: 'dude test --e2e', desc: 'Playwright + Cucumber only' },
21
+ // Security
22
+ { group: 'Security', cmd: 'dude security scan', desc: 'Run all SAST scanners; exit 1 on new HIGH+ findings' },
23
+ { group: 'Security', cmd: 'dude security accept', desc: 'Absorb all findings into the baseline' },
24
+ { group: 'Security', cmd: 'dude security verify --rule-id <id>', desc: 'Confirm a specific finding is fixed' },
25
+ // Docs
26
+ { group: 'Documentation', cmd: 'dude docs', desc: 'Serve MkDocs at http://localhost:8001 (live-reload)' },
27
+ // Help
28
+ { group: 'Help', cmd: 'dude help', desc: 'Show all available commands and flags' },
29
+ ]
30
+
31
+ export const GROUPS = [...new Set(COMMANDS.map((c) => c.group))]
@@ -0,0 +1,192 @@
1
+ import { useQuery } from '@tanstack/react-query'
2
+ import { Alert, Badge, Button, Card, Col, Row, Space, Typography } from 'antd'
3
+ import {
4
+ CheckCircleOutlined,
5
+ CodeOutlined,
6
+ MinusOutlined,
7
+ PlusOutlined,
8
+ RocketOutlined,
9
+ } from '@ant-design/icons'
10
+ import { $get as getHealth } from '@/openapi/api/health'
11
+ import { useCounterStore } from '@/$hooks'
12
+ import { COMMANDS, GROUPS } from './constants'
13
+
14
+ const { Title, Paragraph, Text, Link } = Typography
15
+
16
+ export default function HomePage() {
17
+ const { data, isLoading, isError } = useQuery({
18
+ queryKey: ['health'],
19
+ queryFn: getHealth,
20
+ refetchInterval: 30_000,
21
+ })
22
+ const { count, increment, decrement, reset } = useCounterStore()
23
+
24
+ const statusText = isLoading
25
+ ? 'checking…'
26
+ : isError
27
+ ? 'unreachable'
28
+ : (data?.status ?? 'unknown')
29
+ const statusOk = !isLoading && !isError && data?.status === 'ok'
30
+
31
+ return (
32
+ <Space direction="vertical" size="large" style={{ width: '100%' }}>
33
+ {/* Hero */}
34
+ <Card>
35
+ <Space align="start" size="large">
36
+ <RocketOutlined style={{ fontSize: 48, color: '#1677ff' }} />
37
+ <div>
38
+ <Title level={2} style={{ margin: 0 }}>
39
+ Welcome to your dude project
40
+ </Title>
41
+ <Paragraph style={{ margin: '8px 0 0' }}>
42
+ This app was scaffolded with{' '}
43
+ <Link href="https://github.com/cubocicloide/dude" target="_blank">
44
+ dude
45
+ </Link>{' '}
46
+ using the <Text code>react-django</Text> stack — React 19 + Vite + Django REST Framework + Docker
47
+ Compose. Delete this page and start building your application.
48
+ </Paragraph>
49
+ </div>
50
+ </Space>
51
+ </Card>
52
+
53
+ <Row gutter={[16, 16]}>
54
+ {/* Backend health */}
55
+ <Col xs={24} md={8}>
56
+ <Card title="Backend health" loading={isLoading} style={{ height: '100%' }}>
57
+ {statusOk ? (
58
+ <Badge
59
+ status="success"
60
+ text={
61
+ <Text>
62
+ API is <Text strong>online</Text> — {statusText}
63
+ </Text>
64
+ }
65
+ />
66
+ ) : (
67
+ <Badge status={isLoading ? 'processing' : 'error'} text={statusText} />
68
+ )}
69
+ </Card>
70
+ </Col>
71
+
72
+ {/* Zustand store demo */}
73
+ <Col xs={24} md={8}>
74
+ <Card title="Zustand store" style={{ height: '100%' }}>
75
+ <Space>
76
+ <Button icon={<MinusOutlined />} onClick={decrement} aria-label="decrement" />
77
+ <Text strong style={{ fontSize: 18, minWidth: 32, display: 'inline-block', textAlign: 'center' }}>
78
+ {count}
79
+ </Text>
80
+ <Button icon={<PlusOutlined />} onClick={increment} aria-label="increment" />
81
+ <Button onClick={reset}>Reset</Button>
82
+ </Space>
83
+ <Paragraph type="secondary" style={{ margin: '12px 0 0' }}>
84
+ Global state from <Text code>$hooks/useCounterStore</Text> — devtools enabled in dev.
85
+ </Paragraph>
86
+ </Card>
87
+ </Col>
88
+
89
+ {/* Quick links */}
90
+ <Col xs={24} md={8}>
91
+ <Card title={<><CodeOutlined /> Quick links</>} style={{ height: '100%' }}>
92
+ <Space wrap size="middle">
93
+ <Link href="/api/docs" target="_blank">
94
+ API docs (Swagger)
95
+ </Link>
96
+ <Link href="/api/redoc" target="_blank">
97
+ ReDoc
98
+ </Link>
99
+ <Link href="http://localhost:8001" target="_blank">
100
+ Project docs (MkDocs)
101
+ </Link>
102
+ </Space>
103
+ </Card>
104
+ </Col>
105
+ </Row>
106
+
107
+ {/* Getting started */}
108
+ <Card title={<><CheckCircleOutlined /> Getting started</>}>
109
+ <ol style={{ paddingLeft: 20, margin: 0, lineHeight: 2.2 }}>
110
+ <li>
111
+ <Text strong>Start the stack</Text> —{' '}
112
+ <Text code>dude up --build</Text> from the project root
113
+ </li>
114
+ <li>
115
+ <Text strong>Open the app</Text> —{' '}
116
+ <Link href="http://localhost:5173" target="_blank">http://localhost:5173</Link> (frontend) ·{' '}
117
+ <Link href="http://localhost:8000/api/docs" target="_blank">http://localhost:8000/api/docs</Link>{' '}
118
+ (API)
119
+ </li>
120
+ <li>
121
+ <Text strong>Make changes</Text> — edit{' '}
122
+ <Text code>backend/</Text> or <Text code>frontend/src/</Text>; hot-reload is enabled
123
+ </li>
124
+ <li>
125
+ <Text strong>Sync the API client</Text> — run{' '}
126
+ <Text code>dude api sync</Text> after changing backend routes
127
+ </li>
128
+ <li>
129
+ <Text strong>Run tests</Text> —{' '}
130
+ <Text code>dude test</Text> covers pytest (backend) and Playwright (e2e)
131
+ </li>
132
+ <li>
133
+ <Text strong>Check security</Text> —{' '}
134
+ <Text code>dude security scan</Text> — no extra tools needed, runs in Docker
135
+ </li>
136
+ <li>
137
+ <Text strong>Read the docs</Text> —{' '}
138
+ <Text code>dude docs</Text> to serve the MkDocs site locally
139
+ </li>
140
+ </ol>
141
+ </Card>
142
+
143
+ {/* Commands reference */}
144
+ <Card title="dude CLI reference">
145
+ <Space direction="vertical" size="large" style={{ width: '100%' }}>
146
+ {GROUPS.map((group) => (
147
+ <div key={group}>
148
+ <Text
149
+ strong
150
+ style={{
151
+ display: 'block',
152
+ marginBottom: 6,
153
+ color: '#1677ff',
154
+ textTransform: 'uppercase',
155
+ fontSize: 11,
156
+ letterSpacing: 1,
157
+ }}
158
+ >
159
+ {group}
160
+ </Text>
161
+ <Space direction="vertical" size={4} style={{ width: '100%' }}>
162
+ {COMMANDS.filter((c) => c.group === group).map(({ cmd, desc }) => (
163
+ <Row key={cmd} gutter={8} align="middle" wrap>
164
+ <Col xs={24} md={10}>
165
+ <Text code style={{ whiteSpace: 'nowrap' }}>
166
+ {cmd}
167
+ </Text>
168
+ </Col>
169
+ <Col xs={24} md={14}>
170
+ <Text type="secondary">{desc}</Text>
171
+ </Col>
172
+ </Row>
173
+ ))}
174
+ </Space>
175
+ </div>
176
+ ))}
177
+ </Space>
178
+ <Alert
179
+ style={{ marginTop: 16 }}
180
+ type="info"
181
+ showIcon
182
+ message={
183
+ <Text>
184
+ Run <Text code>dude help</Text> for a live, always-up-to-date overview, or{' '}
185
+ <Text code>dude help &lt;command&gt;</Text> for flags.
186
+ </Text>
187
+ }
188
+ />
189
+ </Card>
190
+ </Space>
191
+ )
192
+ }
@@ -0,0 +1,6 @@
1
+ /** One row of the "dude CLI reference" table on the home page. */
2
+ export interface Command {
3
+ cmd: string
4
+ desc: string
5
+ group: string
6
+ }
@@ -0,0 +1,53 @@
1
+ import { useQuery } from '@tanstack/react-query'
2
+ import { Alert, Button, Card, Descriptions, Spin, Typography } from 'antd'
3
+ import { ArrowLeftOutlined } from '@ant-design/icons'
4
+ import { useNavigate, useParams } from 'react-router-dom'
5
+ import { usePageTitle } from '@/$hooks'
6
+ import { formatDateTime } from '@/utils'
7
+ import { $get as getUser } from '@/openapi/api/users/[id]'
8
+
9
+ const { Text } = Typography
10
+
11
+ export default function UserDetailPage() {
12
+ const { id } = useParams<{ id: string }>()
13
+ usePageTitle(`User ${id ?? ''}`)
14
+ const navigate = useNavigate()
15
+
16
+ const {
17
+ data: user,
18
+ isLoading,
19
+ isError,
20
+ } = useQuery({
21
+ queryKey: ['users', id],
22
+ queryFn: () => getUser(id!),
23
+ enabled: id != null,
24
+ })
25
+
26
+ const dash = <Text type="secondary">—</Text>
27
+
28
+ return (
29
+ <Card
30
+ title={`User ${id ?? ''}`}
31
+ extra={
32
+ <Button icon={<ArrowLeftOutlined />} onClick={() => navigate('/users')}>
33
+ Back to users
34
+ </Button>
35
+ }
36
+ >
37
+ {isLoading ? (
38
+ <Spin />
39
+ ) : isError || !user ? (
40
+ <Alert type="error" showIcon message="User not found" />
41
+ ) : (
42
+ <Descriptions column={1} bordered size="small">
43
+ <Descriptions.Item label="ID">{user.id}</Descriptions.Item>
44
+ <Descriptions.Item label="Username">{user.username}</Descriptions.Item>
45
+ <Descriptions.Item label="Email">{user.email || dash}</Descriptions.Item>
46
+ <Descriptions.Item label="First name">{user.first_name || dash}</Descriptions.Item>
47
+ <Descriptions.Item label="Last name">{user.last_name || dash}</Descriptions.Item>
48
+ <Descriptions.Item label="Joined">{formatDateTime(user.date_joined)}</Descriptions.Item>
49
+ </Descriptions>
50
+ )}
51
+ </Card>
52
+ )
53
+ }
@@ -0,0 +1,57 @@
1
+ import { useQuery } from '@tanstack/react-query'
2
+ import { Alert, Card, Table, Typography } from 'antd'
3
+ import { useNavigate } from 'react-router-dom'
4
+ import { usePageTitle } from '@/$hooks'
5
+ import { formatDateTime } from '@/utils'
6
+ import { $get as getUsers } from '@/openapi/api/users'
7
+ import type { User } from './types'
8
+
9
+ const { Text } = Typography
10
+
11
+ export default function UsersPage() {
12
+ usePageTitle('Users')
13
+ const navigate = useNavigate()
14
+ const { data, isLoading, isError } = useQuery({
15
+ queryKey: ['users'],
16
+ queryFn: () => getUsers({}),
17
+ })
18
+
19
+ if (isError) {
20
+ return <Alert type="error" showIcon message="Could not load users" />
21
+ }
22
+
23
+ return (
24
+ <Card title="Users">
25
+ <Table<User>
26
+ rowKey="id"
27
+ loading={isLoading}
28
+ dataSource={data?.results ?? []}
29
+ onRow={(user) => ({
30
+ onClick: () => navigate(`/users/${user.id}`),
31
+ style: { cursor: 'pointer' },
32
+ })}
33
+ columns={[
34
+ { title: 'ID', dataIndex: 'id', width: 80 },
35
+ { title: 'Username', dataIndex: 'username' },
36
+ {
37
+ title: 'Email',
38
+ dataIndex: 'email',
39
+ render: (value: User['email']) => value || <Text type="secondary">—</Text>,
40
+ },
41
+ {
42
+ title: 'Name',
43
+ render: (_, user) =>
44
+ [user.first_name, user.last_name].filter(Boolean).join(' ') || (
45
+ <Text type="secondary">—</Text>
46
+ ),
47
+ },
48
+ {
49
+ title: 'Joined',
50
+ dataIndex: 'date_joined',
51
+ render: (value: User['date_joined']) => formatDateTime(value),
52
+ },
53
+ ]}
54
+ />
55
+ </Card>
56
+ )
57
+ }
@@ -0,0 +1,4 @@
1
+ import type { GetResponse } from '@/openapi/api/users/types'
2
+
3
+ /** One user row, unwrapped from the paginated GET /api/users/ response. */
4
+ export type User = GetResponse['results'][number]
@@ -0,0 +1,7 @@
1
+ :global(html),
2
+ :global(body),
3
+ :global(#root) {
4
+ margin: 0;
5
+ padding: 0;
6
+ height: 100%;
7
+ }
@@ -0,0 +1,11 @@
1
+ /** Base path for all API requests (proxied by Vite dev server and Docker). */
2
+ export const API_BASE_URL = '/api'
3
+
4
+ /** Application title sourced from the Vite environment. */
5
+ export const APP_TITLE = import.meta.env.VITE_APP_TITLE as string
6
+
7
+ /** BCP 47 locale tag used for date/number formatting across the app. */
8
+ export const DEFAULT_LOCALE = 'en-US'
9
+
10
+ /** Default page size for paginated tables and lists. */
11
+ export const DEFAULT_PAGE_SIZE = 20
@@ -0,0 +1,49 @@
1
+ import { DEFAULT_LOCALE } from '../constants'
2
+
3
+ /**
4
+ * Formats an ISO date string or Date object as a short date.
5
+ * @example formatDate('2026-01-15') → "Jan 15, 2026"
6
+ */
7
+ export function formatDate(value: string | Date | null | undefined): string {
8
+ if (!value) return '—'
9
+ return new Date(value).toLocaleDateString(DEFAULT_LOCALE, {
10
+ year: 'numeric',
11
+ month: 'short',
12
+ day: 'numeric',
13
+ })
14
+ }
15
+
16
+ /**
17
+ * Formats an ISO date string or Date object as a short datetime.
18
+ * @example formatDateTime('2026-01-15T14:30:00Z') → "Jan 15, 2026, 14:30"
19
+ */
20
+ export function formatDateTime(value: string | Date | null | undefined): string {
21
+ if (!value) return '—'
22
+ return new Date(value).toLocaleString(DEFAULT_LOCALE, {
23
+ year: 'numeric',
24
+ month: 'short',
25
+ day: 'numeric',
26
+ hour: '2-digit',
27
+ minute: '2-digit',
28
+ })
29
+ }
30
+
31
+ /**
32
+ * Formats a number with thousands separators.
33
+ * @example formatNumber(1000000) → "1,000,000"
34
+ */
35
+ export function formatNumber(value: number | null | undefined): string {
36
+ if (value == null) return '—'
37
+ return value.toLocaleString(DEFAULT_LOCALE)
38
+ }
39
+
40
+ /**
41
+ * Formats a byte count as a human-readable size string.
42
+ * @example formatBytes(1536) → "1.5 KB"
43
+ */
44
+ export function formatBytes(bytes: number): string {
45
+ if (bytes === 0) return '0 B'
46
+ const units = ['B', 'KB', 'MB', 'GB', 'TB']
47
+ const i = Math.floor(Math.log(bytes) / Math.log(1024))
48
+ return `${(bytes / 1024 ** i).toFixed(1)} ${units[i]}`
49
+ }
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Returns a debounced version of `fn` that fires only after `delay` ms of
3
+ * inactivity. Useful for search inputs and resize handlers.
4
+ *
5
+ * @example
6
+ * const debouncedSearch = debounce(handleSearch, 300)
7
+ */
8
+ export function debounce<T extends (...args: Parameters<T>) => void>(
9
+ fn: T,
10
+ delay: number,
11
+ ): (...args: Parameters<T>) => void {
12
+ let timer: ReturnType<typeof setTimeout>
13
+ return (...args: Parameters<T>) => {
14
+ clearTimeout(timer)
15
+ timer = setTimeout(() => fn(...args), delay)
16
+ }
17
+ }
18
+
19
+ /**
20
+ * Creates a new object containing only the specified keys.
21
+ *
22
+ * @example pick({ a: 1, b: 2, c: 3 }, ['a', 'c']) → { a: 1, c: 3 }
23
+ */
24
+ export function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {
25
+ return keys.reduce((acc, key) => ({ ...acc, [key]: obj[key] }), {} as Pick<T, K>)
26
+ }
27
+
28
+ /**
29
+ * Creates a new object without the specified keys.
30
+ *
31
+ * @example omit({ a: 1, b: 2, c: 3 }, ['b']) → { a: 1, c: 3 }
32
+ */
33
+ export function omit<T extends object, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {
34
+ const result = { ...obj }
35
+ for (const key of keys) delete result[key]
36
+ return result as Omit<T, K>
37
+ }
38
+
39
+ /**
40
+ * Groups an array into a record keyed by the return value of `key`.
41
+ *
42
+ * @example groupBy(users, (u) => u.role) → { admin: [...], viewer: [...] }
43
+ */
44
+ export function groupBy<T>(arr: T[], key: (item: T) => string): Record<string, T[]> {
45
+ return arr.reduce<Record<string, T[]>>((acc, item) => {
46
+ const k = key(item)
47
+ ;(acc[k] ??= []).push(item)
48
+ return acc
49
+ }, {})
50
+ }
51
+
52
+ /**
53
+ * Generates a cryptographically-safe random UUID v4.
54
+ * Uses the Web Crypto API — available in all modern browsers and Node ≥ 19.
55
+ */
56
+ export function uuid(): string {
57
+ return crypto.randomUUID()
58
+ }
59
+
60
+ /**
61
+ * Type-safe assertion that a value is non-null and non-undefined.
62
+ * Throws at runtime if the invariant is violated.
63
+ *
64
+ * @example
65
+ * const el = assertDefined(document.getElementById('root'), '#root not found')
66
+ */
67
+ export function assertDefined<T>(value: T | null | undefined, message: string): T {
68
+ if (value == null) throw new Error(message)
69
+ return value
70
+ }
@@ -0,0 +1,3 @@
1
+ export * from './constants'
2
+ export * from './functions'
3
+ export * from './formatters'
@@ -0,0 +1,24 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "moduleResolution": "Bundler",
8
+ "jsx": "react-jsx",
9
+ "strict": true,
10
+ "noEmit": true,
11
+ "noUnusedLocals": true,
12
+ "noUnusedParameters": true,
13
+ "noFallthroughCasesInSwitch": true,
14
+ "skipLibCheck": true,
15
+ "resolveJsonModule": true,
16
+ "isolatedModules": true,
17
+ "esModuleInterop": true,
18
+ "baseUrl": ".",
19
+ "paths": {
20
+ "@/*": ["./src/*"]
21
+ }
22
+ },
23
+ "include": ["src"]
24
+ }
@@ -0,0 +1,20 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+ import { fileURLToPath, URL } from 'node:url'
4
+
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ envDir: '..', // read .env from project root (also used by docker-compose)
8
+ resolve: {
9
+ alias: {
10
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
11
+ },
12
+ },
13
+ server: {
14
+ host: true,
15
+ port: 5173,
16
+ proxy: {
17
+ '/api': process.env.BACKEND_URL ?? 'http://localhost:8000',
18
+ },
19
+ },
20
+ })
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "private": true,
4
+ "devDependencies": {
5
+ "@cubocicloide/dude": "{{dudeVersion}}",
6
+ "@cubocicloide/stack-react-django": "{{stackVersion}}"
7
+ },
8
+ "scripts": {
9
+ "dude": "dude"
10
+ }
11
+ }