The backend is a FastAPI application connected to a PostgreSQL database and AWS Athena/S3 for data retrieval.
The project uses a standard Python structure.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThe windwatts_data package is a large dependency stored in S3. It is not in PyPI.
If you are running locally without Docker, you must download and install it manually:
# Example for installing the wheel manually (check Dockerfile for exact URL/version)
curl -O https://windwatts-era5.s3.us-west-2.amazonaws.com/windwatts_data-1.0.4-py3-none-any.whl
pip install windwatts_data-1.0.4-py3-none-any.whlmake setup: Initializes the project.make run: Runs the webservice locally.
uvicorn app.main:app --reloadLocal Development:
Add to .env in windwatts-api/:
DATABASE_URL=postgresql://windwatts:windwatts@postgres:5432/windwatts_db
POSTGRES_USER=windwatts
POSTGRES_PASSWORD=windwatts
POSTGRES_DB=windwatts_db
Use Docker Compose (from root) to start the database.
To run tests:
pytestWhen the app is running, visit /docs (e.g., http://localhost:8080/docs) to see the auto-generated Swagger UI.