Agents
Repository Overview
Project Context
- Language: Go 1.25+
- Frameworks: Labstack Echo
- Primary database: MariaDB 12.1+
Project Structure
bin/: Service binariescmd/: Main files for the servicesdatabase/: SQL queries for database schema and fixturesinternal/: Core codetemplates/: HTML templatesvar/: Runtime generated code such as logs and Docker volumes
Development Workflow
- Linting: Always run
go fmt ./...before suggesting code. - Dependencies: Use
go mod tidyafter adding new imports. - Testing: Use standard
go test -v -cover -coverprofile=coverage.out ./.... Prefer table-driven tests. - Make: Use GNU Make and commands in makefile for workflow automation.
Coding Standards
- Naming:
- Use camelCase for internal and PascalCase for exported members. Follow Go acronym rules (e.g.,
JSONData, notJsonData). - Use
CreateXxxfor constructor functions - Repositories:
FindBy*: Find single entity by somethingFindManyBy*: Find many entities by somethingSave: Persist entity (create or update)Create(entity *Entity) error: Persist new entity in the databaseUpdate(entity *Entity) error: Persist existing entity in the databaseFind(id uuid.UUID) (*Entity, Error): Find single entity by ID
- REST API Handlers:
- GET for multiple entities assigned endpoint
/resourcesand function nameindex - GET for sinle entity assigned endpoint
/resources/{:id}and function nameshow - POST for creation assigned endpoint
/resourcesand function namecreate - PUT for ammendment assigned endpoint
/resources/{:id}and function nameupdate - DELETE assigned endpoint
/resources/{:id}and function namedestroy
- GET for multiple entities assigned endpoint
- Use camelCase for internal and PascalCase for exported members. Follow Go acronym rules (e.g.,
Agent Instructions
- When writing tests, place them in
_test.gofiles in the same package.