How keithcu/solarfleet works
Main Components
• Dashboard/UI Component: Represented by Dashboard.py, this is the front-end interface built with Streamlit.
• API Integration Modules: Files such as SolarEdge.py, Enphase.py, SolArk.py (plus any future integrations) handle communication with external solar APIs or perform web scraping.
• Data Collection/Business Logic: FleetCollector.py likely encapsulates the logic for aggregating data from the different API modules.
• Database Access Layer: Database.py and SqlModels.py handle data persistence, caching of API responses, and possibly ORM-related maintenance.
• Auxiliary File: .htaccess might be included for web server configuration but is less central to the application logic.
File Structure
• Flat file structure where each Python file appears to directly correspond to a specific function or integration (e.g., SolarPlatform.py may serve as an abstraction or aggregator for the different solar APIs).
• The separation by file names indicates a modular design where each integration’s logic is encapsulated within its own file.
• The presence of a dedicated SQL Models file signifies an intentional separation between business logic and data schema/logic.
Core Architectural Patterns and Technologies
• The dashboard follows a Model-View (UI) separation: using Streamlit for the interface and separate modules to handle data retrieval and processing.
• Use of caching mechanisms to optimize API call frequency indicates a focus on performance and efficiency.
• Dependency on both API interactions and Selenium-based web scraping suggests a hybrid integration approach.
• Python serves as the primary programming language with specialized technologies such as Streamlit and Selenium playing central roles.