@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,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
+ }
@@ -0,0 +1,14 @@
1
+ import js from '@eslint/js'
2
+ import tseslint from 'typescript-eslint'
3
+
4
+ export default tseslint.config(
5
+ { ignores: ['node_modules', 'dist', 'reports'] },
6
+ {
7
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
8
+ files: ['**/*.ts'],
9
+ rules: {
10
+ '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
11
+ '@typescript-eslint/no-explicit-any': 'warn',
12
+ },
13
+ },
14
+ )
@@ -0,0 +1,13 @@
1
+ # Example feature — replace with your own scenarios
2
+ #
3
+ # Naming convention (ET001): file name must be snake_case.
4
+ # Each feature must have a matching steps file (ET002):
5
+ # features/example.feature → steps/example.steps.ts
6
+
7
+ Feature: Application health
8
+
9
+ Background:
10
+ Given the application is running
11
+
12
+ Scenario: Application is accessible
13
+ Then the page title should not be empty
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "{{projectName}}-e2e",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "description": "End-to-end tests — Playwright + Cucumber.js (BDD/Gherkin)",
6
+ "scripts": {
7
+ "test": "cucumber-js",
8
+ "test:headed": "HEADED=true cucumber-js",
9
+ "test:report": "cucumber-js --format html:reports/cucumber.html --format json:reports/cucumber.json",
10
+ "install:browsers": "playwright install --with-deps chromium",
11
+ "lint": "eslint .",
12
+ "lint:fix": "eslint . --fix",
13
+ "format": "prettier --write '**/*.{ts,json}' --ignore-path .prettierignore",
14
+ "format:check": "prettier --check '**/*.{ts,json}' --ignore-path .prettierignore"
15
+ },
16
+ "dependencies": {
17
+ "@cucumber/cucumber": "^11.2.0",
18
+ "@playwright/test": "^1.50.0",
19
+ "playwright": "^1.50.0"
20
+ },
21
+ "devDependencies": {
22
+ "@eslint/js": "^9.0.0",
23
+ "@types/node": "^22.0.0",
24
+ "eslint": "^9.0.0",
25
+ "prettier": "^3.4.0",
26
+ "ts-node": "^10.9.2",
27
+ "typescript": "^5.7.0",
28
+ "typescript-eslint": "^8.0.0"
29
+ }
30
+ }
@@ -0,0 +1,16 @@
1
+ import { Page } from 'playwright'
2
+
3
+ /**
4
+ * Scaffold page object — rename to reflect the actual UI screen.
5
+ *
6
+ * Naming convention (ET004): file must follow the `*Page.ts` pattern.
7
+ * Use ARIA roles and labels in selectors to stay resilient to CSS changes.
8
+ */
9
+ export class ExamplePage {
10
+ constructor(private readonly page: Page) {}
11
+
12
+ async navigate(baseUrl: string): Promise<void> {
13
+ await this.page.goto(baseUrl)
14
+ await this.page.waitForLoadState('networkidle')
15
+ }
16
+ }
@@ -0,0 +1,27 @@
1
+ import { defineConfig, devices } from '@playwright/test'
2
+
3
+ /**
4
+ * Playwright base configuration.
5
+ *
6
+ * Used by hooks.ts to launch the browser with the right settings.
7
+ * BASE_URL defaults to the local Vite-served frontend on port 5173; override in CI:
8
+ * BASE_URL=https://staging.example.com pnpm test
9
+ */
10
+ export default defineConfig({
11
+ timeout: 30_000,
12
+ retries: process.env.CI ? 2 : 0,
13
+ use: {
14
+ baseURL: process.env.BASE_URL ?? 'http://localhost:5173',
15
+ screenshot: 'only-on-failure',
16
+ video: 'retain-on-failure',
17
+ trace: 'retain-on-failure',
18
+ headless: !process.env.HEADED,
19
+ },
20
+ projects: [
21
+ { name: 'chromium', use: { ...devices['Desktop Chrome'] } },
22
+ ],
23
+ reporter: [
24
+ ['html', { outputFolder: 'reports/playwright', open: 'never' }],
25
+ ['line'],
26
+ ],
27
+ })
@@ -0,0 +1,32 @@
1
+ import { Given, Then } from '@cucumber/cucumber'
2
+ import { CustomWorld } from '../support/world'
3
+
4
+ // ── Background ─────────────────────────────────────────────────────────────
5
+
6
+ Given('the application is running', async function (this: CustomWorld) {
7
+ try {
8
+ await this.page.goto(this.baseUrl, { timeout: 10_000 })
9
+ await this.page.waitForLoadState('networkidle')
10
+ } catch (err: unknown) {
11
+ const msg = err instanceof Error ? err.message : String(err)
12
+ const isNetError =
13
+ msg.includes('ERR_CONNECTION_REFUSED') ||
14
+ msg.includes('ECONNREFUSED') ||
15
+ msg.includes('NS_ERROR_CONNECTION_REFUSED')
16
+ if (isNetError) {
17
+ throw new Error(
18
+ `Application is not reachable at ${this.baseUrl}.\n` +
19
+ 'Start the stack first: dude up\n' +
20
+ 'Override the URL with: BASE_URL=<url> pnpm test',
21
+ )
22
+ }
23
+ throw err
24
+ }
25
+ })
26
+
27
+ // ── Common assertions ──────────────────────────────────────────────────────
28
+
29
+ Then('the page title should not be empty', async function (this: CustomWorld) {
30
+ const title = await this.page.title()
31
+ if (!title) throw new Error('Page title is empty')
32
+ })
@@ -0,0 +1,4 @@
1
+ // Steps for features/example.feature
2
+ //
3
+ // Import page objects from ../pages/ to interact with the UI.
4
+ // Use this.baseUrl (from CustomWorld) instead of hardcoded URLs (ET007).
@@ -0,0 +1,72 @@
1
+ import path from 'path'
2
+ import { promises as fs } from 'fs'
3
+ import {
4
+ After,
5
+ AfterAll,
6
+ Before,
7
+ BeforeAll,
8
+ setDefaultTimeout,
9
+ } from '@cucumber/cucumber'
10
+ import { Browser, chromium } from 'playwright'
11
+ import { CustomWorld } from './world'
12
+
13
+ // Generous timeout to accommodate network-heavy scenarios.
14
+ setDefaultTimeout(90_000)
15
+
16
+ let sharedBrowser: Browser
17
+
18
+ BeforeAll(async () => {
19
+ // Ensure report directories exist before any scenario runs.
20
+ await fs.mkdir('reports/screenshots', { recursive: true })
21
+ await fs.mkdir('reports/videos', { recursive: true })
22
+ await fs.mkdir('reports/traces', { recursive: true })
23
+
24
+ sharedBrowser = await chromium.launch({
25
+ headless: !process.env.HEADED,
26
+ })
27
+ })
28
+
29
+ AfterAll(async () => {
30
+ await sharedBrowser?.close()
31
+ })
32
+
33
+ Before(async function (this: CustomWorld) {
34
+ this.browser = sharedBrowser
35
+ this.context = await this.browser.newContext({
36
+ baseURL: this.baseUrl,
37
+ recordVideo: { dir: 'reports/videos/' },
38
+ })
39
+ this.page = await this.context.newPage()
40
+ await this.context.tracing.start({ screenshots: true, snapshots: true })
41
+ })
42
+
43
+ After(async function (this: CustomWorld, scenario) {
44
+ const safeName = scenario.pickle.name.replace(/[^a-z0-9]/gi, '_')
45
+ const failed = scenario.result?.status === 'FAILED'
46
+
47
+ const screenshot = await this.page?.screenshot({ fullPage: true }).catch(() => undefined)
48
+ const videoPath = await this.page?.video()?.path().catch(() => undefined)
49
+
50
+ if (failed) {
51
+ if (screenshot) {
52
+ await fs
53
+ .writeFile(path.join('reports/screenshots', `${safeName}.png`), screenshot)
54
+ .catch(() => undefined)
55
+ }
56
+ await this.context?.tracing
57
+ .stop({ path: path.join('reports/traces', `${safeName}.zip`) })
58
+ .catch(() => undefined)
59
+ } else {
60
+ await this.context?.tracing.stop().catch(() => undefined)
61
+ }
62
+
63
+ await this.page?.close()
64
+ await this.context?.close()
65
+
66
+ if (videoPath) {
67
+ const destPath = path.join('reports/videos', `${safeName}.webm`)
68
+ await fs.rename(videoPath, destPath).catch(async () => {
69
+ await fs.copyFile(videoPath, destPath).catch(() => undefined)
70
+ })
71
+ }
72
+ })
@@ -0,0 +1,24 @@
1
+ import { IWorldOptions, World, setWorldConstructor } from '@cucumber/cucumber'
2
+ import { Browser, BrowserContext, Page } from 'playwright'
3
+
4
+ export interface ICustomWorld extends World {
5
+ browser: Browser
6
+ context: BrowserContext
7
+ page: Page
8
+ baseUrl: string
9
+ }
10
+
11
+ export class CustomWorld extends World implements ICustomWorld {
12
+ browser!: Browser
13
+ context!: BrowserContext
14
+ page!: Page
15
+ readonly baseUrl: string
16
+
17
+ constructor(options: IWorldOptions) {
18
+ super(options)
19
+ // Override with BASE_URL env var in CI or against non-local environments.
20
+ this.baseUrl = process.env.BASE_URL ?? 'http://localhost:5173'
21
+ }
22
+ }
23
+
24
+ setWorldConstructor(CustomWorld)
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "CommonJS",
5
+ "lib": ["ES2022", "dom"],
6
+ "strict": true,
7
+ "skipLibCheck": true,
8
+ "moduleResolution": "node",
9
+ "ignoreDeprecations": "6.0",
10
+ "esModuleInterop": true,
11
+ "resolveJsonModule": true,
12
+ "outDir": "dist",
13
+ "rootDir": ".",
14
+ "baseUrl": ".",
15
+ "paths": {
16
+ "@pages/*": ["pages/*"],
17
+ "@support/*": ["support/*"]
18
+ }
19
+ },
20
+ "include": ["./**/*.ts"],
21
+ "exclude": ["node_modules", "dist", "reports"]
22
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "semi": false,
3
+ "singleQuote": true,
4
+ "tabWidth": 2,
5
+ "trailingComma": "es5"
6
+ }
@@ -0,0 +1,10 @@
1
+ FROM node:22-alpine
2
+ WORKDIR /app
3
+
4
+ RUN npm install -g pnpm@9
5
+
6
+ COPY package.json pnpm-lock.yaml* ./
7
+ RUN pnpm install
8
+
9
+ EXPOSE 5173
10
+ CMD ["pnpm", "dev", "--host"]
@@ -0,0 +1,4 @@
1
+ node_modules/
2
+ dist/
3
+ .env
4
+ .env.*
@@ -0,0 +1,32 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+
7
+ export default tseslint.config(
8
+ { ignores: ['dist'] },
9
+ {
10
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
+ files: ['**/*.{ts,tsx}'],
12
+ languageOptions: {
13
+ ecmaVersion: 2020,
14
+ globals: globals.browser,
15
+ },
16
+ plugins: {
17
+ 'react-hooks': reactHooks,
18
+ 'react-refresh': reactRefresh,
19
+ },
20
+ rules: {
21
+ ...reactHooks.configs.recommended.rules,
22
+ 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
23
+ },
24
+ },
25
+ {
26
+ // utils/ never exports components — fast-refresh boundary warnings are noise there
27
+ files: ['src/utils/**/*.{ts,tsx}'],
28
+ rules: {
29
+ 'react-refresh/only-export-components': 'off',
30
+ },
31
+ },
32
+ )
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
7
+ <title>{{projectName}}</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "{{projectName}}-frontend",
3
+ "private": true,
4
+ "version": "0.0.1",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc -b && vite build",
9
+ "preview": "vite preview"
10
+ },
11
+ "dependencies": {
12
+ "@ant-design/icons": "^5.6.0",
13
+ "@tanstack/react-query": "^5.0.0",
14
+ "@tanstack/react-query-devtools": "^5.0.0",
15
+ "antd": "^5.24.0",
16
+ "react": "^19.0.0",
17
+ "react-dom": "^19.0.0",
18
+ "react-router-dom": "^7.0.0",
19
+ "zustand": "^5.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@eslint/js": "^9.0.0",
23
+ "@types/react": "^19.0.0",
24
+ "@types/react-dom": "^19.0.0",
25
+ "@vitejs/plugin-react": "^4.3.0",
26
+ "eslint": "^9.0.0",
27
+ "eslint-plugin-react-hooks": "^5.0.0",
28
+ "eslint-plugin-react-refresh": "^0.4.0",
29
+ "globals": "^15.0.0",
30
+ "prettier": "^3.4.0",
31
+ "typescript": "^5.6.0",
32
+ "typescript-eslint": "^8.0.0",
33
+ "vite": "^5.4.0"
34
+ },
35
+ "pnpm": {
36
+ "onlyBuiltDependencies": ["esbuild"]
37
+ }
38
+ }
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none">
2
+ <rect width="48" height="48" rx="12" fill="#1677ff"/>
3
+ <text x="50%" y="54%" font-family="system-ui, sans-serif" font-size="26" font-weight="700"
4
+ fill="#fff" text-anchor="middle" dominant-baseline="middle">D</text>
5
+ </svg>
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none">
2
+ <rect width="48" height="48" rx="12" fill="#1677ff"/>
3
+ <text x="50%" y="54%" font-family="system-ui, sans-serif" font-size="26" font-weight="700"
4
+ fill="#fff" text-anchor="middle" dominant-baseline="middle">D</text>
5
+ </svg>
@@ -0,0 +1,10 @@
1
+ import { HomeOutlined{{#if withPostgres}}, TeamOutlined{{/if}} } from '@ant-design/icons'
2
+ import type { MenuEntry } from './types'
3
+
4
+ /** Sidebar navigation — one entry per top-level route. */
5
+ export const MENU_ITEMS: MenuEntry[] = [
6
+ { key: 'home', label: 'Home', icon: <HomeOutlined />, path: '/' },
7
+ {{#if withPostgres}}
8
+ { key: 'users', label: 'Users', icon: <TeamOutlined />, path: '/users' },
9
+ {{/if}}
10
+ ]
@@ -0,0 +1,80 @@
1
+ import { useState } from 'react'
2
+ import { Layout as AntLayout, Menu, Typography } from 'antd'
3
+ import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons'
4
+ import { Outlet, useNavigate, useLocation } from 'react-router-dom'
5
+ import logo from './$assets/logo.svg'
6
+ import { MENU_ITEMS } from './constants'
7
+
8
+ const { Sider, Header, Content } = AntLayout
9
+
10
+ const APP_TITLE = import.meta.env.VITE_APP_TITLE
11
+
12
+ export default function Layout() {
13
+ const [collapsed, setCollapsed] = useState(false)
14
+ const navigate = useNavigate()
15
+ const location = useLocation()
16
+
17
+ const selectedKey =
18
+ location.pathname === '/' ? 'home' : location.pathname.slice(1).split('/')[0] ?? 'home'
19
+
20
+ return (
21
+ <AntLayout style={{ minHeight: '100vh' }}>
22
+ <Sider collapsible collapsed={collapsed} trigger={null} width={220}>
23
+ <div
24
+ style={{
25
+ display: 'flex',
26
+ alignItems: 'center',
27
+ justifyContent: 'center',
28
+ padding: '16px 0 4px',
29
+ }}
30
+ >
31
+ <img src={logo} alt={APP_TITLE} style={{ height: 28 }} />
32
+ </div>
33
+ <Menu
34
+ theme="dark"
35
+ mode="inline"
36
+ selectedKeys={[selectedKey]}
37
+ style={{ paddingTop: 12, borderRight: 0 }}
38
+ items={MENU_ITEMS.map(({ key, label, icon, path }) => ({
39
+ key,
40
+ icon,
41
+ label,
42
+ onClick: () => navigate(path),
43
+ }))}
44
+ />
45
+ </Sider>
46
+
47
+ <AntLayout>
48
+ <Header
49
+ style={{
50
+ background: '#fff',
51
+ padding: '0 16px',
52
+ display: 'flex',
53
+ alignItems: 'center',
54
+ gap: 16,
55
+ borderBottom: '1px solid #f0f0f0',
56
+ }}
57
+ >
58
+ {collapsed ? (
59
+ <MenuUnfoldOutlined
60
+ style={{ fontSize: 18, cursor: 'pointer', color: '#555' }}
61
+ onClick={() => setCollapsed(false)}
62
+ />
63
+ ) : (
64
+ <MenuFoldOutlined
65
+ style={{ fontSize: 18, cursor: 'pointer', color: '#555' }}
66
+ onClick={() => setCollapsed(true)}
67
+ />
68
+ )}
69
+ <Typography.Title level={4} style={{ margin: 0 }}>
70
+ {APP_TITLE}
71
+ </Typography.Title>
72
+ </Header>
73
+
74
+ <Content style={{ margin: 0, padding: 24 }}>
75
+ <Outlet />
76
+ </Content>
77
+ </AntLayout>
78
+ </AntLayout>
79
+ )
80
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react'
2
+
3
+ /** One sidebar navigation entry. */
4
+ export interface MenuEntry {
5
+ key: string
6
+ label: string
7
+ icon: ReactNode
8
+ path: string
9
+ }
@@ -0,0 +1 @@
1
+ export { default as Layout } from './Layout'
@@ -0,0 +1,2 @@
1
+ export { default as useCounterStore } from './useCounterStore'
2
+ export { default as usePageTitle } from './usePageTitle'
@@ -0,0 +1,28 @@
1
+ import { create } from 'zustand'
2
+ import { devtools } from 'zustand/middleware'
3
+ import type { CounterState } from './types'
4
+
5
+ /**
6
+ * Example zustand store — global state shared across components without
7
+ * prop-drilling or context. A store is a hook, so it lives in $hooks/.
8
+ *
9
+ * The devtools middleware connects to the Redux DevTools browser extension;
10
+ * it is enabled only in dev builds. The third argument of `set` names the
11
+ * action shown in the extension's timeline.
12
+ *
13
+ * @example
14
+ * const { count, increment } = useCounterStore()
15
+ */
16
+ const useCounterStore = create<CounterState>()(
17
+ devtools(
18
+ (set) => ({
19
+ count: 0,
20
+ increment: () => set((state) => ({ count: state.count + 1 }), undefined, 'counter/increment'),
21
+ decrement: () => set((state) => ({ count: state.count - 1 }), undefined, 'counter/decrement'),
22
+ reset: () => set({ count: 0 }, undefined, 'counter/reset'),
23
+ }),
24
+ { name: 'counter', enabled: import.meta.env.DEV },
25
+ ),
26
+ )
27
+
28
+ export default useCounterStore
@@ -0,0 +1,7 @@
1
+ /** State + actions of the example zustand counter store. */
2
+ export interface CounterState {
3
+ count: number
4
+ increment: () => void
5
+ decrement: () => void
6
+ reset: () => void
7
+ }
@@ -0,0 +1,21 @@
1
+ import { useEffect } from 'react'
2
+
3
+ const APP_TITLE = import.meta.env.VITE_APP_TITLE as string
4
+
5
+ /**
6
+ * Sets the browser tab title to `${pageTitle} — ${APP_TITLE}`.
7
+ * Restores the bare app title on unmount.
8
+ *
9
+ * @example
10
+ * // inside a page component:
11
+ * usePageTitle('Dashboard')
12
+ * // → document.title = "Dashboard — My App"
13
+ */
14
+ export default function usePageTitle(pageTitle: string): void {
15
+ useEffect(() => {
16
+ document.title = pageTitle ? `${pageTitle} — ${APP_TITLE}` : APP_TITLE
17
+ return () => {
18
+ document.title = APP_TITLE
19
+ }
20
+ }, [pageTitle])
21
+ }
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ interface ImportMetaEnv {
4
+ readonly VITE_APP_TITLE: string
5
+ readonly VITE_REACT_QUERY_DEVTOOLS: string
6
+ }
7
+
8
+ interface ImportMeta {
9
+ readonly env: ImportMetaEnv
10
+ }
@@ -0,0 +1,40 @@
1
+ import { BrowserRouter, Route, Routes } from 'react-router-dom'
2
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
3
+ import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
4
+ import { App as AntApp, ConfigProvider } from 'antd'
5
+
6
+ import { Layout } from '@/$components'
7
+ import HomePage from '@/pages'
8
+ {{#if withPostgres}}
9
+ import UsersPage from '@/pages/users'
10
+ import UserDetailPage from '@/pages/users/[id]'
11
+ {{/if}}
12
+
13
+ const queryClient = new QueryClient({
14
+ defaultOptions: {
15
+ queries: { retry: false, refetchOnWindowFocus: false },
16
+ },
17
+ })
18
+
19
+ export function App() {
20
+ return (
21
+ <ConfigProvider>
22
+ <AntApp>
23
+ <QueryClientProvider client={queryClient}>
24
+ <BrowserRouter>
25
+ <Routes>
26
+ <Route element={<Layout />}>
27
+ <Route path="/" element={<HomePage />} />
28
+ {{#if withPostgres}}
29
+ <Route path="/users" element={<UsersPage />} />
30
+ <Route path="/users/:id" element={<UserDetailPage />} />
31
+ {{/if}}
32
+ </Route>
33
+ </Routes>
34
+ </BrowserRouter>
35
+ {import.meta.env.VITE_REACT_QUERY_DEVTOOLS === 'true' && <ReactQueryDevtools initialIsOpen={false} />}
36
+ </QueryClientProvider>
37
+ </AntApp>
38
+ </ConfigProvider>
39
+ )
40
+ }
@@ -0,0 +1,10 @@
1
+ import { StrictMode } from 'react'
2
+ import { createRoot } from 'react-dom/client'
3
+ import './styles.module.css'
4
+ import { App } from './App'
5
+
6
+ createRoot(document.getElementById('root')!).render(
7
+ <StrictMode>
8
+ <App />
9
+ </StrictMode>,
10
+ )