@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.
- package/LICENSE +33 -0
- package/README.md +66 -0
- package/dist/commands/lint/checks/BE/001.d.ts +6 -0
- package/dist/commands/lint/checks/BE/001.js +94 -0
- package/dist/commands/lint/checks/BE/001.js.map +1 -0
- package/dist/commands/lint/checks/BE/002.d.ts +6 -0
- package/dist/commands/lint/checks/BE/002.js +136 -0
- package/dist/commands/lint/checks/BE/002.js.map +1 -0
- package/dist/commands/lint/checks/BE/003.d.ts +6 -0
- package/dist/commands/lint/checks/BE/003.js +89 -0
- package/dist/commands/lint/checks/BE/003.js.map +1 -0
- package/dist/commands/lint/checks/BE/004.d.ts +6 -0
- package/dist/commands/lint/checks/BE/004.js +68 -0
- package/dist/commands/lint/checks/BE/004.js.map +1 -0
- package/dist/commands/lint/checks/BE/005.d.ts +6 -0
- package/dist/commands/lint/checks/BE/005.js +55 -0
- package/dist/commands/lint/checks/BE/005.js.map +1 -0
- package/dist/commands/lint/checks/BE/006.d.ts +6 -0
- package/dist/commands/lint/checks/BE/006.js +95 -0
- package/dist/commands/lint/checks/BE/006.js.map +1 -0
- package/dist/commands/lint/checks/BE/007.d.ts +6 -0
- package/dist/commands/lint/checks/BE/007.js +53 -0
- package/dist/commands/lint/checks/BE/007.js.map +1 -0
- package/dist/commands/lint/checks/BE/008.d.ts +6 -0
- package/dist/commands/lint/checks/BE/008.js +70 -0
- package/dist/commands/lint/checks/BE/008.js.map +1 -0
- package/dist/commands/lint/checks/BE/009.d.ts +6 -0
- package/dist/commands/lint/checks/BE/009.js +112 -0
- package/dist/commands/lint/checks/BE/009.js.map +1 -0
- package/dist/commands/lint/checks/BE/010.d.ts +6 -0
- package/dist/commands/lint/checks/BE/010.js +76 -0
- package/dist/commands/lint/checks/BE/010.js.map +1 -0
- package/dist/commands/lint/checks/BE/011.d.ts +6 -0
- package/dist/commands/lint/checks/BE/011.js +76 -0
- package/dist/commands/lint/checks/BE/011.js.map +1 -0
- package/dist/commands/lint/checks/BE/012.d.ts +6 -0
- package/dist/commands/lint/checks/BE/012.js +61 -0
- package/dist/commands/lint/checks/BE/012.js.map +1 -0
- package/dist/commands/lint/checks/BE/013.d.ts +6 -0
- package/dist/commands/lint/checks/BE/013.js +98 -0
- package/dist/commands/lint/checks/BE/013.js.map +1 -0
- package/dist/commands/lint/checks/BE/014.d.ts +6 -0
- package/dist/commands/lint/checks/BE/014.js +64 -0
- package/dist/commands/lint/checks/BE/014.js.map +1 -0
- package/dist/commands/lint/checks/E2E/001.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/001.js +35 -0
- package/dist/commands/lint/checks/E2E/001.js.map +1 -0
- package/dist/commands/lint/checks/E2E/002.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/002.js +37 -0
- package/dist/commands/lint/checks/E2E/002.js.map +1 -0
- package/dist/commands/lint/checks/E2E/003.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/003.js +42 -0
- package/dist/commands/lint/checks/E2E/003.js.map +1 -0
- package/dist/commands/lint/checks/E2E/004.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/004.js +37 -0
- package/dist/commands/lint/checks/E2E/004.js.map +1 -0
- package/dist/commands/lint/checks/E2E/005.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/005.js +47 -0
- package/dist/commands/lint/checks/E2E/005.js.map +1 -0
- package/dist/commands/lint/checks/E2E/006.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/006.js +28 -0
- package/dist/commands/lint/checks/E2E/006.js.map +1 -0
- package/dist/commands/lint/checks/E2E/007.d.ts +6 -0
- package/dist/commands/lint/checks/E2E/007.js +47 -0
- package/dist/commands/lint/checks/E2E/007.js.map +1 -0
- package/dist/commands/lint/checks/FE/001.d.ts +6 -0
- package/dist/commands/lint/checks/FE/001.js +56 -0
- package/dist/commands/lint/checks/FE/001.js.map +1 -0
- package/dist/commands/lint/checks/FE/002.d.ts +6 -0
- package/dist/commands/lint/checks/FE/002.js +80 -0
- package/dist/commands/lint/checks/FE/002.js.map +1 -0
- package/dist/commands/lint/checks/FE/003.d.ts +6 -0
- package/dist/commands/lint/checks/FE/003.js +65 -0
- package/dist/commands/lint/checks/FE/003.js.map +1 -0
- package/dist/commands/lint/checks/FE/004.d.ts +6 -0
- package/dist/commands/lint/checks/FE/004.js +72 -0
- package/dist/commands/lint/checks/FE/004.js.map +1 -0
- package/dist/commands/lint/checks/FE/005.d.ts +6 -0
- package/dist/commands/lint/checks/FE/005.js +103 -0
- package/dist/commands/lint/checks/FE/005.js.map +1 -0
- package/dist/commands/lint/checks/FE/006.d.ts +6 -0
- package/dist/commands/lint/checks/FE/006.js +102 -0
- package/dist/commands/lint/checks/FE/006.js.map +1 -0
- package/dist/commands/lint/checks/FE/007.d.ts +6 -0
- package/dist/commands/lint/checks/FE/007.js +60 -0
- package/dist/commands/lint/checks/FE/007.js.map +1 -0
- package/dist/commands/lint/checks/FE/008.d.ts +6 -0
- package/dist/commands/lint/checks/FE/008.js +115 -0
- package/dist/commands/lint/checks/FE/008.js.map +1 -0
- package/dist/commands/lint/checks/FE/009.d.ts +6 -0
- package/dist/commands/lint/checks/FE/009.js +83 -0
- package/dist/commands/lint/checks/FE/009.js.map +1 -0
- package/dist/commands/lint/checks/FE/010.d.ts +6 -0
- package/dist/commands/lint/checks/FE/010.js +105 -0
- package/dist/commands/lint/checks/FE/010.js.map +1 -0
- package/dist/commands/lint/checks/FE/011.d.ts +6 -0
- package/dist/commands/lint/checks/FE/011.js +43 -0
- package/dist/commands/lint/checks/FE/011.js.map +1 -0
- package/dist/commands/lint/checks/FE/012.d.ts +6 -0
- package/dist/commands/lint/checks/FE/012.js +150 -0
- package/dist/commands/lint/checks/FE/012.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +3436 -0
- package/dist/index.js.map +1 -0
- package/dude.stack.json +13 -0
- package/package.json +43 -0
- package/templates/aws-ecs/backend/Dockerfile.prod +34 -0
- package/templates/aws-ecs/docs/docs/deploy.md.hbs +54 -0
- package/templates/aws-ecs/frontend/Dockerfile.prod +28 -0
- package/templates/aws-ecs/frontend/nginx.conf +21 -0
- package/templates/aws-ecs/iac/README.md.hbs +75 -0
- package/templates/aws-ecs/iac/_gitignore +14 -0
- package/templates/aws-ecs/iac/runner/Dockerfile +35 -0
- package/templates/aws-ecs/iac/terraform/bootstrap/main.tf.hbs +102 -0
- package/templates/aws-ecs/iac/terraform/bootstrap/outputs.tf +19 -0
- package/templates/aws-ecs/iac/terraform/bootstrap/variables.tf.hbs +17 -0
- package/templates/aws-ecs/iac/terraform/environments/dev/backend.hcl.hbs +12 -0
- package/templates/aws-ecs/iac/terraform/environments/dev/terraform.tfvars.hbs +43 -0
- package/templates/aws-ecs/iac/terraform/main.tf.hbs +949 -0
- package/templates/aws-ecs/iac/terraform/outputs.tf.hbs +71 -0
- package/templates/aws-ecs/iac/terraform/providers.tf +19 -0
- package/templates/aws-ecs/iac/terraform/variables.tf.hbs +113 -0
- package/templates/aws-ecs/iac/terraform/versions.tf +19 -0
- package/templates/base/.claude/agents/issue-fixer.md +190 -0
- package/templates/base/.claude/agents/security-fixer.md +250 -0
- package/templates/base/.claude/rules/BE/001.md +19 -0
- package/templates/base/.claude/rules/BE/002.md +21 -0
- package/templates/base/.claude/rules/BE/003.md +19 -0
- package/templates/base/.claude/rules/BE/004.md +16 -0
- package/templates/base/.claude/rules/BE/005.md +23 -0
- package/templates/base/.claude/rules/BE/006.md +13 -0
- package/templates/base/.claude/rules/BE/007.md +24 -0
- package/templates/base/.claude/rules/BE/008.md +19 -0
- package/templates/base/.claude/rules/BE/009.md +18 -0
- package/templates/base/.claude/rules/BE/010.md +15 -0
- package/templates/base/.claude/rules/BE/011.md +17 -0
- package/templates/base/.claude/rules/BE/012.md +18 -0
- package/templates/base/.claude/rules/BE/013.md +22 -0
- package/templates/base/.claude/rules/BE/014.md +15 -0
- package/templates/base/.claude/rules/E2E/001.md +13 -0
- package/templates/base/.claude/rules/E2E/002.md +14 -0
- package/templates/base/.claude/rules/E2E/003.md +10 -0
- package/templates/base/.claude/rules/E2E/004.md +23 -0
- package/templates/base/.claude/rules/E2E/005.md +15 -0
- package/templates/base/.claude/rules/E2E/006.md +13 -0
- package/templates/base/.claude/rules/E2E/007.md +18 -0
- package/templates/base/.claude/rules/FE/001.md +22 -0
- package/templates/base/.claude/rules/FE/002.md +39 -0
- package/templates/base/.claude/rules/FE/003.md +19 -0
- package/templates/base/.claude/rules/FE/004.md +21 -0
- package/templates/base/.claude/rules/FE/005.md +33 -0
- package/templates/base/.claude/rules/FE/006.md +24 -0
- package/templates/base/.claude/rules/FE/007.md +19 -0
- package/templates/base/.claude/rules/FE/008.md +26 -0
- package/templates/base/.claude/rules/FE/009.md +30 -0
- package/templates/base/.claude/rules/FE/010.md +25 -0
- package/templates/base/.claude/rules/FE/011.md +22 -0
- package/templates/base/.claude/rules/FE/012.md +32 -0
- package/templates/base/.claude/settings.json +53 -0
- package/templates/base/.claude/skills/clean-branches/SKILL.md +100 -0
- package/templates/base/.claude/skills/create/SKILL.md +47 -0
- package/templates/base/.claude/skills/create-jira-issue/SKILL.md +174 -0
- package/templates/base/.claude/skills/create-page/SKILL.md +195 -0
- package/templates/base/.claude/skills/create-route/SKILL.md +156 -0
- package/templates/base/.claude/skills/draft-email/SKILL.md +104 -0
- package/templates/base/.claude/skills/fix-issues/SKILL.md +238 -0
- package/templates/base/.claude/skills/security-scan/SKILL.md +297 -0
- package/templates/base/.claude/skills/verify-security-fixes/SKILL.md +180 -0
- package/templates/base/.dude/commands/README.md +85 -0
- package/templates/base/.dude/commands/hello.ts +34 -0
- package/templates/base/.dude/lint/checks/PRJ/001.ts +26 -0
- package/templates/base/.dude/lint/checks/README.md +69 -0
- package/templates/base/.vscode/tasks.json +44 -0
- package/templates/base/.worktreeinclude +2 -0
- package/templates/base/CLAUDE.md.hbs +391 -0
- package/templates/base/README.md.hbs +188 -0
- package/templates/base/_env.example.hbs +39 -0
- package/templates/base/_env.hbs +35 -0
- package/templates/base/_gitignore +31 -0
- package/templates/base/_npmrc +2 -0
- package/templates/base/backend/Dockerfile +16 -0
- package/templates/base/backend/README.md.hbs +90 -0
- package/templates/base/backend/_dockerignore +12 -0
- package/templates/base/backend/apps/__init__.py +0 -0
- package/templates/base/backend/apps/core/__init__.py +0 -0
- package/templates/base/backend/apps/core/apps.py +6 -0
- package/templates/base/backend/apps/core/serializers.py +7 -0
- package/templates/base/backend/apps/core/tests/__init__.py +0 -0
- package/templates/base/backend/apps/core/tests/test_views.py +16 -0
- package/templates/base/backend/apps/core/urls.py +9 -0
- package/templates/base/backend/apps/core/views.py +24 -0
- package/templates/base/backend/apps/users/__init__.py +0 -0
- package/templates/base/backend/apps/users/admin.py +6 -0
- package/templates/base/backend/apps/users/apps.py +6 -0
- package/templates/base/backend/apps/users/migrations/0001_initial.py +41 -0
- package/templates/base/backend/apps/users/migrations/__init__.py +0 -0
- package/templates/base/backend/apps/users/models.py +15 -0
- package/templates/base/backend/apps/users/serializers.py +16 -0
- package/templates/base/backend/apps/users/services.py +25 -0
- package/templates/base/backend/apps/users/tests/__init__.py +0 -0
- package/templates/base/backend/apps/users/tests/test_models.py +30 -0
- package/templates/base/backend/apps/users/tests/test_views.py +55 -0
- package/templates/base/backend/apps/users/urls.py +10 -0
- package/templates/base/backend/apps/users/views.py +20 -0
- package/templates/base/backend/config/__init__.py.hbs +5 -0
- package/templates/base/backend/config/asgi.py +9 -0
- package/templates/base/backend/config/settings/__init__.py +0 -0
- package/templates/base/backend/config/settings/base.py.hbs +197 -0
- package/templates/base/backend/config/settings/local.py +31 -0
- package/templates/base/backend/config/settings/production.py.hbs +37 -0
- package/templates/base/backend/config/urls.py.hbs +22 -0
- package/templates/base/backend/config/wsgi.py +9 -0
- package/templates/base/backend/manage.py +23 -0
- package/templates/base/backend/pyproject.toml.hbs +48 -0
- package/templates/base/backend/start.sh +5 -0
- package/templates/base/docker-compose.yml.hbs +196 -0
- package/templates/base/docs/docs/api.md +21 -0
- package/templates/base/docs/docs/dude.md.hbs +305 -0
- package/templates/base/docs/docs/index.md.hbs +92 -0
- package/templates/base/docs/docs/mkdocs.md +231 -0
- package/templates/base/docs/mkdocs.yml.hbs +52 -0
- package/templates/base/e2e/.prettierrc.json +1 -0
- package/templates/base/e2e/_prettierignore +3 -0
- package/templates/base/e2e/cucumber.js +21 -0
- package/templates/base/e2e/eslint.config.mjs +14 -0
- package/templates/base/e2e/features/example.feature +13 -0
- package/templates/base/e2e/package.json.hbs +30 -0
- package/templates/base/e2e/pages/ExamplePage.ts +16 -0
- package/templates/base/e2e/playwright.config.ts +27 -0
- package/templates/base/e2e/steps/common.steps.ts +32 -0
- package/templates/base/e2e/steps/example.steps.ts +4 -0
- package/templates/base/e2e/support/hooks.ts +72 -0
- package/templates/base/e2e/support/world.ts +24 -0
- package/templates/base/e2e/tsconfig.json +22 -0
- package/templates/base/frontend/.prettierrc.json +6 -0
- package/templates/base/frontend/Dockerfile +10 -0
- package/templates/base/frontend/_dockerignore +4 -0
- package/templates/base/frontend/eslint.config.js +32 -0
- package/templates/base/frontend/index.html.hbs +13 -0
- package/templates/base/frontend/package.json.hbs +38 -0
- package/templates/base/frontend/public/favicon.svg +5 -0
- package/templates/base/frontend/src/$components/Layout/$assets/logo.svg +5 -0
- package/templates/base/frontend/src/$components/Layout/constants.tsx +8 -0
- package/templates/base/frontend/src/$components/Layout/index.tsx +80 -0
- package/templates/base/frontend/src/$components/Layout/types.tsx +9 -0
- package/templates/base/frontend/src/$components/index.tsx +1 -0
- package/templates/base/frontend/src/$hooks/index.tsx +2 -0
- package/templates/base/frontend/src/$hooks/useCounterStore/index.tsx +28 -0
- package/templates/base/frontend/src/$hooks/useCounterStore/types.tsx +7 -0
- package/templates/base/frontend/src/$hooks/usePageTitle/index.tsx +21 -0
- package/templates/base/frontend/src/$types/vite-env.d.ts +10 -0
- package/templates/base/frontend/src/App.tsx +36 -0
- package/templates/base/frontend/src/main.tsx +10 -0
- package/templates/base/frontend/src/openapi/utils/openapi.yaml.hbs +129 -0
- package/templates/base/frontend/src/pages/constants.tsx +31 -0
- package/templates/base/frontend/src/pages/index.tsx +192 -0
- package/templates/base/frontend/src/pages/types.tsx +6 -0
- package/templates/base/frontend/src/pages/users/[id]/index.tsx +53 -0
- package/templates/base/frontend/src/pages/users/index.tsx +57 -0
- package/templates/base/frontend/src/pages/users/types.tsx +4 -0
- package/templates/base/frontend/src/styles.module.css +7 -0
- package/templates/base/frontend/src/utils/constants.tsx +11 -0
- package/templates/base/frontend/src/utils/formatters/index.tsx +49 -0
- package/templates/base/frontend/src/utils/functions.tsx +70 -0
- package/templates/base/frontend/src/utils/index.tsx +3 -0
- package/templates/base/frontend/tsconfig.json +24 -0
- package/templates/base/frontend/vite.config.ts +20 -0
- package/templates/base/package.json.hbs +11 -0
- package/templates/base/security/baseline.json +4 -0
- package/templates/celery/backend/apps/core/tasks.py +14 -0
- package/templates/celery/backend/apps/core/tests/test_tasks.py +6 -0
- package/templates/celery/backend/config/celery.py.hbs +26 -0
- package/templates/celerybeat/backend/apps/core/tasks_scheduled.py +18 -0
- package/templates/celerybeat/backend/apps/core/tests/test_tasks_scheduled.py +6 -0
- package/templates/postgres/.dude/commands/reset.ts +83 -0
- package/templates/s3/backend/apps/files/__init__.py +0 -0
- package/templates/s3/backend/apps/files/admin.py +9 -0
- package/templates/s3/backend/apps/files/apps.py +6 -0
- package/templates/s3/backend/apps/files/migrations/0001_initial.py +29 -0
- package/templates/s3/backend/apps/files/migrations/__init__.py +0 -0
- package/templates/s3/backend/apps/files/models.py +21 -0
- package/templates/s3/backend/apps/files/serializers.py +27 -0
- package/templates/s3/backend/apps/files/services.py +19 -0
- package/templates/s3/backend/apps/files/tests/__init__.py +0 -0
- package/templates/s3/backend/apps/files/tests/test_models.py +10 -0
- package/templates/s3/backend/apps/files/tests/test_views.py +32 -0
- package/templates/s3/backend/apps/files/urls.py +10 -0
- package/templates/s3/backend/apps/files/views.py +29 -0
- package/templates/s3/frontend/src/openapi/utils/openapi.yaml.hbs +253 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0.0",
|
|
3
|
+
"tasks": [
|
|
4
|
+
{
|
|
5
|
+
"label": "dude lint (watch)",
|
|
6
|
+
"type": "shell",
|
|
7
|
+
"command": "echo 'Lint started'; dude lint 2>&1; fswatch -r --exclude '\\.git' --exclude 'node_modules' --exclude '__pycache__' --exclude '\\.venv' --exclude '\\.mypy_cache' . | while read -r _; do echo 'Lint started'; dude lint 2>&1; done",
|
|
8
|
+
"options": {
|
|
9
|
+
"cwd": "${workspaceFolder}"
|
|
10
|
+
},
|
|
11
|
+
"isBackground": true,
|
|
12
|
+
"group": {
|
|
13
|
+
"kind": "build",
|
|
14
|
+
"isDefault": true
|
|
15
|
+
},
|
|
16
|
+
"runOptions": {
|
|
17
|
+
"runOn": "folderOpen"
|
|
18
|
+
},
|
|
19
|
+
"presentation": {
|
|
20
|
+
"reveal": "silent",
|
|
21
|
+
"panel": "dedicated",
|
|
22
|
+
"clear": false
|
|
23
|
+
},
|
|
24
|
+
"problemMatcher": {
|
|
25
|
+
"owner": "dude",
|
|
26
|
+
"fileLocation": ["relative", "${workspaceFolder}"],
|
|
27
|
+
"background": {
|
|
28
|
+
"activeOnStart": true,
|
|
29
|
+
"beginsPattern": "^Lint started$",
|
|
30
|
+
"endsPattern": "^(No issues found\\.|(\\d+ errors?(, \\d+ warnings?)?|\\d+ warnings?))$"
|
|
31
|
+
},
|
|
32
|
+
"pattern": {
|
|
33
|
+
"regexp": "^(.+?)\\((\\d+),(\\d+)\\):\\s+(error|warning)\\s+([\\w-]+):\\s+(.+)$",
|
|
34
|
+
"file": 1,
|
|
35
|
+
"line": 2,
|
|
36
|
+
"column": 3,
|
|
37
|
+
"severity": 4,
|
|
38
|
+
"code": 5,
|
|
39
|
+
"message": 6
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
# CLAUDE.md — {{projectName}}
|
|
2
|
+
|
|
3
|
+
This file gives Claude the context it needs to work effectively in this project.
|
|
4
|
+
Read it fully before suggesting changes. Keep it up to date as the project evolves.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## What this project is
|
|
9
|
+
|
|
10
|
+
**{{projectName}}** is a full-stack web application scaffolded by [`dude`](https://github.com/cubocicloide/dude)
|
|
11
|
+
using the `react-django` stack:
|
|
12
|
+
|
|
13
|
+
| Layer | Technology |
|
|
14
|
+
|----------|--------------------------------------------------------|
|
|
15
|
+
| Frontend | React 19, Vite, TypeScript (strict) |
|
|
16
|
+
| Backend | Django 5, Django REST Framework, drf-spectacular, uv |
|
|
17
|
+
{{#if withPostgres}}
|
|
18
|
+
| Database | PostgreSQL (Django migrations) |
|
|
19
|
+
{{else}}
|
|
20
|
+
| Database | SQLite in dev (Django migrations) |
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#if withS3}}
|
|
23
|
+
| Storage | S3 via django-storages/boto3 (MinIO locally) |
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#if withCelery}}
|
|
26
|
+
| Async | Celery + Redis{{#if withCeleryBeat}} + Celery Beat{{/if}} (Flower monitor) |
|
|
27
|
+
{{/if}}
|
|
28
|
+
| Infra | Docker Compose (single `docker-compose.yml`) |
|
|
29
|
+
| Testing | pytest + pytest-django · Playwright + Cucumber (e2e) |
|
|
30
|
+
| Security | Bandit · Semgrep · Trivy (all via Docker) |
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Project layout
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
{{projectName}}/
|
|
38
|
+
├── frontend/ # React + Vite SPA
|
|
39
|
+
│ ├── src/
|
|
40
|
+
│ │ ├── App.tsx
|
|
41
|
+
│ │ ├── main.tsx
|
|
42
|
+
│ │ └── openapi/ # Auto-generated typed API client (never edit by hand)
|
|
43
|
+
│ ├── package.json
|
|
44
|
+
│ └── vite.config.ts
|
|
45
|
+
├── backend/ # Django application (uv-managed)
|
|
46
|
+
│ ├── manage.py
|
|
47
|
+
│ ├── config/ # the Django project
|
|
48
|
+
│ │ ├── settings/ # base.py · local.py (dev) · production.py
|
|
49
|
+
│ │ ├── urls.py # mounts every app under /api/ + drf-spectacular
|
|
50
|
+
{{#if withCelery}}
|
|
51
|
+
│ │ ├── celery.py # Celery app (config_from_object, autodiscover)
|
|
52
|
+
{{/if}}
|
|
53
|
+
│ │ └── wsgi.py / asgi.py
|
|
54
|
+
│ ├── apps/ # one Django app per domain
|
|
55
|
+
│ │ ├── core/ # health endpoint{{#if withCelery}} + example tasks{{/if}}
|
|
56
|
+
│ │ ├── users/ # custom User model (AUTH_USER_MODEL) + read-only API
|
|
57
|
+
{{#if withS3}}
|
|
58
|
+
│ │ ├── files/ # uploads on S3/MinIO, presigned download URLs
|
|
59
|
+
{{/if}}
|
|
60
|
+
│ │ └── <app>/ # models, serializers, services, views, urls, admin,
|
|
61
|
+
│ │ # migrations/, tests/
|
|
62
|
+
│ └── pyproject.toml
|
|
63
|
+
├── e2e/ # End-to-end tests (Playwright + Cucumber.js)
|
|
64
|
+
├── security/
|
|
65
|
+
│ └── baseline.json # Accepted security findings (versioned, commit this)
|
|
66
|
+
├── private/ # Gitignored — ephemeral files (reports, scratch)
|
|
67
|
+
├── docs/ # MkDocs project (served via `dude docs`)
|
|
68
|
+
├── .dude/commands/ # custom `dude` commands (one file = one command)
|
|
69
|
+
{{#if withIac}}
|
|
70
|
+
├── iac/ # Terraform — AWS ECS Fargate (see iac/README.md)
|
|
71
|
+
{{/if}}
|
|
72
|
+
├── dude.json # dude project config (stack identifier + answers)
|
|
73
|
+
├── docker-compose.yml
|
|
74
|
+
└── CLAUDE.md ← you are here
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## dude CLI — all available commands
|
|
80
|
+
|
|
81
|
+
> Run `dude help` for a live, merged overview.
|
|
82
|
+
> Run `dude help <command>` or `dude help <group> <sub>` for flags.
|
|
83
|
+
|
|
84
|
+
> **How `dude` is provided.** The `dude` command comes from the global launcher
|
|
85
|
+
> (`@cubocicloide/dude-launcher`, installed once via `npm i -g`). It resolves the
|
|
86
|
+
> CLI + stack versions **this project pins** in `package.json` (lockfile-enforced)
|
|
87
|
+
> and runs them — so every contributor and CI use identical tooling. `pnpm install`
|
|
88
|
+
> provisions them; the launcher also does it automatically on first run. You can
|
|
89
|
+
> equivalently run `pnpm dude <cmd>` from the project root.
|
|
90
|
+
|
|
91
|
+
### Infrastructure
|
|
92
|
+
|
|
93
|
+
| Command | What it does |
|
|
94
|
+
|---------------------------|---------------------------------------------------------|
|
|
95
|
+
| `dude up` | `docker compose up -d` (start all services) |
|
|
96
|
+
| `dude up --build` | Rebuild images before starting |
|
|
97
|
+
| `dude down` | `docker compose down` (stop + remove containers) |
|
|
98
|
+
| `dude logs [service]` | Follow logs; omit service to follow all |
|
|
99
|
+
| `dude shell <service>` | Interactive shell inside a running container |
|
|
100
|
+
|
|
101
|
+
### Database (Django migrations)
|
|
102
|
+
|
|
103
|
+
| Command | What it does |
|
|
104
|
+
|------------------------------------------------|-------------------------------------------------|
|
|
105
|
+
| `dude db makemigration [--app <a>] [--name <n>]` | Autogenerate migrations from model changes |
|
|
106
|
+
| `dude db migrate` | Apply all pending migrations |
|
|
107
|
+
| `dude db migrate --app <a> --revision <rev>` | Migrate one app to a specific migration |
|
|
108
|
+
| `dude db rollback --app <a> --to <rev>` | Roll one app back (`--to zero` reverts fully) |
|
|
109
|
+
| `dude db superuser` | Create a Django admin account (interactive) |
|
|
110
|
+
|
|
111
|
+
Migrations also run automatically when the backend container boots.
|
|
112
|
+
|
|
113
|
+
### Code quality
|
|
114
|
+
|
|
115
|
+
| Command | What it does |
|
|
116
|
+
|---------------------------|-----------------------------------------------------------------------|
|
|
117
|
+
| `dude lint` | Run all stack structural lint checks (see `.claude/rules/`) |
|
|
118
|
+
| `dude format` | `ruff format` (backend) + `prettier` (frontend) |
|
|
119
|
+
| `dude review` | Run lint + ESLint + API contract review in one pass |
|
|
120
|
+
|
|
121
|
+
### API contract (OpenAPI / drf-spectacular)
|
|
122
|
+
|
|
123
|
+
| Command | What it does |
|
|
124
|
+
|---------------------------|-----------------------------------------------------------------------|
|
|
125
|
+
| `dude api sync` | Fetch the schema from `/api/schema/` → generate the typed client |
|
|
126
|
+
| `dude api review` | Validate `frontend/src/openapi/` against the saved spec |
|
|
127
|
+
|
|
128
|
+
**Workflow**: always run `dude api sync` after changing backend endpoints, then
|
|
129
|
+
commit the updated `frontend/src/openapi/` alongside the change. Swagger UI is
|
|
130
|
+
served at http://localhost:8000/api/docs/.
|
|
131
|
+
|
|
132
|
+
### Testing
|
|
133
|
+
|
|
134
|
+
| Command | What it does |
|
|
135
|
+
|-----------------------------------|----------------------------------------------------|
|
|
136
|
+
| `dude test` | Run all available suites (backend + e2e) |
|
|
137
|
+
| `dude test --backend` | pytest (pytest-django) only |
|
|
138
|
+
| `dude test --e2e` | Playwright + Cucumber only |
|
|
139
|
+
| `dude test --e2e --headed` | E2e in a visible browser window |
|
|
140
|
+
| `dude test --e2e --report` | E2e with HTML + JSON output to `e2e/reports/` |
|
|
141
|
+
|
|
142
|
+
### Security scanning
|
|
143
|
+
|
|
144
|
+
All scanners run inside Docker — no host-level tool installation required.
|
|
145
|
+
New findings cause a non-zero exit; known/accepted findings (baseline) do not.
|
|
146
|
+
|
|
147
|
+
| Command | What it does |
|
|
148
|
+
|--------------------------------------------------|---------------------------------------------------------------|
|
|
149
|
+
| `dude security scan` | Run all scanners; exit 1 if new findings ≥ HIGH |
|
|
150
|
+
| `dude security scan --only bandit,semgrep` | Run a subset of scanners |
|
|
151
|
+
| `dude security scan --min-severity LOW` | Lower the reporting threshold (default: MEDIUM) |
|
|
152
|
+
| `dude security scan --fail-on CRITICAL` | Raise the failure threshold (default: HIGH) |
|
|
153
|
+
| `dude security scan --update-baseline` | Scan + absorb all findings into the baseline |
|
|
154
|
+
| `dude security accept` | Equivalent to `scan --update-baseline`; use after triage |
|
|
155
|
+
| `dude security verify --rule-id B105,CVE-…` | Confirm a specific finding has been fixed |
|
|
156
|
+
| `dude security verify --rule-id B105 --remove-resolved` | Fix confirmed → prune it from the baseline |
|
|
157
|
+
|
|
158
|
+
**Scanners**:
|
|
159
|
+
- `bandit` — Python AST (backend only)
|
|
160
|
+
- `semgrep` — multi-language rules incl. `p/django` (backend + frontend)
|
|
161
|
+
- `trivy-fs` — filesystem: vulns, IaC misconfigs, secrets
|
|
162
|
+
- `trivy-image` — container image CVEs (requires built image)
|
|
163
|
+
|
|
164
|
+
**Baseline workflow**:
|
|
165
|
+
1. `dude security scan` — review new findings
|
|
166
|
+
2. Triage: fix what needs fixing, accept acceptable risks
|
|
167
|
+
3. `dude security accept` — absorbs remaining findings into `security/baseline.json`
|
|
168
|
+
4. `git add security/baseline.json && git commit` — commit the baseline update
|
|
169
|
+
5. Subsequent scans only flag *new* issues not in the baseline
|
|
170
|
+
|
|
171
|
+
### Documentation
|
|
172
|
+
|
|
173
|
+
| Command | What it does |
|
|
174
|
+
|--------------------------|---------------------------------------------------------------------|
|
|
175
|
+
| `dude docs` | Serve `docs/` via MkDocs Material in dev mode at http://localhost:8001 |
|
|
176
|
+
| `dude docs --port 9000` | Same, on a custom port |
|
|
177
|
+
|
|
178
|
+
Docs are live-reload: edit any `.md` file under `docs/docs/` and the browser refreshes automatically.
|
|
179
|
+
{{#if withIac}}
|
|
180
|
+
|
|
181
|
+
### Infrastructure (IaC — AWS ECS Fargate)
|
|
182
|
+
|
|
183
|
+
This project ships Terraform under `iac/` to deploy to AWS ECS Fargate: an ALB
|
|
184
|
+
that path-routes `/api/*`, `/admin/*`, `/django-static/*` to the Django backend
|
|
185
|
+
and everything else to the nginx frontend, two Fargate services, RDS PostgreSQL
|
|
186
|
+
(credentials in Secrets Manager){{#if withS3}}, an S3 media bucket{{/if}}{{#if withRedis}}, ElastiCache Redis{{/if}}{{#if withCelery}}, a Celery worker service{{/if}}{{#if withCeleryBeat}} and a beat service{{/if}}.
|
|
187
|
+
All commands are environment-scoped via `--env` (**required** — no default, to
|
|
188
|
+
avoid acting on the wrong environment). Run any command without `--env` to list
|
|
189
|
+
environments. State lives in S3, so commands run the same locally and in CI.
|
|
190
|
+
See `iac/README.md` for the full workflow.
|
|
191
|
+
|
|
192
|
+
| Command | What it does |
|
|
193
|
+
|-------------------------|---------------------------------------------------------------|
|
|
194
|
+
| `dude iac login` | Configure/verify AWS credentials for an environment |
|
|
195
|
+
| `dude iac bootstrap` | One-time: state backend (S3+DynamoDB) + the two ECR repos |
|
|
196
|
+
| `dude iac new-env --env <name>` | Scaffold a new environment (copies `dev` by default) |
|
|
197
|
+
| `dude iac init` | `terraform init` (configures the S3 backend for the env) |
|
|
198
|
+
| `dude iac plan` | `terraform plan` |
|
|
199
|
+
| `dude iac apply` | Provision/update infrastructure (`--yes` to auto-approve) |
|
|
200
|
+
| `dude iac destroy` | Tear down infrastructure (`--yes` to auto-approve) |
|
|
201
|
+
| `dude iac output` | Show outputs (app URL, ECR URLs, RDS endpoint; `--json`) |
|
|
202
|
+
| `dude iac build/push/deploy` | Build → push → roll the backend + frontend images |
|
|
203
|
+
| `dude iac ship` | build + push + deploy in one step (tag = git short SHA) |
|
|
204
|
+
| `dude iac migrate` | Run `manage.py migrate` as a one-off Fargate task |
|
|
205
|
+
| `dude iac status/logs` | Service state / CloudWatch logs (`--service backend…`) |
|
|
206
|
+
|
|
207
|
+
These commands appear **only** in IaC-enabled projects. Production always runs
|
|
208
|
+
PostgreSQL on RDS regardless of the local database choice.
|
|
209
|
+
{{/if}}
|
|
210
|
+
|
|
211
|
+
### Project-local custom commands
|
|
212
|
+
|
|
213
|
+
This project can define its own `dude` commands under `.dude/commands/`. Each
|
|
214
|
+
file becomes a command named after the file (`reset.ts` → `dude reset`); no
|
|
215
|
+
registration step. They appear in `dude help` under **PROJECT COMMANDS** and
|
|
216
|
+
take precedence over stack commands of the same name (so a `.dude/commands/up.ts`
|
|
217
|
+
overrides the default `dude up`). The core commands `init`, `upgrade`, `version`,
|
|
218
|
+
and `help` are reserved.
|
|
219
|
+
|
|
220
|
+
Commands are loaded with [jiti](https://github.com/unjs/jiti), so they can be
|
|
221
|
+
written in TypeScript and `import` any package added to the project. Use the
|
|
222
|
+
`defineCommand` helper for type-checking:
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
// .dude/commands/reset.ts
|
|
226
|
+
import { defineCommand } from '@cubocicloide/dude'
|
|
227
|
+
|
|
228
|
+
export default defineCommand({
|
|
229
|
+
description: 'Reset the database to a clean state.',
|
|
230
|
+
args: { force: { type: 'boolean', description: 'Skip confirmation.' } },
|
|
231
|
+
async run({ projectRoot, args }) {
|
|
232
|
+
// ...
|
|
233
|
+
},
|
|
234
|
+
})
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
See `.dude/commands/README.md` (shipped with the scaffold) for the full contract.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## Development workflows
|
|
242
|
+
|
|
243
|
+
### Start the stack (Docker)
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
dude up --build # first time (migrations run automatically on boot)
|
|
247
|
+
dude up # subsequent runs
|
|
248
|
+
dude db superuser # optional: admin account for /admin/
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Local development (no Docker)
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Backend (terminal 1)
|
|
255
|
+
cd backend
|
|
256
|
+
uv sync
|
|
257
|
+
uv run python manage.py migrate
|
|
258
|
+
uv run python manage.py runserver # http://localhost:8000
|
|
259
|
+
|
|
260
|
+
# Frontend (terminal 2)
|
|
261
|
+
cd frontend
|
|
262
|
+
pnpm install
|
|
263
|
+
pnpm dev # http://localhost:5173
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### After changing backend endpoints
|
|
267
|
+
|
|
268
|
+
```bash
|
|
269
|
+
dude api sync # regenerate the typed client from /api/schema/
|
|
270
|
+
dude api review # sanity-check the generated output
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### After changing models
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
dude db makemigration --app <app> # generate the migration — always commit it
|
|
277
|
+
dude db migrate
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Tech stack conventions
|
|
283
|
+
|
|
284
|
+
### Backend (`backend/`)
|
|
285
|
+
|
|
286
|
+
- **Language**: Python ≥ 3.13
|
|
287
|
+
- **Package manager / runtime**: `uv` (never use pip directly)
|
|
288
|
+
- **Linter / formatter**: `ruff` — rules `E, F, I, N, UP, B, S, RUF`, line length 100
|
|
289
|
+
- **Tests**: `pytest` + `pytest-django`; each app owns its `tests/` package
|
|
290
|
+
- **Settings**: split modules — `base.py` (shared), `local.py` (dev), `production.py`
|
|
291
|
+
(deployed); selected via `DJANGO_SETTINGS_MODULE`, values via `django-environ`
|
|
292
|
+
|
|
293
|
+
**The app pattern** (enforced by `dude lint` — see `.claude/rules/BE/001–014`):
|
|
294
|
+
|
|
295
|
+
- One Django app per domain under `apps/`, registered in `LOCAL_APPS` (BE001).
|
|
296
|
+
- `serializers.py` — explicit `fields` tuples, never `"__all__"` (BE002).
|
|
297
|
+
- `views.py` — thin orchestration: explicit `permission_classes` (BE003) and
|
|
298
|
+
`serializer_class`/`@extend_schema` (BE013); **no ORM writes** (BE005).
|
|
299
|
+
- `services.py` — all writes/business logic live here, testable without HTTP.
|
|
300
|
+
- `models.py` — `__str__` + `Meta.ordering` (BE009), no `null=True` on text
|
|
301
|
+
fields (BE010), explicit `related_name` (BE011); every change ships a
|
|
302
|
+
committed migration (BE006).
|
|
303
|
+
- `urls.py` — `app_name` + DRF router, mounted under `/api/` in `config/urls.py` (BE008).
|
|
304
|
+
- `tests/` — required for every app (BE014). No raw SQL (BE004), no `print()` (BE012).
|
|
305
|
+
|
|
306
|
+
### Frontend (`frontend/src/`)
|
|
307
|
+
|
|
308
|
+
- **Language**: TypeScript (strict mode)
|
|
309
|
+
- **Framework**: React 19 with function components + hooks
|
|
310
|
+
- **Build tool**: Vite
|
|
311
|
+
- **Package manager**: `pnpm`
|
|
312
|
+
- **Formatter**: `prettier` (run via `dude format`)
|
|
313
|
+
- **Linter**: ESLint with `react-hooks` + `react-refresh` plugins
|
|
314
|
+
- **API client**: `frontend/src/openapi/` — **never edit by hand**, always regenerate via `dude api sync`
|
|
315
|
+
|
|
316
|
+
### Docker Compose
|
|
317
|
+
|
|
318
|
+
- Service names: `frontend`, `backend`{{#if withPostgres}}, `postgres`{{/if}}{{#if withS3}}, `minio`{{/if}}{{#if withRedis}}, `redis`{{/if}}{{#if withCelery}}, `celery_worker`, `flower`{{/if}}{{#if withCeleryBeat}}, `celery_beat`{{/if}} (use these with `dude logs`, `dude shell`)
|
|
319
|
+
- Hot-reload is enabled in development mode for both frontend and backend
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
## Claude AI assistance
|
|
324
|
+
|
|
325
|
+
This project ships a set of Claude skills and agents inside `.claude/`.
|
|
326
|
+
Invoke skills from the Claude chat panel with `/skill-name`.
|
|
327
|
+
|
|
328
|
+
### Skills (slash commands)
|
|
329
|
+
|
|
330
|
+
| Skill | What it does |
|
|
331
|
+
|-------|--------------|
|
|
332
|
+
| `/create` | Guided scaffolding router — asks route or page, then runs the matching flow |
|
|
333
|
+
| `/create-route` | Scaffold a backend API endpoint (DRF view/serializer/service + migration + tests), enforcing the BE rules |
|
|
334
|
+
| `/create-page` | Scaffold a frontend page (React + antd), wire the route, reuse shared components/hooks, enforcing the FE rules |
|
|
335
|
+
| `/security-scan` | Full SAST scan → parallel fix agents per finding → PR + Jira issues |
|
|
336
|
+
| `/verify-security-fixes` | Re-scan, confirm resolved findings, close Jira issues, update baseline |
|
|
337
|
+
| `/fix-issues` | Fetch open Jira issues → route to `issue-fixer` or `security-fixer` agents → PR |
|
|
338
|
+
| `/create-jira-issue` | Guided Jira issue creation with type/priority/labels |
|
|
339
|
+
| `/clean-branches` | Prune merged and stale local/remote branches |
|
|
340
|
+
| `/draft-email` | Draft a professional email from a brief |
|
|
341
|
+
|
|
342
|
+
### Agents (autonomous workers)
|
|
343
|
+
|
|
344
|
+
| Agent | What it does |
|
|
345
|
+
|-------|--------------|
|
|
346
|
+
| `issue-fixer` | Implements a single Jira issue in its own git worktree; opens PR; transitions issue to Done |
|
|
347
|
+
| `security-fixer` | Fixes a single SAST finding in its own worktree; handles suppressions and CVE updates |
|
|
348
|
+
|
|
349
|
+
Agents run in isolated git worktrees (one branch per task) and can operate in
|
|
350
|
+
parallel when orchestrated by `/fix-issues` or `/security-scan`.
|
|
351
|
+
|
|
352
|
+
### Saved config (autodiscovery)
|
|
353
|
+
|
|
354
|
+
Skills read Atlassian/Bitbucket connection details from `.claude/config.json`
|
|
355
|
+
(gitignored). Create it on first use:
|
|
356
|
+
|
|
357
|
+
```json
|
|
358
|
+
{
|
|
359
|
+
"jira": { "projectKey": "PROJ" },
|
|
360
|
+
"bitbucket": { "workspace": "my-org", "repo": "{{projectName}}" }
|
|
361
|
+
}
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## What Claude should NOT do
|
|
367
|
+
|
|
368
|
+
- Edit anything under `frontend/src/openapi/` — it is auto-generated. Run `dude api sync` instead.
|
|
369
|
+
- Edit `security/baseline.json` by hand — use `dude security accept` or `dude security verify --remove-resolved`.
|
|
370
|
+
- Hand-edit committed migration files or regenerate them ad hoc — create a new migration instead.
|
|
371
|
+
- Put ORM writes in `views.py` — they belong in `services.py` (lint BE005 will fail).
|
|
372
|
+
- Add files to `private/` to version control — it is gitignored.
|
|
373
|
+
- Use `pip install` — always `uv add <package>` for backend dependencies.
|
|
374
|
+
- Use `npm` or `yarn` — always `pnpm` for frontend dependencies.
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Key files at a glance
|
|
379
|
+
|
|
380
|
+
| File | Purpose |
|
|
381
|
+
|------|---------|
|
|
382
|
+
| `dude.json` | Identifies the stack (`react-django`) + init answers; required for `dude` commands |
|
|
383
|
+
| `docker-compose.yml` | Service definitions for all environments |
|
|
384
|
+
| `security/baseline.json` | Accepted security findings; commit whenever updated |
|
|
385
|
+
| `backend/pyproject.toml` | Python project metadata, deps, ruff/pytest config |
|
|
386
|
+
| `backend/config/settings/` | Split Django settings (base/local/production) |
|
|
387
|
+
| `frontend/package.json` | JS/TS project metadata and dev scripts |
|
|
388
|
+
| `frontend/src/openapi/` | Auto-generated API client — do not edit |
|
|
389
|
+
| `docs/mkdocs.yml` | MkDocs configuration; edit nav here to add new pages |
|
|
390
|
+
| `docs/docs/` | Markdown source for the documentation site |
|
|
391
|
+
| `CLAUDE.md` | This file — project context for Claude |
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# {{projectName}}
|
|
2
|
+
|
|
3
|
+
Scaffolded with [`dude`](https://github.com/cubocicloide/dude) using the
|
|
4
|
+
`react-django` stack.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
- **Docker Desktop** — running (the whole stack runs in containers).
|
|
11
|
+
- **Node.js ≥ 20** and **pnpm** — to provision the project toolchain.
|
|
12
|
+
|
|
13
|
+
The `dude` CLI and its stack are published on the public npm registry, so no
|
|
14
|
+
registry auth or token is needed to install them.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Getting started
|
|
19
|
+
|
|
20
|
+
The full lifecycle — install the launcher once, scaffold, provision, run:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# 1. Install the dude launcher globally — the ONLY global install.
|
|
24
|
+
# It auto-runs each project's pinned CLI.
|
|
25
|
+
npm install -g @cubocicloide/dude-launcher
|
|
26
|
+
|
|
27
|
+
# 2. Scaffold the project (this is how {{projectName}} was created).
|
|
28
|
+
dude init {{projectName}} --stack react-django
|
|
29
|
+
cd {{projectName}}
|
|
30
|
+
|
|
31
|
+
# 3. Provision the project toolchain — installs the pinned `dude` CLI + stack
|
|
32
|
+
# (and root dev deps) from the lockfile.
|
|
33
|
+
pnpm install
|
|
34
|
+
|
|
35
|
+
# 4. First run — build the images and start every service.
|
|
36
|
+
# Django migrations are applied automatically on boot.
|
|
37
|
+
dude up --build
|
|
38
|
+
|
|
39
|
+
# 5. From the second run onward, just:
|
|
40
|
+
dude up
|
|
41
|
+
|
|
42
|
+
# 6. Optional: create a Django admin account for /admin/.
|
|
43
|
+
dude db superuser
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> **Already have the project?** If you're reading this inside `{{projectName}}`
|
|
47
|
+
> (or you just `git clone`d it), it's already scaffolded — skip step 2 and start
|
|
48
|
+
> at `pnpm install`.
|
|
49
|
+
|
|
50
|
+
> **How `dude` resolves its version.** `dude` on your `PATH` is the *launcher*.
|
|
51
|
+
> On the first `dude <cmd>` inside a project it provisions the versions pinned in
|
|
52
|
+
> `package.json` (running `pnpm install` for you if `node_modules` is missing),
|
|
53
|
+
> then re-execs the project-local CLI. So step 3 is optional — `dude up --build`
|
|
54
|
+
> would trigger it — but running it explicitly makes the first build faster and
|
|
55
|
+
> surfaces any auth problem up front.
|
|
56
|
+
|
|
57
|
+
Once the containers are up, open the URLs below.
|
|
58
|
+
|
|
59
|
+
### Services
|
|
60
|
+
|
|
61
|
+
| Service | URL | Notes |
|
|
62
|
+
|---------|-----|-------|
|
|
63
|
+
| **Frontend** | http://localhost:5173 | React + Vite — HMR active |
|
|
64
|
+
| **API** | http://localhost:8000 | Django REST Framework |
|
|
65
|
+
| **Swagger UI** | http://localhost:8000/api/docs/ | Interactive API explorer (drf-spectacular) |
|
|
66
|
+
| **OpenAPI schema** | http://localhost:8000/api/schema/ | Raw schema (YAML) |
|
|
67
|
+
| **Health** | http://localhost:8000/api/health/ | JSON health check |
|
|
68
|
+
| **Django admin** | http://localhost:8000/admin/ | Create an account with `dude db superuser` |
|
|
69
|
+
{{#if withS3}}
|
|
70
|
+
| **MinIO console** | http://localhost:9001 | Object-storage UI (minioadmin/minioadmin) |
|
|
71
|
+
{{/if}}
|
|
72
|
+
{{#if withCelery}}
|
|
73
|
+
| **Flower** | http://localhost:5555 | Celery task monitor |
|
|
74
|
+
{{/if}}
|
|
75
|
+
|
|
76
|
+
### Documentation site
|
|
77
|
+
|
|
78
|
+
This project ships a full docs site (MkDocs Material). Serve it locally:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
dude docs # → http://localhost:8001
|
|
82
|
+
dude docs --port 9000 # custom port
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
It live-reloads as you edit files under `docs/docs/`. The **Command reference**
|
|
86
|
+
page is auto-generated from your actual commands every time you run `dude docs`.
|
|
87
|
+
|
|
88
|
+
### Hot reload
|
|
89
|
+
|
|
90
|
+
- **Frontend** — Vite HMR is on by default. Edit any file under `frontend/src/`
|
|
91
|
+
and the browser updates instantly without a full page reload.
|
|
92
|
+
- **Backend** — Django's dev server auto-reloads. Edit any Python file under
|
|
93
|
+
`backend/apps/` or `backend/config/` and the API restarts within a second.
|
|
94
|
+
|
|
95
|
+
### Common commands
|
|
96
|
+
|
|
97
|
+
| Command | Description |
|
|
98
|
+
|---------|-------------|
|
|
99
|
+
| `dude up --build` | Rebuild images and start all services |
|
|
100
|
+
| `dude up` | Start all services (detached) |
|
|
101
|
+
| `dude down` | Stop and remove containers |
|
|
102
|
+
| `dude logs [service]` | Follow logs (omit service to follow all) |
|
|
103
|
+
| `dude shell <service>` | Open a shell inside a running container |
|
|
104
|
+
| `dude db makemigration` | Autogenerate Django migrations from model changes |
|
|
105
|
+
| `dude db migrate` | Apply pending migrations |
|
|
106
|
+
| `dude db superuser` | Create a Django admin account |
|
|
107
|
+
| `dude api sync` | Fetch the drf-spectacular schema → regenerate typed client |
|
|
108
|
+
| `dude api review` | Validate generated client against the spec |
|
|
109
|
+
| `dude lint` | Run all stack lint checks |
|
|
110
|
+
| `dude docs` | Serve this documentation (http://localhost:8001) |
|
|
111
|
+
| `dude help` | Live list of every available command |
|
|
112
|
+
| `dude upgrade` | Update pinned CLI and stack versions for this project |
|
|
113
|
+
|
|
114
|
+
Run `dude help` for the full, live catalog (it reflects this project's `dude
|
|
115
|
+
init` choices), or see the **Working with dude** page in the docs site.
|
|
116
|
+
|
|
117
|
+
### Upgrading pinned versions
|
|
118
|
+
|
|
119
|
+
Use `dude upgrade` to update the versions pinned in `package.json` and
|
|
120
|
+
`dude.json`.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
dude upgrade
|
|
124
|
+
dude upgrade --cli --cli-version 0.6.1
|
|
125
|
+
dude upgrade --stack --stack-version 5.0.5
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
This updates version pins only; it does not migrate existing files. Run `pnpm
|
|
129
|
+
install` afterwards. To roll back, pin the previous version again and reinstall:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
dude upgrade --cli --cli-version 0.6.0
|
|
133
|
+
dude upgrade --stack --stack-version 5.0.4
|
|
134
|
+
pnpm install
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Scaffolding another project
|
|
140
|
+
|
|
141
|
+
This project was created with `dude init`. With the launcher installed, you can
|
|
142
|
+
scaffold a new one from anywhere (the launcher delegates `init` to the latest
|
|
143
|
+
published CLI):
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
dude init my-next-app --stack react-django
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Project layout
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
{{projectName}}/
|
|
155
|
+
├── frontend/ # React + Vite + TypeScript
|
|
156
|
+
├── backend/ # Django 5 + DRF (Python 3.13)
|
|
157
|
+
│ ├── config/ # project: settings/ (base|local|production), urls, wsgi
|
|
158
|
+
│ └── apps/ # one Django app per domain
|
|
159
|
+
│ ├── core/ # health endpoint{{#if withCelery}}, example Celery tasks{{/if}}
|
|
160
|
+
│ ├── users/ # custom User model + read-only API
|
|
161
|
+
{{#if withS3}}
|
|
162
|
+
│ ├── files/ # uploads on S3/MinIO (presigned URLs)
|
|
163
|
+
{{/if}}
|
|
164
|
+
│ └── <app>/ # models, serializers, services, views, urls, tests/
|
|
165
|
+
├── e2e/ # Playwright + Cucumber end-to-end suite
|
|
166
|
+
├── docs/ # MkDocs documentation site
|
|
167
|
+
└── docker-compose.yml
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Each app follows the same convention: **serializers list fields explicitly,
|
|
171
|
+
views declare permissions and delegate writes to `services.py`, every model
|
|
172
|
+
change ships its migration, every app ships tests** — enforced by `dude lint`
|
|
173
|
+
(see `.claude/rules/BE/`).
|
|
174
|
+
|
|
175
|
+
## Quick start — local (no Docker)
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Frontend (terminal 1)
|
|
179
|
+
cd frontend
|
|
180
|
+
pnpm install
|
|
181
|
+
pnpm dev # http://localhost:5173
|
|
182
|
+
|
|
183
|
+
# Backend (terminal 2)
|
|
184
|
+
cd backend
|
|
185
|
+
uv sync
|
|
186
|
+
uv run python manage.py migrate
|
|
187
|
+
uv run python manage.py runserver # http://localhost:8000
|
|
188
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Copy this file to .env and adjust as needed.
|
|
2
|
+
# docker-compose reads this file automatically from the project root.
|
|
3
|
+
# For local Vite dev, Vite also reads from this directory (envDir is set to project root).
|
|
4
|
+
|
|
5
|
+
# ── App ───────────────────────────────────────────────────────────────────────
|
|
6
|
+
APP_TITLE={{projectName}}
|
|
7
|
+
DJANGO_DEBUG=true
|
|
8
|
+
DJANGO_SETTINGS_MODULE=config.settings.local
|
|
9
|
+
|
|
10
|
+
# ── Frontend (baked in at Docker build time by Vite) ─────────────────────────
|
|
11
|
+
VITE_APP_TITLE={{projectName}}
|
|
12
|
+
# Set to "true" to enable React Query DevTools in the browser
|
|
13
|
+
VITE_REACT_QUERY_DEVTOOLS=true
|
|
14
|
+
{{#if withPostgres}}
|
|
15
|
+
|
|
16
|
+
# ── Database ──────────────────────────────────────────────────────────────────
|
|
17
|
+
DATABASE_URL=postgres://postgres:postgres@postgres:5432/app
|
|
18
|
+
POSTGRES_USER=postgres
|
|
19
|
+
POSTGRES_PASSWORD=postgres
|
|
20
|
+
POSTGRES_DB=app
|
|
21
|
+
POSTGRES_HOST=postgres
|
|
22
|
+
POSTGRES_PORT=5432
|
|
23
|
+
{{/if}}
|
|
24
|
+
{{#if withS3}}
|
|
25
|
+
|
|
26
|
+
# ── Object storage (MinIO locally, S3 in production) ─────────────────────────
|
|
27
|
+
AWS_ACCESS_KEY_ID=minioadmin
|
|
28
|
+
AWS_SECRET_ACCESS_KEY=minioadmin
|
|
29
|
+
AWS_STORAGE_BUCKET_NAME={{projectName}}-media
|
|
30
|
+
AWS_S3_ENDPOINT_URL=http://minio:9000
|
|
31
|
+
AWS_S3_REGION_NAME=us-east-1
|
|
32
|
+
{{/if}}
|
|
33
|
+
{{#if withRedis}}
|
|
34
|
+
|
|
35
|
+
# ── Redis / Celery ────────────────────────────────────────────────────────────
|
|
36
|
+
REDIS_URL=redis://redis:6379/0
|
|
37
|
+
CELERY_BROKER_URL=redis://redis:6379/0
|
|
38
|
+
CELERY_RESULT_BACKEND=redis://redis:6379/0
|
|
39
|
+
{{/if}}
|