A full-stack renewable-energy analytics project for forecasting photovoltaic (PV) potential in Morocco using explainable machine learning.
# Morocco Solar Intelligence
A full-stack renewable-energy analytics project for forecasting photovoltaic (PV) potential in Morocco using explainable machine learning.
This repository packages the thesis work into a reproducible, portfolio-ready platform with:
- A FastAPI backend for forecasting, model validation, explainability, and simulation.
- A React + Vite frontend for dashboards, GIS exploration, and scenario testing.
- A data collection pipeline (NASA POWER + PVGIS).
- Research reports and visual artifacts under `Docs/`.
## Project Scope
The platform focuses on **inference and interpretation** from prepared thesis artifacts.
It does not retrain models at API request time.
Main capabilities:
- City-level and global solar potential exploration.
- Forecast endpoint with Open-Meteo integration and climatology fallback.
- Model comparison and diagnostics endpoints.
- SHAP-style explainability endpoints.
- What-if simulation for weather scenarios.
## Repository Structure
```text
.
├── backend/ # FastAPI service
├── frontend/ # React/Vite web app
├── data/ # Dataset files (including pv_morocco_dataset.csv)
├── Docs/
│ ├── ARCHITECTURE.md
│ ├── DEPLOYMENT.md
│ ├── PRODUCT_OVERVIEW.md
│ ├── images/ # Figures and visual artifacts
│ └── report/ # Thesis/report chapters in Markdown
├── scripts/ # Data collection + analysis utilities
├── Dockerfile # Backend image
├── docker-compose.yml # Full stack local deployment
└── pyproject.toml # Python project metadata
```
## Quick Start
### 1) Backend (local)
```bash
python -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt
uvicorn backend.main:app --reload --host 0.0.0.0 --port 8000
```
API docs: `
localhost`
### 2) Frontend (local)
```bash
cd frontend
pnpm install
pnpm run dev
```
UI: `
localhost`
## Docker
Run both services: …