refactor: Enhance architecture documentation with detailed sections on purpose, constraints, runtime view, deployment, and key concepts; add implementation plan and update quickstart reference

This commit is contained in:
2025-10-23 16:59:15 +02:00
parent 76f92f8a7d
commit 8aee7b0d74
11 changed files with 634 additions and 72 deletions

View File

@@ -1,8 +1,59 @@
---
title: "07 — Deployment View"
description: "Describe deployment topology, infrastructure components, and environments (dev/stage/prod)."
status: draft
---
# 07 — Deployment View
Status: skeleton
## Deployment Topology
Describe deployment topology, infrastructure components, and environments (dev/stage/prod).
The CalMiner application is deployed using a multi-tier architecture consisting of the following layers:
1. **Client Layer**: This layer consists of web browsers that interact with the application through a user interface rendered by Jinja2 templates and enhanced with JavaScript (Chart.js for dashboards).
2. **Web Application Layer**: This layer hosts the FastAPI application, which handles API requests, business logic, and serves HTML templates. It communicates with the database layer for data persistence.
3. **Database Layer**: This layer consists of a PostgreSQL database that stores all application data, including scenarios, parameters, costs, consumption, production outputs, equipment, maintenance logs, and simulation results.
4. **Caching Layer**: This layer uses Redis to cache frequently accessed data and improve application performance.
## Infrastructure Components
The infrastructure components for the application include:
- **Web Server**: Hosts the FastAPI application and serves API endpoints.
- **Database Server**: PostgreSQL database for persisting application data.
- **Static File Server**: Serves static assets such as CSS, JavaScript, and image files.
- **Reverse Proxy (optional)**: An Nginx or Apache server can be used as a reverse proxy.
- **CI/CD Pipeline (optional)**: Automated deployment pipelines can be set up using tools like GitHub Actions.
- **Containerization (optional)**: Docker can be used to containerize the application.
- **Cloud Infrastructure (optional)**: The application can be deployed on cloud platforms.
## Environments
The application can be deployed in multiple environments to support development, testing, and production:
### Development Environment
The development environment is set up for local development and testing. It includes:
- Local PostgreSQL instance
- FastAPI server running in debug mode
### Testing Environment
The testing environment is set up for automated testing and quality assurance. It includes:
- Staging PostgreSQL instance
- FastAPI server running in testing mode
- Automated test suite (e.g., pytest) for running unit and integration tests
### Production Environment
The production environment is set up for serving live traffic and includes:
- Production PostgreSQL instance
- FastAPI server running in production mode
- Load balancer (e.g., Nginx) for distributing incoming requests
- Monitoring and logging tools for tracking application performance
## Integrations and Future Work (deployment-related)