Backend Development
Go backend development guide.
Sections
| Topic | Description |
|---|---|
| Project Structure | Directory organization |
| Models | Go struct patterns for database entities |
| DTOs | Request/Response data transfer objects |
| Handlers & Services | HTTP handlers and business logic |
| Authentication | Session authentication middleware |
| Migrations | Database migration scripts |
Key Patterns
Domain Module Structure
Each domain follows a consistent 6-file pattern:
internal/domain/{name}/
├── model.go # Database entity structs
├── dto.go # Request/Response DTOs with validation
├── repository.go # Data access layer (SQL queries)
├── service.go # Business logic layer
├── handler.go # HTTP request handlers
└── routes.go # Route registrationQuick Reference
Each domain follows a consistent 6-file pattern documented in the sections below.