Personal Finance Manager - Microservices Architecture

Personal Finance Manager is an advanced full-stack project demonstrating enterprise-grade microservices architecture. Built with Micronaut, PostgreSQL, Kafka, and Docker, it showcases modern distributed systems design, JWT authentication, scheduled reporting, and comprehensive monitoring.

Last updated:

Overview

The Personal Finance Manager is an advanced learning project demonstrating enterprise-grade microservices architecture. It combines multiple technologies and patterns to create a realistic, production-ready financial management system.

This project is an excellent portfolio piece because it showcases:

  • Deep understanding of microservices patterns
  • Advanced Java/Micronaut knowledge
  • Distributed systems thinking
  • DevOps and containerization
  • Monitoring and observability
  • Complete system design

Project Goals

  1. Learn Micronaut Ecosystem: Master HTTP, DI, Data, Security, Messaging, Scheduling
  2. Build Realistic System: Demonstrate microservice communication and coordination
  3. Deploy Containerized: Docker, CI/CD, and monitoring best practices
  4. Production Quality: High code standards and comprehensive testing

Architecture

Microservices Design

API Gateway
├── User Service
│   ├── Authentication (JWT)
│   ├── User Accounts
│   └── Profiles
├── Account Service
│   ├── Bank Accounts
│   ├── Balance Tracking
│   └── Account Aggregation
├── Transaction Service
│   ├── CRUD Operations
│   ├── Tagging & Categories
│   ├── Event Publishing
│   └── Kafka Integration
├── Import Service
│   ├── CSV File Upload
│   ├── Parsing & Validation
│   ├── Bulk Import
│   └── Error Handling
└── Report Service
    ├── Scheduled Report Generation
    ├── Email Delivery
    ├── PDF Export
    └── Analytics

Supporting Services:
├── PostgreSQL (Data Persistence)
├── Kafka (Event Streaming)
├── Redis (Caching)
├── Prometheus (Metrics)
└── Grafana (Visualization)

Technology Stack

LayerTechnologyRationale
FrameworkMicronautCompile-time DI, fast startup, low memory
LanguageJava 17+Modern Java features, wide ecosystem
DatabasePostgreSQLReliable RDBMS, excellent JDBC support
MessagingKafkaStream processing, high throughput
AuthenticationJWT + Micronaut SecurityStateless, secure, flexible
SchedulingMicronaut SchedulingLightweight cron-style tasks
API DocsOpenAPI/SwaggerStandard API documentation
MonitoringPrometheus + GrafanaIndustry standard observability
DeploymentDocker ComposeOrchestration for local/small deployment
CI/CDGitHub ActionsIntegrated testing and deployment

Key Features

User Management

  • Registration and authentication
  • JWT-based token issuance
  • Role-based access control (RBAC)
  • Password encryption (BCrypt)
  • Account profile customization

Account Management

  • Create, update, delete bank accounts
  • Multi-account support
  • Account aggregation
  • Balance tracking and history
  • Account linking to users

Transaction Tracking

  • Full CRUD operations for transactions
  • Date, amount, description tracking
  • Dynamic tagging and categorization
  • Recurring transaction support
  • Transaction history and search
  • Bulk transaction import

CSV Import

  • File upload handling
  • CSV parsing and validation
  • Preview before import
  • Error reporting and recovery
  • Batch processing
  • Duplicate detection

Reporting

  • Scheduled monthly report generation
  • Multiple export formats (PDF, CSV, JSON)
  • Spending pattern analysis
  • Budget tracking and alerts
  • Email delivery of reports
  • Customizable report templates

Monitoring & Observability

  • Prometheus metrics export
  • Health check endpoints
  • Application performance monitoring
  • Service-to-service tracing
  • Centralized logging
  • Grafana dashboard visualization

Technical Deep Dive

User Service

@Micronaut Service
- JWT Token Generation/Validation
- Password Hashing (BCrypt)
- User Registration
- Authentication Endpoints
- User Profile Management

Transaction Service

@Micronaut Service
- Event-Driven Architecture
- Kafka Producer/Consumer
- Transaction Lifecycle Management
- Category and Tag Support
- Search and Filtering
- Async Processing

Report Service

@Scheduled Tasks
- Monthly Report Generation
- PDF Generation (iText/PdfBox)
- Email Templating (Thymeleaf)
- Export to Multiple Formats
- Analytics Computation

API Gateway

  • Request routing and aggregation
  • Authentication middleware
  • Rate limiting
  • Request/response transformation
  • Load balancing (if needed)

Database Schema

