Skip to content

DigitLock/expense-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Expense Tracker

Personal and family finance management system with multi-currency support and automatic balance calculation.

🎯 Project Status

  • βœ… Business Requirements - Complete
  • βœ… System Requirements - Complete
  • βœ… Database Schema - Complete (7 tables, production-ready)
  • βœ… Backend API - Complete (23 REST endpoints with JWT auth)
  • βœ… OpenAPI Documentation - Complete (Swagger UI available)
  • βœ… Frontend MVP - Complete (Full CRUD for Accounts, Categories, Transactions)
  • πŸ§ͺ Testing & QA - In Progress (Stage 5)

✨ Features

  • πŸ’° Multi-currency support (RSD/EUR/USD with automatic conversion)
  • 🏦 Multiple account types (cash, bank, credit, savings, investment)
  • 🏷️ Hierarchical categories (parent-child structure for income/expense)
  • πŸ“Š Automatic balance calculation via database triggers
  • πŸ‘₯ Multi-user families with data isolation
  • πŸ” JWT authentication with family-based access control
  • πŸ“ˆ Transaction management with filters and pagination
  • πŸ“Š Financial dashboard with monthly summary
  • πŸ“± Responsive UI built with Vue.js 3 and Tailwind CSS
  • πŸ” Advanced filtering by type, account, date range
  • πŸ“„ Pagination for large transaction lists

πŸ—οΈ Tech Stack

Backend

  • Language: Go 1.23+
  • Router: Chi v5
  • Database: PostgreSQL 16
  • Query Builder: sqlc (type-safe SQL)
  • Authentication: JWT tokens
  • API Docs: Swagger/OpenAPI 2.0

Frontend

  • Framework: Vue.js 3 (Composition API)
  • Styling: Tailwind CSS
  • Form Validation: VeeValidate + Zod
  • State Management: Pinia
  • HTTP Client: Axios
  • Build Tool: Vite
  • UI Components: Custom component library

πŸ“š Documentation

Business & System Requirements

Located in Documentation/:

API Documentation

Interactive Swagger UI: Available at /swagger/index.html when running the server

  • OpenAPI 2.0 specification with full endpoint documentation
  • Request/Response examples for all 23 endpoints
  • Try it out functionality for testing endpoints directly
  • Schema definitions for all DTOs
  • Authentication flow documentation

Generated specification files in Documentation/swagger/:

  • swagger.json - OpenAPI specification (machine-readable)
  • swagger.yaml - OpenAPI specification (human-readable)
  • docs.go - Embedded Go documentation

πŸ—„οΈ Database Schema

Production-ready PostgreSQL schema with:

  • 7 core tables: families, users, accounts, categories, transactions, exchange_rates, audit_log
  • 5 triggers: automatic timestamp updates, balance calculation, audit logging
  • 4 functions: balance recalculation, exchange rate lookup, audit trail
  • 40+ indexes: optimized for common query patterns
  • Complete rollback migrations: every migration has a corresponding drop script

See database/migrations/README.md for details.

Quick Start (Database)

# Apply all migrations (in order):
001 create families table.sql
002 create users table.sql
003 create accounts table.sql
004 create categories table.sql
005 create transactions table.sql
006 create exchange rates table.sql
007 create audit log table.sql

# Load demo data:
009 demo seed data.sql

Demo credentials:

  • Email: demo@example.com
  • Password: Demo123!

πŸš€ API Endpoints

The REST API includes 23 endpoints across 6 categories:

Authentication

  • POST /api/v1/auth/login - User login with JWT

Health

  • GET /health - Health check
  • GET /ready - Readiness probe

Accounts

  • GET /api/v1/accounts - List all accounts
  • POST /api/v1/accounts - Create account
  • GET /api/v1/accounts/{id} - Get account details
  • PATCH /api/v1/accounts/{id} - Update account
  • DELETE /api/v1/accounts/{id} - Delete account
  • GET /api/v1/accounts/{id}/balance - Get account balance

Categories

  • GET /api/v1/categories - List all categories
  • POST /api/v1/categories - Create category
  • GET /api/v1/categories/{id} - Get category details
  • PATCH /api/v1/categories/{id} - Update category
  • DELETE /api/v1/categories/{id} - Delete category

Transactions

  • GET /api/v1/transactions - List transactions (with filters & pagination)
  • POST /api/v1/transactions - Create transaction
  • GET /api/v1/transactions/{id} - Get transaction details
  • PATCH /api/v1/transactions/{id} - Update transaction
  • DELETE /api/v1/transactions/{id} - Delete transaction

Reports

  • GET /api/v1/reports/spending-by-category - Spending analysis
  • GET /api/v1/reports/monthly-summary - Monthly financial summary

Currencies

  • GET /api/v1/currencies/rates - Get exchange rates
  • GET /api/v1/currencies/convert - Convert currency

πŸ“š Full documentation with examples: Visit /swagger/index.html after starting the server

🎨 Demo

