Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Expense Tracker API

A backend API for personal expense management, built to demonstrate Clean Architecture, solid backend design, and practical engineering decisions commonly used in production systems.


Project Overview

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.


Technical Stack

  • 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

Core Functionality

  • 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

Analytics & Reporting

  • Monthly expense summaries
  • All-time aggregated spending totals
  • Custom date range analytics with daily breakdowns
  • Server-side aggregation optimized at the database level

Architecture & Engineering Practices

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.

Project Structure

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

Running the Project

Using Docker

docker-compose up -d

Running locally

go mod download
go run cmd/main.go migrate
go run cmd/main.go

API Documentation

Interactive 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

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages