Files

20 lines
858 B
Markdown
Raw Permalink Normal View History

2026-04-09 10:01:23 +08:00
# AGENTS.md
This repository contains the Agent Desk backend only.
- Stack: Go + Gin + GORM + `github.com/mlogclub/simple`
- Database compatibility: SQLite and MySQL must remain supported; PostgreSQL is also supported.
- Layer direction: models -> repositories -> services -> handlers.
- Handlers must not call repositories directly or return GORM models.
- Services own business rules and transaction boundaries.
- Repositories own data access and accept `db *gorm.DB` consistently.
- Use request/response DTOs and the common `httpx.WriteJSON` response wrapper.
- Use `log/slog` for logging and `any` instead of `interface{}` in new code.
- Run `gofmt` and `go test ./...` after backend changes.
The sibling frontend project is normally `../agent-desk-web`. Shared frontend enums are generated with:
```bash
make enums FRONTEND_DIR=../agent-desk-web
2026-04-09 10:01:23 +08:00
```