⚠️ Demo Environment Status: QA Testing in progress

Testing environment: https://api.test.expensetracker.digitlock.systems

Note: The application is currently undergoing quality assurance testing. Minor bugs and UI improvements are being addressed.

πŸ“‹ Project Structure

expense-tracker/
β”œβ”€β”€ Documentation/          # Business and system requirements
β”‚   β”œβ”€β”€ expense_tracker_brd.md
β”‚   β”œβ”€β”€ expense_tracker_srs_mvp.md
β”‚   β”œβ”€β”€ swagger/           # OpenAPI documentation
β”‚   β”‚   β”œβ”€β”€ docs.go        # Generated Swagger docs
β”‚   β”‚   β”œβ”€β”€ swagger.json   # OpenAPI 2.0 spec
β”‚   β”‚   └── swagger.yaml   # OpenAPI 2.0 spec (YAML)
β”‚   └── *_SUMMARY.md       # Development stage summaries
β”œβ”€β”€ database/
β”‚   └── migrations/        # SQL migration files
β”œβ”€β”€ cmd/
β”‚   └── server/           # Application entry point
β”œβ”€β”€ internal/
β”‚   β”œβ”€β”€ api/              # HTTP handlers and routing
β”‚   β”‚   β”œβ”€β”€ handlers/     # Request handlers (with Swagger annotations)
β”‚   β”‚   └── middleware/   # Auth, logging, recovery
β”‚   β”œβ”€β”€ auth/             # JWT service
β”‚   β”œβ”€β”€ config/           # Configuration management
β”‚   β”œβ”€β”€ database/         # Database layer
β”‚   β”‚   β”œβ”€β”€ queries/      # SQL queries for sqlc
β”‚   β”‚   └── sqlc/         # Generated type-safe code
β”‚   β”œβ”€β”€ dto/              # Data transfer objects (with Swagger tags)
β”‚   └── repository/       # Business logic layer
β”œβ”€β”€ frontend/             # Vue.js 3 application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ api/         # API client
β”‚   β”‚   β”œβ”€β”€ components/  # Reusable components
β”‚   β”‚   β”‚   β”œβ”€β”€ forms/   # Form components
β”‚   β”‚   β”‚   β”œβ”€β”€ modals/  # Modal dialogs
β”‚   β”‚   β”‚   └── ui/      # Base UI components
β”‚   β”‚   β”œβ”€β”€ composables/ # Vue composables
β”‚   β”‚   β”œβ”€β”€ router/      # Vue Router config
β”‚   β”‚   β”œβ”€β”€ schemas/     # Zod validation schemas
β”‚   β”‚   β”œβ”€β”€ stores/      # Pinia stores
β”‚   β”‚   β”œβ”€β”€ types/       # TypeScript types
β”‚   β”‚   └── views/       # Page components
β”‚   β”œβ”€β”€ public/
β”‚   └── package.json
β”œβ”€β”€ .env                  # Environment variables
β”œβ”€β”€ go.mod               # Go module definition
└── sqlc.yaml            # sqlc configuration

πŸš€ Roadmap

Phase 1: Database Foundation βœ…

  • Schema design
  • Migration scripts
  • Automatic balance calculation
  • Audit logging
  • Demo seed data

Phase 2: Backend API βœ…

  • Database package (Go + sqlc)
  • REST API endpoints (23 endpoints)
  • JWT authentication
  • Business logic layer
  • Input validation
  • CORS configuration
  • Family-based data isolation

Phase 3: Documentation βœ…

  • OpenAPI/Swagger specification
  • Interactive API documentation (Swagger UI)
  • Request/Response examples
  • Authentication flow documentation
  • Postman collection export

Phase 4: Frontend βœ…

  • Vue.js 3 setup with Vite
  • API client with Axios
  • Authentication UI (Login)
  • Dashboard with financial summary
  • Accounts management (full CRUD)
  • Categories management (full CRUD with hierarchy)
  • Transactions management (full CRUD with filters)
  • Form validation with VeeValidate + Zod
  • Responsive design with Tailwind CSS
  • Reusable component library

Phase 5: Testing & QA πŸ§ͺ

  • Manual testing (in progress)
  • Bug fixes and improvements
  • Unit tests (backend)
  • Integration tests
  • E2E tests (frontend)
  • Performance optimization
  • Security audit

Phase 6: Deployment πŸ“‹

  • Docker containerization
  • CI/CD pipeline
  • Production deployment
  • Monitoring and logging
  • Backup strategy

πŸ“„ License

This project is licensed under the MIT License.
See the LICENSE file for details.

πŸ‘€ Author

Igor Kudinov

This project is part of my professional portfolio demonstrating:

  • Requirements analysis and documentation
  • Database design and implementation
  • Backend development (Go)
  • REST API design
  • OpenAPI/Swagger documentation
  • Type-safe code generation (sqlc)
  • Frontend development (Vue.js 3)
  • Full-stack application architecture
  • DevOps and deployment

πŸ”— Links

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published