Skip to content

Window23/SOLPLANT

Repository files navigation

Power Plant Monitoring System

Real-time power plant telemetry dashboard built with:

Layer Stack
Backend API Python 3.12 + FastAPI + SQLAlchemy (async)
Database PostgreSQL 16
MQTT Broker Eclipse Mosquitto 2.0
Ingestion Python async service (paho-mqtt + asyncpg)
Frontend React 18 + Vite + Tailwind CSS + Recharts
Deployment Docker Compose + Nginx

Quick start (local dev)

cp .env.example .env
# Edit .env — set POSTGRES_PASSWORD at minimum

docker compose up --build

The simulator starts automatically and publishes test data every 5 seconds.


Project structure

SOL/
├── backend/            FastAPI application
│   └── app/
│       ├── core/       Settings (pydantic-settings)
│       ├── db/         SQLAlchemy engine + session
│       ├── models/     ORM models
│       ├── schemas/    Pydantic request/response schemas
│       └── api/routes/ REST endpoints
├── mqtt-ingestion/     MQTT subscriber → PostgreSQL writer
├── simulator/          Fake telemetry publisher (dev/testing)
├── database/           init.sql (schema + seed data)
├── frontend/           React + Vite SPA
│   └── src/
│       ├── api/        Axios client helpers
│       └── components/ Dashboard, charts, alarms
├── mosquitto/config/   Mosquitto broker config
├── docs/               Deployment guide
├── docker-compose.yml  All services
├── .env.example        Environment variable template
└── .gitignore

MQTT topic format

powerplant/{plant_id}/{device_type}/{device_id}

Payload (JSON):

{
  "metrics": {
    "power_output_mw": 145.3,
    "frequency_hz": 50.01
  },
  "timestamp": "2024-01-15T10:30:00Z"
}

The ingestion service auto-creates plant and device records on first message.


API endpoints

Method Path Description
GET /health Health + DB check
GET /api/plants List plants
POST /api/plants Create plant
GET /api/devices?plant_id= List devices
GET /api/readings?device_id=&metric=&since_minutes= Time-series
GET /api/readings/latest?plant_id= Latest reading per metric
GET /api/alarms?plant_id=&acknowledged= List alarms
PATCH /api/alarms/{id}/acknowledge Acknowledge alarm

Full interactive docs: http://localhost:8000/docs


Production deployment

See docs/deployment.md for step-by-step GoDaddy VPS instructions.

About

Cloud-native energy intelligence platform for monitoring, analytics, and management of solar and industrial power plants.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors