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
- Learn Micronaut Ecosystem: Master HTTP, DI, Data, Security, Messaging, Scheduling
- Build Realistic System: Demonstrate microservice communication and coordination
- Deploy Containerized: Docker, CI/CD, and monitoring best practices
- 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
| Layer | Technology | Rationale |
|---|---|---|
| Framework | Micronaut | Compile-time DI, fast startup, low memory |
| Language | Java 17+ | Modern Java features, wide ecosystem |
| Database | PostgreSQL | Reliable RDBMS, excellent JDBC support |
| Messaging | Kafka | Stream processing, high throughput |
| Authentication | JWT + Micronaut Security | Stateless, secure, flexible |
| Scheduling | Micronaut Scheduling | Lightweight cron-style tasks |
| API Docs | OpenAPI/Swagger | Standard API documentation |
| Monitoring | Prometheus + Grafana | Industry standard observability |
| Deployment | Docker Compose | Orchestration for local/small deployment |
| CI/CD | GitHub Actions | Integrated 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
| Risk | Mitigation |
|---|---|
| Micronaut Learning Curve | Allocate weeks 1-2 for focused learning, use official tutorials |
| Kafka Complexity | Use embedded Kafka for local dev, start with simpler RabbitMQ if needed |
| CSV Parsing | Use Apache Commons CSV or OpenCSV libraries |
| Email Integration | Use MailHog for development, mock SMTP for testing |
| Service Coordination | Docker Compose handles orchestration, explicit service dependencies |
| GraalVM Native | Time-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