1.9 KiB
1.9 KiB
Repository Guidelines
Project Structure & Module Organization
backend/: Go API server (Fiber) + services + DB models/migrations.backend/app/http/: HTTP modules (e.g.super/,tenant/,tenant_public/).backend/app/services/: business logic; prefer GORM-Gen queries (backend/database/models/*).backend/database/migrations/: SQL migrations.backend/docs/: generated Swagger (swagger.json/yaml,docs.go).
frontend/:frontend/superadmin/: platform super admin UI (Vite + Vue 3 + PrimeVue).frontend/admin/,frontend/user/: tenant admin/user apps.
specs/: source-of-truth specs (e.g. DB schema).
Coding Style & Naming Conventions
- Backend rule of law: all backend development MUST follow
backend/llm.txt(HTTP/module layout, generated-file rules, GORM-Gen usage, transactions, comments, and route conventions). - Go: run
gofmton changed files; keep HTTP handlers thin (bind →services.*→ return). - HTTP module directories are
snake_case; path params arecamelCaseand prefer typed IDs like:orderID<int>to avoid route conflicts. - Avoid editing generated files (e.g.
backend/app/http/**/routes.gen.go,backend/docs/docs.go); regenerate viaatomctlinstead.
Testing Guidelines
- Go tests:
go test ./...(some service tests exist underbackend/app/services/*_test.go). - Frontend: build + lint are the main checks (
npm -C frontend/superadmin run build && npm -C frontend/superadmin run lint).
Commit & Pull Request Guidelines
- Commits generally follow a simple convention like
feat: .../fix: .../chore: ...(keep subject short and imperative). - PRs: describe behavior change, list impacted APIs/pages, and include screenshots for UI changes (especially
frontend/superadmin/).
Security & Configuration Tips
- Configure API base via
VITE_API_BASE_URL(superadmin). - Keep secrets out of git; prefer local
backend/config.tomloverrides for DB/JWT settings.