Core Tables

  • users: User accounts and authentication
  • bank_accounts: User bank accounts
  • transactions: Financial transactions
  • categories: Transaction categories
  • tags: Transaction tags
  • reports: Generated reports metadata
  • audit_log: System audit trail

Relationships

  • Users → Bank Accounts (1:N)
  • Users → Transactions (1:N)
  • Bank Accounts → Transactions (1:N)
  • Transactions → Categories (N:N)
  • Transactions → Tags (N:N)

Development Roadmap

Phase 1: Foundation (Weeks 1-2, ~20 hours)

  • Micronaut fundamentals
  • Project setup and build configuration
  • Database schema design
  • User service implementation
  • Authentication middleware

Phase 2: Core Services (Weeks 3-4, ~35 hours)

  • Account service development
  • Transaction service with Kafka integration
  • CSV import service
  • Database operations and ORM setup
  • API endpoint development

Phase 3: Advanced Features (Week 5, ~15 hours)

  • Report generation and scheduling
  • Email integration (SMTP)
  • PDF export functionality
  • Batch processing for imports

Phase 4: Operations & Deployment (Week 6, ~20 hours)

  • Docker image creation
  • Docker Compose orchestration
  • Prometheus metrics integration
  • Grafana dashboard creation
  • GitHub Actions CI/CD pipeline
  • API documentation (Swagger)

Total Estimated Effort: 80-100 hours over 6 weeks

Skills Demonstrated

Micronaut Framework

  • Dependency injection and beans
  • HTTP client and server
  • Data persistence with Micronaut Data
  • Security with JWT
  • Scheduled tasks
  • Configuration management
  • Health checks and metrics

Java Development

  • Modern Java 17+ features
  • Functional programming patterns
  • Exception handling
  • Testing (JUnit 5, Mockito)
  • Build tools (Gradle/Maven)

Distributed Systems

  • Microservices architecture
  • Event-driven systems
  • Kafka messaging
  • Service-to-service communication
  • Eventual consistency patterns

Database Design

  • Relational schema design
  • Normalization and optimization
  • JDBC and ORM usage
  • Migration management
  • Query optimization

DevOps & Deployment

  • Docker containerization
  • Docker Compose orchestration
  • GitHub Actions CI/CD
  • Container networking
  • Volume management

Monitoring & Observability

  • Prometheus metrics
  • Grafana dashboarding
  • Application health checks
  • Performance monitoring
  • Log aggregation

API Design

  • RESTful principles
  • OpenAPI/Swagger documentation
  • Error handling and status codes
  • Versioning strategies
  • API security

Risk Mitigation

RiskMitigation
Micronaut Learning CurveAllocate weeks 1-2 for focused learning, use official tutorials
Kafka ComplexityUse embedded Kafka for local dev, start with simpler RabbitMQ if needed
CSV ParsingUse Apache Commons CSV or OpenCSV libraries
Email IntegrationUse MailHog for development, mock SMTP for testing
Service CoordinationDocker Compose handles orchestration, explicit service dependencies
GraalVM NativeTime-box exploration, not critical for MVP

Deployment Strategy

Local Development

  • Docker Compose with all services
  • Embedded database for quick iteration
  • Mock external services

Production-Ready Deployment

  • Containerized services on Kubernetes (future)
  • External PostgreSQL cluster
  • Kafka cluster for high throughput
  • Prometheus/Grafana monitoring stack
  • Load balancing and auto-scaling

Monitoring Stack

Application Metrics
    ↓
Prometheus (Scraping)
    ↓
Grafana (Visualization)
    ↓
Alerting (Slack/Email)

Success Criteria

  • ✅ All microservices functional and tested
  • ✅ Complete API documentation (OpenAPI)
  • ✅ Docker Compose deployment working
  • ✅ CI/CD pipeline green (tests passing)
  • ✅ Monitoring dashboard showing metrics
  • ✅ Scheduled reports generating correctly
  • ✅ User authentication and authorization working
  • ✅ Comprehensive error handling
  • ✅ Production-quality code with tests

Current Status

📋 Planned / Ready to Start

All requirements documented in Software Requirements Document (SRD). Estimated completion: 6 weeks with consistent development.

This project is an excellent demonstration of:

  • Enterprise-grade architecture design
  • Microservices mastery
  • DevOps capabilities
  • Modern Java development
  • Complete system thinking

Stretch Goals

  • Native Image builds with GraalVM
  • GraphQL API endpoint
  • Mobile-friendly React frontend
  • OAuth2 integration (GitHub/Google)
  • Kubernetes deployment with Helm
  • Advanced ML-based spending predictions
  • Real-time transaction processing
  • Multi-currency support
  • Tax report generation