- Updated architecture constraints documentation to include detailed sections on technical, organizational, regulatory, environmental, and performance constraints. - Created separate markdown files for each type of constraint for better organization and clarity. - Revised the architecture scope section to provide a clearer overview of the system's key areas. - Enhanced the solution strategy documentation with detailed explanations of the client-server architecture, technology choices, trade-offs, and future considerations. - Added comprehensive descriptions of backend and frontend components, middleware, and utilities in the architecture documentation. - Migrated UI, templates, and styling notes to a dedicated section for better structure. - Updated requirements.txt to include missing dependencies. - Refactored user authentication logic in the users.py and security.py files to improve code organization and maintainability, including the integration of OAuth2 password bearer token handling.
1.4 KiB
1.4 KiB
title, description, status
| title | description | status |
|---|---|---|
| 05 — Backend Components | Description of the backend components of the CalMiner application. | draft |
- FastAPI application (
main.py): entry point that configures routers, middleware, and startup/shutdown events. - Routers (
routes/): modular route handlers for scenarios, parameters, costs, consumption, production, equipment, maintenance, simulations, and reporting. Each router defines RESTful endpoints, request/response schemas, and orchestrates service calls.- leveraging a shared dependency module (
routes/dependencies.get_db) for SQLAlchemy session management.
- leveraging a shared dependency module (
- Models (
models/): SQLAlchemy ORM models representing database tables and relationships, encapsulating domain entities like Scenario, CapEx, OpEx, Consumption, ProductionOutput, Equipment, Maintenance, and SimulationResult. - Services (
services/): business logic layer that processes data, performs calculations, and interacts with models. Key services include reporting calculations and Monte Carlo simulation scaffolding.services/settings.py: manages application settings backed by theapplication_settingtable, including CSS variable defaults, persistence, and environment-driven overrides that surface in both the API and UI.
- Database (
config/database.py): sets up the SQLAlchemy engine and session management for PostgreSQL interactions.