# inundra/solar-tracker architecture

> Architecture diagram of the GitHub repository inundra/solar-tracker, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/inundra/solar-tracker
- Repository: https://github.com/inundra/solar-tracker

## Overview

MWitness is a Romanian solar and battery-project monitoring product: it aims to link approved projects to sites, track construction from dated satellite imagery, estimate capacity, and provide evidence for commercial users. The visible runtime is currently data ingestion, validation, and PostgreSQL/PostGIS storage; the satellite pipeline and user-facing capabilities are described in the README but their implementation is not present in the sampled source. The graph distinguishes those documented product stages from the implemented backend.

Main entry points: [`pipeline/src`](https://github.com/inundra/solar-tracker/tree/main/pipeline/src) (Project pages), [`backend/src/importa_csv.py`](https://github.com/inundra/solar-tracker/blob/main/backend/src/importa_csv.py) (CSV import), [`backend/src/migreaza.py`](https://github.com/inundra/solar-tracker/blob/main/backend/src/migreaza.py) (Schema migrations), [`validare/valideaza_csv.py`](https://github.com/inundra/solar-tracker/blob/main/validare/valideaza_csv.py) (CSV validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Project intelligence"]
  node_site_linking["Project-site linking"]
  node_project_lookup["Project lookup"]
  node_national_map["National map"]
  node_project_pages["Project pages"]
  node_evidence_report["Evidence reports"]
end

subgraph group_satellite["Satellite monitoring"]
  node_satellite_sources["Satellite imagery"]
  node_cloud_filter["Cloud filtering"]
  node_site_change["Site change detection"]
  node_construction_stage["Construction stage"]
  node_capacity_estimates["Capacity estimates"]
end

subgraph group_data["Ground truth and data"]
  node_manual_truth["Mapped project truth"]
  node_csv_validation["CSV validation<br/>[valideaza_csv.py]"]
end

subgraph group_backend["Backend storage"]
  node_csv_import["CSV import<br/>[importa_csv.py]"]
  node_db_connection["Database connection<br/>[db.py]"]
  node_schema_migrations["Schema migrations<br/>[migreaza.py]"]
  node_project_store[("Project and evidence store")]
end

node_investigators(("Investors and analysts"))
node_sentinel["Sentinel data"]
node_earth_engine["Earth Engine"]

node_investigators -.->|"searches"| node_project_lookup
node_project_lookup -.->|"opens project"| node_project_pages
node_national_map -.->|"drills down"| node_project_pages
node_project_pages -.->|"exports evidence"| node_evidence_report
node_site_linking -.->|"links projects"| node_project_pages
node_sentinel -.->|"supplies imagery"| node_satellite_sources
node_earth_engine -.->|"provides access"| node_satellite_sources
node_satellite_sources -.->|"filtered by"| node_cloud_filter
node_cloud_filter -.->|"supports detection"| node_site_change
node_site_change -.->|"informs stage"| node_construction_stage
node_site_change -.->|"informs estimate"| node_capacity_estimates
node_manual_truth -.->|"validated from CSV"| node_csv_validation
node_csv_import -->|"runs validation"| node_csv_validation
node_csv_import -->|"connects through"| node_db_connection
node_csv_import -->|"writes records"| node_project_store
node_schema_migrations -->|"connects through"| node_db_connection
node_schema_migrations -->|"applies schema"| node_project_store

click node_site_linking "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_project_lookup "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_national_map "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_project_pages "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_evidence_report "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_satellite_sources "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_cloud_filter "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_site_change "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_construction_stage "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_capacity_estimates "https://github.com/inundra/solar-tracker/tree/main/pipeline/src"
click node_manual_truth "https://github.com/inundra/solar-tracker/tree/main/validare/proiecte_cartate"
click node_csv_validation "https://github.com/inundra/solar-tracker/blob/main/validare/valideaza_csv.py"
click node_csv_import "https://github.com/inundra/solar-tracker/blob/main/backend/src/importa_csv.py"
click node_db_connection "https://github.com/inundra/solar-tracker/blob/main/backend/src/db.py"
click node_schema_migrations "https://github.com/inundra/solar-tracker/blob/main/backend/src/migreaza.py"
click node_project_store "https://github.com/inundra/solar-tracker/blob/main/backend/sql/migrari/001_schema_initiala.sql"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site_linking,node_project_lookup,node_national_map,node_project_pages,node_evidence_report toneBlue
class node_satellite_sources,node_cloud_filter,node_site_change,node_construction_stage,node_capacity_estimates toneAmber
class node_manual_truth,node_csv_validation toneMint
class node_csv_import,node_db_connection,node_schema_migrations,node_project_store toneRose
class node_investigators,node_sentinel,node_earth_engine toneIndigo
```

## Components

### Project intelligence

- [Project-site linking](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Project lookup](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [National map](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Project pages](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Evidence reports](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`

### Satellite monitoring

- [Satellite imagery](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Cloud filtering](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Site change detection](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Construction stage](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`
- [Capacity estimates](https://github.com/inundra/solar-tracker/tree/main/pipeline/src): `pipeline/src`

### Ground truth and data

- [Mapped project truth](https://github.com/inundra/solar-tracker/tree/main/validare/proiecte_cartate): `validare/proiecte_cartate`
- [CSV validation](https://github.com/inundra/solar-tracker/blob/main/validare/valideaza_csv.py): `validare/valideaza_csv.py`

### Backend storage

- [CSV import](https://github.com/inundra/solar-tracker/blob/main/backend/src/importa_csv.py): `backend/src/importa_csv.py`
- [Database connection](https://github.com/inundra/solar-tracker/blob/main/backend/src/db.py): `backend/src/db.py`
- [Schema migrations](https://github.com/inundra/solar-tracker/blob/main/backend/src/migreaza.py): `backend/src/migreaza.py`
- [Project and evidence store](https://github.com/inundra/solar-tracker/blob/main/backend/sql/migrari/001_schema_initiala.sql): `backend/sql/migrari/001_schema_initiala.sql`

### Other components

- **Investors and analysts**
- **Sentinel data**
- **Earth Engine**

## Connections

- Investors and analysts → Project lookup: searches (evidence: `README.md`)
- Project lookup → Project pages: opens project (evidence: `README.md`)
- National map → Project pages: drills down (evidence: `README.md`)
- Project pages → Evidence reports: exports evidence (evidence: `README.md`)
- Project-site linking → Project pages: links projects (evidence: `README.md`)
- Sentinel data → Satellite imagery: supplies imagery (evidence: `README.md`)
- Earth Engine → Satellite imagery: provides access (evidence: `README.md`)
- Satellite imagery → Cloud filtering: filtered by (evidence: `README.md`)
- Cloud filtering → Site change detection: supports detection (evidence: `README.md`)
- Site change detection → Construction stage: informs stage (evidence: `README.md`)
- Site change detection → Capacity estimates: informs estimate (evidence: `README.md`)
- Mapped project truth → CSV validation: validated from CSV (evidence: `README.md`)
- CSV import → CSV validation: runs validation (evidence: `backend/src/importa_csv.py`)
- CSV import → Database connection: connects through (evidence: `backend/src/importa_csv.py`)
- CSV import → Project and evidence store: writes records (evidence: `backend/src/importa_csv.py`)
- Schema migrations → Database connection: connects through (evidence: `backend/src/migreaza.py`)
- Schema migrations → Project and evidence store: applies schema (evidence: `backend/src/migreaza.py`)
