4.7 KiB
4.7 KiB
Implementation Plan (extended)
This file contains the implementation plan (MVP features, steps, and estimates).
Project Setup
- Connect to PostgreSQL database with schema
calminer. - Create and activate a virtual environment and install dependencies via
requirements.txt. - Define environment variables in
.env, includingDATABASE_URL. - Configure FastAPI entrypoint in
main.pyto include routers.
Feature: Scenario Management
Scenario Management — Steps
- Create
models/scenario.pyfor scenario CRUD. - Implement API endpoints in
routes/scenarios.py(GET, POST, PUT, DELETE). - Write unit tests in
tests/unit/test_scenario.py. - Build UI component
components/ScenarioForm.html.
Feature: Process Parameters
Parameters — Steps
- Create
models/parameters.pyfor process parameters. - Implement Pydantic schemas in
routes/parameters.py. - Add validation middleware in
middleware/validation.py. - Write unit tests in
tests/unit/test_parameter.py. - Build UI component
components/ParameterInput.html.
Feature: Stochastic Variables
Stochastic Variables — Steps
- Create
models/distribution.pyfor variable distributions. - Implement API routes in
routes/distributions.py. - Write Pydantic schemas and validations.
- Write unit tests in
tests/unit/test_distribution.py. - Build UI component
components/DistributionEditor.html.
Feature: Cost Tracking
Cost Tracking — Steps
- Create
models/capex.pyandmodels/opex.py. - Implement API routes in
routes/costs.py. - Write Pydantic schemas for CAPEX/OPEX.
- Write unit tests in
tests/unit/test_costs.py. - Build UI component
components/CostForm.html.
Feature: Consumption Tracking
Consumption Tracking — Steps
- Create models for consumption:
chemical_consumption.py,fuel_consumption.py,water_consumption.py,scrap_consumption.py. - Implement API routes in
routes/consumption.py. - Write Pydantic schemas for consumption data.
- Write unit tests in
tests/unit/test_consumption.py. - Build UI component
components/ConsumptionDashboard.html.
Feature: Production Output
Production Output — Steps
- Create
models/production_output.py. - Implement API routes in
routes/production.py. - Write Pydantic schemas for production output.
- Write unit tests in
tests/unit/test_production.py. - Build UI component
components/ProductionChart.html.
Feature: Equipment Management
Equipment Management — Steps
- Create
models/equipment.pyfor equipment data. - Implement API routes in
routes/equipment.py. - Write Pydantic schemas for equipment.
- Write unit tests in
tests/unit/test_equipment.py. - Build UI component
components/EquipmentList.html.
Feature: Maintenance Logging
Maintenance Logging — Steps
- Create
models/maintenance.pyfor maintenance events. - Implement API routes in
routes/maintenance.py. - Write Pydantic schemas for maintenance logs.
- Write unit tests in
tests/unit/test_maintenance.py. - Build UI component
components/MaintenanceLog.html.
Feature: Monte Carlo Simulation Engine
Monte Carlo Engine — Steps
- Implement Monte Carlo logic in
services/simulation.py. - Persist results in
models/simulation_result.py. - Expose endpoint in
routes/simulations.py. - Write integration tests in
tests/unit/test_simulation.py. - Build UI component
components/SimulationRunner.html.
Feature: Reporting / Dashboard
Reporting / Dashboard — Steps
- Implement report calculations in
services/reporting.py. - Add detailed and summary endpoints in
routes/reporting.py. - Write unit tests in
tests/unit/test_reporting.py. - Enhance UI in
components/Dashboard.htmlwith charts.
MVP Feature Analysis (summary)
Goal: Identify core MVP features, acceptance criteria, and quick estimates.
Edge cases to consider
- Large simulation runs (memory / timeouts) — use streaming, chunking, or background workers.
- DB migration and schema versioning.
- Authentication/authorization for scenario access.
Next actionable items
- Break Scenario Management into sub-issues (models, routes, tests, simple UI).
- Scaffold Parameter Input & Validation (models/parameters.py, middleware, routes, tests).
- Prototype the simulation engine with a small deterministic runner and unit tests.
- Scaffold Monte Carlo Simulation endpoints (
services/simulation.py,routes/simulations.py, tests). - Scaffold Reporting endpoints (
services/reporting.py,routes/reporting.py, front-end Dashboard, tests). - Add CI job for tests and coverage.
See UI and Style for the UI template audit, layout guidance, and next steps.