How murdho/spendbetter works
Main System Components
A. Frontend Layer:
• Rails views structure (/app/views)
• JavaScript components (Stimulus controllers in /app/javascript/controllers)
• PWA capabilities (manifest.json and service-worker.js)
B. Application Layer:
• Controllers (entries_controller.rb, folders_controller.rb)
• Models with special emphasis on the Bank namespace hierarchy
• Background Jobs system (indicated by /app/jobs)
C. Banking Integration Layer:
• Bank models (/app/models/bank/*)
• HTTP handling with token refresh mechanism
• Institution and Account management
D. Data Layer:
• Database (indicated by schema.rb and migrations)
• Token management system
• Cache system (cache.yml)
Component Relationships
User Interface ↔ Controllers ↔ Models ↔ Banking Integration ↔ External Banking APIs
• ↕
• Background Jobs
• ↕
• Database/Cache
Specific Implementation Details
Technical elements:
a) Authentication Flow:
• Token management system (Token model)
• Auto-refresh mechanism (bank/http/token_auto_refresh.rb)
b) Data Organization:
• Folder structure (Folder model)
• Entries management (Entry model)
• Banking data models (Account, Connection, Institution)
c) API Integration:
• HTTP client implementation (bank/http/jason.rb)
• Banking institution connections
Infrastructure Components
Deployment-related elements:
• Docker container (Dockerfile present)
• Kamal deployment configuration
• Background job processing
• Caching layer
Key Architectural Patterns to Highlight
• MVC pattern (Rails standard)
• Service-oriented architecture for banking integration
• Background job processing architecture
• Token-based authentication system
• PWA capabilities
Technical Stack Indicators
Technologies:
• Ruby on Rails
• Stimulus.js
• PostgreSQL (implied by Rails setup)
• Docker
• PWA
• Background Job Processing
• Caching System
This architecture appears to be designed for scalability and security, which should be emphasized in the visual representation through clear separation of concerns and well-defined boundaries between components.