Skip to content

Improvement Roadmap

3-Phase Implementation Plan

Phase 1: Foundation Refactoring (2-3 Days)

Goal: Establish clean patterns before adding new features
Effort: 14 story points
Owner: Backend team

Tasks

  1. Split main.py into APIRouter modules
  2. Create routers/assets.py (asset endpoints)
  3. Create routers/transactions.py (transaction endpoints)
  4. Create routers/settings.py (configuration)
  5. Create routers/ai.py (AI analysis)
  6. Create routers/health.py (health checks)
  7. Update main.py to import routers
  8. Effort: 4 hours

  9. Fix endpoint ordering dependency

  10. Add explicit parameter validation using Pydantic
  11. Use APIRouter with clear route patterns
  12. Add tests to catch ordering regressions
  13. Effort: 1 hour

  14. Add API versioning (/api/v1/)

  15. Create APIRouter with /api/v1 prefix
  16. Import all routers under v1_router
  17. Document deprecation path
  18. Effort: 1 hour

  19. Add Pydantic request/response models

  20. Define models for all endpoint inputs/outputs
  21. Add OpenAPI documentation
  22. Effort: 3 hours

  23. Implement error handling middleware

  24. Standardize error response format
  25. Add error codes
  26. Effort: 1 hour

  27. Add comprehensive tests

  28. Transaction encryption roundtrips
  29. Blind index functionality
  30. Endpoint error cases
  31. Effort: 3 hours

Deliverables: - ✅ Clean APIRouter structure - ✅ No endpoint ordering issues - ✅ API versioning ready - ✅ Type-safe endpoints - ✅ 80%+ test coverage on critical paths


Phase 2: Operations & Security (3-4 Days, Parallel with Phase 3)

Goal: Production-readiness improvements
Effort: 12 story points
Owner: DevOps/Backend team

Tasks

  1. Encryption key versioning
  2. Add key_version column to Transaction table
  3. Implement key rotation script
  4. Add rotation documentation
  5. Effort: 3 hours

  6. Feature flags system

  7. Add feature_flags table
  8. Implement flag evaluation middleware
  9. Effort: 2 hours

  10. Structured request logging

  11. Add JSON-formatted logging
  12. Include request ID, timing, user
  13. Effort: 1 hour

  14. Security documentation

  15. Create SECURITY.md threat model
  16. Document key rotation procedure
  17. Effort: 2 hours

  18. Database optimization

  19. Add indexes on common queries
  20. Document query plans
  21. Effort: 1 hour

Deliverables: - ✅ Key rotation capability - ✅ Feature flags infrastructure - ✅ Structured logging - ✅ Security documentation - ✅ Optimized database queries


Phase 3: New Features (2-3 Weeks, Parallel with Phase 2)

Goal: Implement FinTS and Budget features
Uses: Clean patterns from Phase 1

Task 3A: FinTS Integration (Issue #11, ~18 todos)

Timeline: Week 1-1.5

  1. Database & Backend Setup (3 todos)
  2. Create BankConnection model
  3. Add fints library dependency
  4. Create hbci_parser.py module

  5. Backend Endpoints (4 todos)

  6. routers/bank_connections.py (CRUD)
  7. POST /api/v1/transactions/import/fints/{bank_connection_id}

  8. Frontend UI (5 todos)

  9. Settings section for bank accounts
  10. Connection form modal
  11. Import workflow UI

  12. Testing (4 todos)

  13. Parser unit tests
  14. Endpoint integration tests
  15. Deduplication verification

  16. Documentation (2 todos)

  17. README section
  18. .env.example updates

Deliverables: - ✅ FinTS bank import working - ✅ Multiple account support - ✅ 90-day default fetch - ✅ PIN never stored - ✅ Full test coverage

Task 3B: Google Sheets Budget (Issue #12, ~24 todos)

Timeline: Week 1.5-3

Dependency: DB-driven transaction categories (Phase 2, Task 2)

  1. Database & Backend Setup (4 todos)
  2. Create BudgetPlan model
  3. Create transaction_category table
  4. Create sheets_parser.py
  5. Category mapping logic

  6. Backend Endpoints (4 todos)

  7. routers/budgets.py
  8. Budget CRUD endpoints
  9. Comparison endpoint with filters

  10. Data Logic (4 todos)

  11. Expense aggregation
  12. Variance calculation
  13. Multi-person filtering
  14. Monthly vs. YTD logic

  15. Frontend UI (7 todos)

  16. Settings section (URL input)
  17. Comparison page
  18. Comparison table component
  19. Filters and toggles
  20. Optional charts

  21. Testing (5 todos)

  22. Parser tests
  23. Mapping logic tests
  24. Variance calculation tests
  25. Endpoint tests
  26. Filter logic tests

  27. Documentation (2 todos)

  28. README section
  29. Google Sheets setup guide

Deliverables: - ✅ Budget comparison working - ✅ Multi-person responsibility tracking - ✅ Monthly and YTD views - ✅ Variance calculations - ✅ Full test coverage


Priority Matrix

Impact
  ▲
  │ [HIGH]              [CRITICAL]
  │
  │ Structured logging  Monolithic main.py
  │ Feature flags       Endpoint ordering
  │ Rate limiting       Encryption versioning
  │                     Theme consistency
  │ [MEDIUM]            [HIGH]
  │ Test coverage       API versioning
  │ Error handling      Hardcoded categories
  │                     Polling backoff
  └─────────────────────────────────────► Effort
    Low        Medium         High

Implementation Estimates

Phase Component Story Points Days Effort
1 Refactor main.py 4 1 High
1 Fix endpoint ordering 1 0.5 Low
1 API versioning 1 0.5 Low
1 Validation models 3 1.5 Medium
1 Error handling 1 0.5 Low
1 Testing 4 2 High
Phase 1 Total 14 6 (2-3 days)
2 Key versioning 3 1.5 Medium
2 Feature flags 2 1 Low
2 Structured logging 1 0.5 Low
2 Security docs 2 1 Low
2 DB optimization 1 0.5 Low
Phase 2 Total 9 4.5 (3-4 days)
3A FinTS integration 18 8 High
3B Budget comparison 24 12 High
Phase 3 Total 42 20 (2-3 weeks)
Grand Total 65 30.5 (4-5 weeks)

Quick Wins (Can Do First)

Low effort, high impact — do ASAP:

  1. Fix endpoint ordering (1 hour)
  2. Add parameter validation
  3. Prevents production bugs

  4. Add API versioning (1 hour)

  5. Just change endpoint prefix
  6. Enables future API changes safely

  7. Implement error handling middleware (1-2 hours)

  8. Standardize responses
  9. Better debugging

  10. Add structured logging (1 hour)

  11. JSON format
  12. Better monitoring

Total: 4-5 hours, enables safer development.


Future Enhancements

Beyond Phase 3

  • WebSocket real-time updates (replace polling)
  • Mobile app (reuse /api/v1 endpoints)
  • Data export (CSV, JSON)
  • Multi-user households
  • Recurring transactions
  • Tax reporting
  • Investment analytics
  • Alerts and notifications

Start with Phase 1. Enables cleaner Phase 3 implementation.