How contre95/controtto works
Main Components Identification
a) Presentation Layer:
• HTML Templates (views directory)
• Static Assets (public directory)
• HTMX for interactive features
b) Application Layer:
• REST API Handlers (src/rest)
• Application Services
• Managing Service (src/app/managing)
• Querying Service (src/app/querying)
c) Domain Layer:
• PnL Domain Models (src/domain/pnl)
• Asset Management
• Trading Pairs
d) Infrastructure Layer:
• Market Data Gateways (src/gateways/markets)
• Binance API
• BingX API
• Alpha Vantage API
• Tiingo API
• Persistence Layer (src/gateways/sqlite)
Component Relationships and Data Flow
[Web Browser] ←→ [HTMX/Templates]
• ↓
[REST Handlers]
• ↓
[Application Services]
• ↓
[Domain Layer]
• ↓
[Infrastructure Layer] → [External APIs]
• → [SQLite Database]
Specific Design Elements
Use these visual elements:
Key Architectural Patterns to Highlight
• Clean Architecture pattern (visible in the layer separation)
• Repository pattern (for database access)
• Gateway pattern (for external API access)
• MVC-like structure in the web layer
Technical Details
Database:
• SQLite for persistence
• Connection to asset and transaction storage
External Services:
• Market data providers with API connections
• Rate limiting considerations
Web Layer:
• HTMX-based frontend
• Template-based rendering
• Static asset serving
Deployment Context
Show:
• Container deployment option
• Volume mounting for persistence
• Port exposures
• Environment variable configuration
Remember to indicate the stateless nature of the application and how it relies on SQLite for persistence, making it suitable for self-hosting and containerization.
This architecture emphasizes the separation of concerns while showing how the application achieves its core functionality of tracking P&L without requiring JavaScript on the frontend, which is a unique characteristic of this project.