How hitomi-ap/urbanwatt_sql works
Urbanwatt SQL combines a PostgreSQL charging-network database with a small FastAPI read API. The user-facing workflow is a client requesting station or charger data, the API querying PostgreSQL, and the API returning JSON; the README also documents initializing and administering the database. The domain extends beyond the sampled endpoints to customers, vehicles, charging sessions, payments, incidents, and interventions. Those broader capabilities and the SQL operations are documented, but their implementation details were not sampled, so their relationships are limited to README-supported links.
Main entry points: main.py FastAPI routes · database.py PostgreSQL connection · Procédure d'imports.md Data imports · 01_schema.sql Stations and chargers
Components 15
API access
- FastAPI routes
app/main.py - PostgreSQL connection
app/database.py - Web assets
app/static/index.html
Charging domain
- Stations and chargers
sql/01_schema.sql - Customers and sessions
sql/01_schema.sql - Payments and incidents
sql/01_schema.sql - Interventions
sql/01_schema.sql
SQL operations
- Data verification
sql/02_verifications.sql - SQL queries
sql/03_requetes.sql - Query optimization
sql/optimisation.sql - Data imports
sql/Procédure d'imports.md
Database administration
- PostgreSQL database
- Backups
Sauvegardes/Sauvegardes.md - pgAdmin
Other components
- API client
Connections 15
- API client → FastAPI routes: requests data
README.md - FastAPI routes → PostgreSQL connection: opens connection
app/main.py - PostgreSQL connection → PostgreSQL database: connects to
app/database.py - FastAPI routes → PostgreSQL database: queries stations and chargers
app/main.py - PostgreSQL database → API client: returns JSON
README.md - PostgreSQL database → Stations and chargers: stores network data
README.md - PostgreSQL database → Customers and sessions: stores activity data
README.md - PostgreSQL database → Payments and incidents: stores records
README.md - PostgreSQL database → Interventions: stores interventions
README.md - PostgreSQL database → Data verification: validates data
README.md - PostgreSQL database → SQL queries: supports SQL analysis
README.md - PostgreSQL database → Query optimization: optimizes queries
- Data imports → PostgreSQL database: imports data
README.md - PostgreSQL database → Backups: backs up
README.md - pgAdmin → PostgreSQL database: administers
README.md