How shoyers/projet-tuteure works
Main Components
• Application Entry Point: Represent main.py (and possibly src/app.py as the application’s initializer or router).
• Configuration: The config directory (config/settings.py) that holds database and other settings.
• Controllers: Under src/controllers (dashboard_controller.py, settings_controller.py, table_controller.py) that handle incoming requests and drive the application logic.
• Models: In src/models (sensor.py, sensor_data.py) managing sensor data representation.
• Views: Represented in src/views (dashboard_view.py, settings_view.py, tables_view.py, and components under src/views/components) that build the graphical interface. Also include the public assets (images/fonts) under src/public.
• Services: The business logic layer in src/services (e.g., sensor_service.py) handling sensor-specific operations.
• Database Layer: The database directory under src/database containing connection.py and query_manager.py, which interface with a MySQL database (as mentioned in the README).
• Utility Functions: The utils directory (e.g., console_redirector.py, helpers.py) that supports logging or common functionality.
• SQL Schema: The sensor_schemas_simple.sql file to show the initial database schema for sensor data.
Relationships and Interactions
• The entry point (main.py) initializes the application (possibly through src/app.py) and sets up routing to controllers.
• Controllers interact with models, services, and views to process user requests and render the user interface.
• The service layer (sensor_service.py) encapsulates the business logic around sensor data, interfacing with database components (src/database/connection.py and query_manager.py) using configuration settings from config/settings.py.
• Views and components combine front-end assets with data provided by controllers, ensuring the dashboard reflects real-time sensor updates.
• Utility modules provide supporting functionality to different layers.
Architectural Patterns and Design Principles
• MVC-Like Pattern: Clearly segregating controllers (handling input and logic), models (data structure), and views (user interface).
• Layered Architecture: Separation of concerns with distinct layers for configuration, services, database access, and utilities.
• Modularization: Each component (controllers, models, views, services) is structured in its own directory for clarity and maintainability.
• External Configuration: Using a dedicated configuration file (config/settings.py) to manage environment-specific settings like MySQL connection details.
Technologies and Framework Components
• Python is the core language with dependency management via requirements.txt.
• MySQL as the database for persisting sensor data.
• Likely use of a web framework (even if it is a lightweight or custom one) given the MVC structure, though the framework is not explicitly named.
• Static assets such as fonts and images are stored under src/public for the UI.
• SQL file sensor_schemas_simple.sql provides the schema for database initiation.