A backend API for personal expense management, built to demonstrate Clean Architecture, solid backend design, and practical engineering decisions commonly used in production systems.
Expense Tracker API provides a robust backend for managing personal finances. The system allows users to:
- record and manage expenses,
- organize spending by categories,
- analyze expenses using aggregated statistics over monthly or custom time ranges.
The primary focus of this project is not only functionality, but also code structure, maintainability, and correctness, reflecting real-world backend development requirements.
- Language: Go 1.21+
- HTTP Framework: Gin
- ORM: GORM
- Database: PostgreSQL
- Authentication & Authorization: JWT
- Logging: Zap (structured, leveled logging)
- API Documentation: Swagger / OpenAPI
- Containerization: Docker & Docker Compose
- Testing: Go testing tools with unit test coverage
- Secure JWT-based authentication and role-aware authorization
- Full CRUD lifecycle for expense entities
- Category-based expense classification
- Pagination and filtering for efficient data access
- Request validation with consistent, structured error responses
- Monthly expense summaries
- All-time aggregated spending totals
- Custom date range analytics with daily breakdowns
- Server-side aggregation optimized at the database level
The application is structured according to Clean Architecture principles:
- Handler layer — HTTP request handling, validation, and response mapping
- Service layer — business rules, use cases, and orchestration logic
- Repository layer — database abstraction and query implementation
This design:
- decouples business logic from infrastructure concerns,
- improves testability and readability,
- allows easy replacement of frameworks or persistence layers.
Additional engineering highlights:
- custom domain-level error types with proper HTTP status mapping,
- centralized configuration management,
- database migrations for schema version control,
- structured logging for observability and debugging,
- unit tests focused on core business logic rather than transport details.
cmd/ – application entry point
internal/
handler/ – HTTP handlers (presentation layer)
service/ – business logic (use cases)
repository/ – data access layer
model/ – domain models
middleware/ – authentication, logging
migrations/ – database schema migrations
docs/ – Swagger / OpenAPI specification
Using Docker
docker-compose up -dRunning locally
go mod download
go run cmd/main.go migrate
go run cmd/main.goInteractive Swagger UI is available at:
http://localhost:8080/swagger/index.html
This project was built as part of my professional portfolio to demonstrate backend engineering skills with Go, with a strong emphasis on architecture, clean code, and production readiness.
Best regards, Mykola