@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,2 @@
1
+ auto-install-peers=true
2
+ strict-peer-dependencies=false
@@ -0,0 +1,22 @@
1
+ FROM python:3.13-slim
2
+ WORKDIR /app
3
+
4
+ # Install uv (fast Python package manager)
5
+ RUN pip install --no-cache-dir uv
6
+
7
+ # Install all dependencies (including dev: pytest, ruff, mypy …)
8
+ COPY pyproject.toml .
9
+ RUN uv sync --no-cache
10
+ {{#if withPostgres}}
11
+
12
+ # Copy start script (waits for Postgres, runs migrations, starts uvicorn)
13
+ COPY start.sh /start.sh
14
+ RUN chmod +x /start.sh
15
+
16
+ EXPOSE 8000
17
+ CMD ["/start.sh"]
18
+ {{else}}
19
+
20
+ EXPOSE 8000
21
+ CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
22
+ {{/if}}
@@ -0,0 +1,74 @@
1
+ # Backend
2
+
3
+ FastAPI service for `{{projectName}}`.
4
+
5
+ ## App structure
6
+
7
+ ```
8
+ app/
9
+ ├── core/ # settings, database session, shared utilities
10
+ ├── fixtures/ # test fixture helpers
11
+ ├── management/ # management / admin commands
12
+ ├── models/ # SQLAlchemy ORM models
13
+ ├── queries/ # database query functions
14
+ ├── routers/ # APIRouter modules (one file per resource)
15
+ ├── schemas/ # Pydantic request/response schemas
16
+ ├── tasks/ # Celery task definitions
17
+ ├── tests/ # pytest test suite
18
+ │ ├── models/
19
+ │ ├── queries/
20
+ │ ├── routers/
21
+ │ ├── tasks/
22
+ │ └── utils/
23
+ ├── utils/ # pure helper functions
24
+ ├── __init__.py
25
+ └── main.py # entry point — routers, lifespan
26
+ ```
27
+
28
+ Every source file in `models/`, `queries/`, `routers/`, `tasks/`, and `utils/`
29
+ must have a corresponding test file in `tests/<dir>/test_<name>.py`.
30
+ Run `dude lint` from the project root to check coverage.
31
+
32
+ ## Requirements
33
+
34
+ - Python 3.13+
35
+ - [uv](https://docs.astral.sh/uv/) (recommended)
36
+ - Docker (recommended for full-stack dev)
37
+ {{#if withPostgres}}
38
+ - PostgreSQL 17
39
+ {{/if}}
40
+ {{#if withCelery}}
41
+ - Redis 7
42
+ {{/if}}
43
+
44
+ ## Run with Docker
45
+
46
+ ```bash
47
+ docker compose up --build
48
+ ```
49
+ {{#if withPostgres}}
50
+
51
+ Migrations run automatically on container start via `start.sh`.
52
+
53
+ To create a new migration after changing models:
54
+
55
+ ```bash
56
+ dude db makemigration --message "describe change"
57
+ dude db migrate
58
+ ```
59
+ {{/if}}
60
+ {{#if withCelery}}
61
+
62
+ Celery worker and{{#if withCeleryBeat}} beat scheduler and{{/if}} Flower monitor are started automatically by docker compose.
63
+ Flower UI: <http://localhost:5555>
64
+ {{/if}}
65
+
66
+ ## Run locally (without Docker)
67
+
68
+ ```bash
69
+ uv sync
70
+ uv run uvicorn app.main:app --reload --port 8000
71
+ ```
72
+
73
+ Then open <http://localhost:8000/api/health>.
74
+
@@ -0,0 +1,11 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.pyo
5
+ .pytest_cache/
6
+ .mypy_cache/
7
+ .ruff_cache/
8
+ *.egg-info/
9
+ dist/
10
+ .env
11
+ .env.*
@@ -0,0 +1 @@
1
+ """FastAPI application package."""
File without changes
@@ -0,0 +1,23 @@
1
+ """Centralised settings — all environment variables are read here."""
2
+
3
+ from pydantic_settings import BaseSettings, SettingsConfigDict
4
+
5
+
6
+ class Settings(BaseSettings):
7
+ model_config = SettingsConfigDict(env_file=".env", case_sensitive=True)
8
+
9
+ APP_TITLE: str = "{{projectName}}"
10
+ {{#if withRedis}}
11
+ CELERY_BROKER_URL: str = "redis://redis:6379/0"
12
+ CELERY_RESULT_BACKEND: str = "redis://redis:6379/0"
13
+ {{/if}}
14
+ {{#if withPostgres}}
15
+ DATABASE_URL: str = "postgresql://postgres:postgres@postgres:5432/app"
16
+ {{/if}}
17
+ DEBUG: bool = False
18
+ {{#if withRedis}}
19
+ REDIS_URL: str = "redis://redis:6379/0"
20
+ {{/if}}
21
+
22
+
23
+ settings = Settings()
@@ -0,0 +1,41 @@
1
+ """FastAPI entrypoint."""
2
+
3
+ from fastapi import APIRouter, FastAPI
4
+ from fastapi.middleware.cors import CORSMiddleware
5
+
6
+ from app.routers import (
7
+ health,
8
+ {{#if withPostgres}}
9
+ users,
10
+ users__id,
11
+ {{/if}}
12
+ )
13
+
14
+ # Serve the docs + OpenAPI schema under /api so they reach the backend through
15
+ # the ALB Ingress (which routes /api → backend, everything else → frontend). This
16
+ # keeps a single backend prefix and works identically in local dev (the Vite
17
+ # proxy forwards /api) and in the cluster.
18
+ app = FastAPI(
19
+ title="{{projectName}} backend",
20
+ docs_url="/api/docs",
21
+ redoc_url="/api/redoc",
22
+ openapi_url="/api/openapi.json",
23
+ )
24
+
25
+ app.add_middleware(
26
+ CORSMiddleware,
27
+ allow_origins=["http://localhost:5173"],
28
+ allow_credentials=True,
29
+ allow_methods=["*"],
30
+ allow_headers=["*"],
31
+ )
32
+
33
+ api_router = APIRouter(prefix="/api")
34
+
35
+ api_router.include_router(health.router)
36
+ {{#if withPostgres}}
37
+ api_router.include_router(users.router)
38
+ api_router.include_router(users__id.router)
39
+ {{/if}}
40
+
41
+ app.include_router(api_router)
File without changes
File without changes
File without changes
@@ -0,0 +1,13 @@
1
+ """Health-check router."""
2
+
3
+ from fastapi import APIRouter
4
+
5
+ from app.schemas.health import HealthResponse
6
+
7
+ router = APIRouter()
8
+
9
+
10
+ @router.get("/health")
11
+ async def get_health() -> HealthResponse:
12
+ """Health-check endpoint."""
13
+ return HealthResponse(status="ok")
File without changes
@@ -0,0 +1,7 @@
1
+ """Schemas for the health endpoint."""
2
+
3
+ from pydantic import BaseModel
4
+
5
+
6
+ class HealthResponse(BaseModel):
7
+ status: str
@@ -0,0 +1 @@
1
+ """Tasks package."""
File without changes
@@ -0,0 +1,13 @@
1
+ """Pytest configuration and shared fixtures."""
2
+
3
+ import pytest
4
+ from httpx import ASGITransport, AsyncClient
5
+
6
+ from app.main import app
7
+
8
+
9
+ @pytest.fixture
10
+ async def client():
11
+ """Async HTTP client pointed at the FastAPI app."""
12
+ async with AsyncClient(transport=ASGITransport(app=app), base_url="http://test") as c:
13
+ yield c
@@ -0,0 +1,10 @@
1
+ """Tests for routers/health.py."""
2
+
3
+ import pytest
4
+
5
+
6
+ @pytest.mark.anyio
7
+ async def test_get_health(client):
8
+ response = await client.get("/api/health")
9
+ assert response.status_code == 200
10
+ assert response.json() == {"status": "ok"}
@@ -0,0 +1 @@
1
+ """Task tests package."""
File without changes
@@ -0,0 +1,40 @@
1
+ [project]
2
+ name = "{{projectName}}-backend"
3
+ version = "0.0.1"
4
+ description = "FastAPI backend for {{projectName}}"
5
+ requires-python = ">=3.13"
6
+ dependencies = [
7
+ "fastapi>=0.115.0",
8
+ "pydantic-settings>=2.6.0",
9
+ "uvicorn[standard]>=0.32.0",
10
+ {{#if withPostgres}}
11
+ "alembic>=1.14.0",
12
+ "psycopg2-binary>=2.9.9",
13
+ "sqlmodel>=0.0.22",
14
+ {{/if}}
15
+ {{#if withCelery}}
16
+ "celery[redis]>=5.4.0",
17
+ {{/if}}
18
+ ]
19
+
20
+ [tool.uv]
21
+ dev-dependencies = [
22
+ "anyio[trio]>=4.0.0",
23
+ "pytest>=8.0.0",
24
+ "pytest-asyncio>=0.24.0",
25
+ "httpx>=0.27.0",
26
+ "ruff>=0.7.0",
27
+ "mypy>=1.13.0",
28
+ ]
29
+
30
+ [tool.pytest.ini_options]
31
+ asyncio_mode = "strict"
32
+
33
+ [tool.ruff]
34
+ line-length = 100
35
+
36
+ [tool.ruff.lint]
37
+ select = ["E", "F", "I", "N", "UP", "B", "S", "RUF"]
38
+
39
+ [tool.mypy]
40
+ strict = true
@@ -0,0 +1,128 @@
1
+ services:
2
+ backend:
3
+ build:
4
+ context: ./backend
5
+ dockerfile: Dockerfile
6
+ ports:
7
+ - "8000:8000"
8
+ restart: unless-stopped
9
+ environment:
10
+ APP_TITLE: ${APP_TITLE:-app}
11
+ DEBUG: ${DEBUG:-false}
12
+ {{#if withPostgres}}
13
+ DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/app}
14
+ {{/if}}
15
+ {{#if withRedis}}
16
+ CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
17
+ CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/0}
18
+ {{/if}}
19
+ {{#if withPostgres}}
20
+ depends_on:
21
+ postgres:
22
+ condition: service_healthy
23
+ {{/if}}
24
+ volumes:
25
+ - ./backend/app:/app/app
26
+ {{#if withPostgres}}
27
+ - ./backend/alembic:/app/alembic
28
+ - ./backend/alembic.ini:/app/alembic.ini
29
+ {{/if}}
30
+
31
+ frontend:
32
+ build:
33
+ context: ./frontend
34
+ dockerfile: Dockerfile
35
+ ports:
36
+ - "5173:5173"
37
+ depends_on:
38
+ - backend
39
+ restart: unless-stopped
40
+ environment:
41
+ VITE_APP_TITLE: ${VITE_APP_TITLE:-app}
42
+ VITE_REACT_QUERY_DEVTOOLS: ${VITE_REACT_QUERY_DEVTOOLS:-false}
43
+ BACKEND_URL: http://backend:8000
44
+ volumes:
45
+ - ./frontend:/app
46
+ - /app/node_modules
47
+ {{#if withPostgres}}
48
+
49
+ postgres:
50
+ image: postgres:17-alpine
51
+ restart: unless-stopped
52
+ environment:
53
+ POSTGRES_USER: ${POSTGRES_USER:-postgres}
54
+ POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
55
+ POSTGRES_DB: ${POSTGRES_DB:-app}
56
+ ports:
57
+ - "5432:5432"
58
+ volumes:
59
+ - postgres_data:/var/lib/postgresql/data
60
+ healthcheck:
61
+ test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres}"]
62
+ interval: 5s
63
+ timeout: 5s
64
+ retries: 10
65
+ {{/if}}
66
+ {{#if withRedis}}
67
+
68
+ redis:
69
+ image: redis:7-alpine
70
+ restart: unless-stopped
71
+ ports:
72
+ - "6379:6379"
73
+ {{/if}}
74
+ {{#if withCelery}}
75
+
76
+ celery_worker:
77
+ build:
78
+ context: ./backend
79
+ dockerfile: Dockerfile
80
+ command: uv run celery -A app.worker.celery_app worker --loglevel=info
81
+ restart: unless-stopped
82
+ environment:
83
+ CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
84
+ CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/0}
85
+ {{#if withPostgres}}
86
+ DATABASE_URL: ${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/app}
87
+ {{/if}}
88
+ depends_on:
89
+ - redis
90
+ {{#if withPostgres}}
91
+ - backend
92
+ {{/if}}
93
+ volumes:
94
+ - ./backend/app:/app/app
95
+
96
+ flower:
97
+ image: mher/flower:2.0
98
+ restart: unless-stopped
99
+ environment:
100
+ CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
101
+ ports:
102
+ - "5555:5555"
103
+ depends_on:
104
+ - redis
105
+ - celery_worker
106
+ {{/if}}
107
+ {{#if withCeleryBeat}}
108
+
109
+ celery_beat:
110
+ build:
111
+ context: ./backend
112
+ dockerfile: Dockerfile
113
+ command: uv run celery -A app.worker.celery_app beat --loglevel=info
114
+ restart: unless-stopped
115
+ environment:
116
+ CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://redis:6379/0}
117
+ CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://redis:6379/0}
118
+ depends_on:
119
+ - redis
120
+ - celery_worker
121
+ volumes:
122
+ - ./backend/app:/app/app
123
+ {{/if}}
124
+ {{#if withPostgres}}
125
+
126
+ volumes:
127
+ postgres_data:
128
+ {{/if}}
@@ -0,0 +1,21 @@
1
+ # Command reference
2
+
3
+ !!! info "Auto-generated"
4
+ This page is generated from the **live `dude` command catalog** every time you
5
+ run `dude docs`, so it always matches your project's actual commands —
6
+ including the choices made at `dude init` (database, Celery, IaC…) and any
7
+ project-local commands under `.dude/commands/`.
8
+
9
+ You're seeing this placeholder because the docs haven't been served yet. Run:
10
+
11
+ ```bash
12
+ dude docs
13
+ ```
14
+
15
+ and this page will be replaced with the full reference. You can also print it
16
+ yourself at any time:
17
+
18
+ ```bash
19
+ dude help --format md # this page, as Markdown
20
+ dude help --format json # the same catalog as JSON (for tooling / LLMs)
21
+ ```