No description
| .gitea/workflows | ||
| cmd/api | ||
| config | ||
| internal | ||
| static | ||
| views | ||
| .env.example | ||
| .gitignore | ||
| dev.sh | ||
| docker-compose.yml | ||
| Dockerfile | ||
| Dockerfile.ci | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
BAI Project
A Go web service following clean architecture patterns with Templ templating.
Quick Start
- Ensure you have Go and Templ installed
- Run
./dev.shto start development with live reload - Access the app at http://localhost:7331 (proxied from :8080)
The dev script automatically:
- Generates Go code from
.templfiles - Restarts the server on file changes
- Reloads your browser automatically
Architecture
- Framework: Fiber
- Templates: Templ
- Dev Tools: Templ's built-in live reload
- Pattern: Clean architecture with dependency injection
Structure
cmd/api/- Application entry pointconfig/- Configuration management via .envinternal/app/- DI containerinternal/controllers/- Business logic orchestrationinternal/handlers/- HTTP request handlersinternal/middleware/- HTTP middlewareinternal/repositories/- Data access layerinternal/services/- Business logic servicesinternal/server/- Fiber server setupviews/- Templ HTML templates
Development
# Start development server with live reload
./dev.sh
# Run tests
go test ./...
# Run linter (if golangci-lint is installed)
golangci-lint run
API Endpoints
GET /api/health- Health checkGET /api/home- Home endpoint (returns "Hello World")