How ja-perez/mywow works
Project Overview
• The project is centered around automated trading and asset management, evident from modules for analysis, trade/portfolio models, and services that integrate with live data (e.g., Coinbase, WebSocket).
• Its purpose is to run a suite of trading functionalities automatically, monitor positions, consolidate assets, and likely display dashboards and charts for user insights.
Main Components
a. Entry Point and Core Controller:
• main.py is the application’s starting point.
• Files like controller.py and dashboard.py serve as coordination/cohesion components, managing logic between services and UI.
b. Data and Domain Model Layer:
• The models directory contains business entities like “candles”, “portfolio”, “prediction”, and “trades”. These represent the core data structures for trading and financial information.
• The database module (database directory) includes files for initializing, setting up (database_setup_service.py), and even sample SQL data (coindata.sql). This layer supports persistent storage.
c. Business Logic / Service Layer:
• The services folder implements the operational logic required for trading.
• Specific files like coinbase_services.py, portfolio_service.py, prediction_service.py, websocket_service.py, and even an example file (ws_example.py) encapsulate functionalities such as connecting to external APIs, performing predictions, and handling real-time data via WebSockets.
d. User Interaction Layer:
• Complementing this is inputhandling (input_handler.py) which suggests that user or automated input processing is a dedicated component.
e. Auxiliary Components:
• analysis_service.py and design files (including dummy_data_examples.txt and ideers.md) that help for analysis, proposed ideas/design schemes, and quick prototypes.
• Utility files under utils (e.g., custom_exceptions.py, utils.py) standardize error handling and helper functions across the platform.
Relationships and Interactions
• The Controller interacts with the input handling component (inputhandler/input_handler.py) to process incoming commands or automated triggers.
• Data flows from services to and from the database module—in particular, database/database.py serves as the access point for data storage and retrieval.
• Services layer consumes models (from models/) to perform computations, make trade predictions, execute portfolio updates, and communicate with external APIs (like Coinbase) and WebSocket feeds.
• The UI layer (charts and menu modules) presents processed, real-time data to users, with feedback loops going back to the controller and input handler.
• Utilities provide cross-cutting support like exception handling and common helper functions.
Architectural Patterns and Design Principles
• Modular separation of concerns: Distinct directories (models, services, database, ui, inputhandling) suggest a clear division of responsibility.
• Layered architecture: Separation between presentation (UI), business logic (services, controller), and data storage (database, models).
• Domain-driven design: Models capture the core domain of trading and prediction.
• Emphasis on external integration points: Services layer integrates with external systems (Coinbase, WebSocket) which are clearly represented.