Template Conventions
The heart of the scaffold is the templates/ directory: the files inside it are exactly what users end up with. Modifying a template is the same as modifying a generated project.
Each Stack Keeps Its Own Conventions
Section titled “Each Stack Keeps Its Own Conventions”The directory organization of different stacks is deliberately not unified, and instead follows each language’s community conventions:
| Template | Organization |
|---|---|
backend-python/ |
Domain-modular: app/core/ (infrastructure) + one package per business domain (auth/, user/, role/, permission/, menu/, …), each containing models.py / schemas.py / crud.py / router.py |
backend-java/ |
Layered: controller/, service/, repository/, entity/, dto/, plus common/, config/, security/ |
frontend-react/ and frontend-vue/ |
Feature-based: pages under pages/settings/<Domain>/, APIs split by domain under api/, types split by domain under types/ |
Naming and Copy
Section titled “Naming and Copy”- Frontend and backend UI copy uniformly uses Chinese.
- API responses are fixed as
{ code: 0, message: "success", data }, withcode: -1for errors. - TS/JS variables use
camelCase, and components usePascalCase. - Python Pydantic schema fields use
camelCase(such asroleId), and ORM fields usesnake_case(such asrole_id).
Shared Infrastructure
Section titled “Shared Infrastructure”- Python’s
ApiResponse/PaginatedDatalive inapp/core/schemas.py. - The permission code catalog is the single source of truth: Python
app/core/permissions_catalog.py, Javaconfig/PermissionCatalog.java. - Menu presentation is separate from authorization:
permissionshandles authorization, whilemenu_groups/menu_itemsown groups, routes, icons, and order. - Menu permissions must be created through menu management; built-in items cannot be deleted, and deleting a custom item must also remove role grants.
- Export archives use
manifest.json + schema.sql + checksums.sha256 + data/*.jsonl, support only same-backend/same-version restore, and excludeapp_state. - The frontend HTTP layer is a lightweight fetch wrapper (
api/client.ts); do not introduce axios. - The fetch wrapper must support binary downloads,
FormDatauploads, and custom status headers instead of assuming every response is JSON.