centralized, standardized data infrastructure layer for African dataset
# Infra
Infra is an AI data infrastructure monorepo: a FastAPI **gateway** (JWT auth + merged OpenAPI), **dataset-manager** (PostgreSQL + SQLAlchemy), **intelligence** (Khaya translation + sentiment), **speech** (Whisper + intelligence), plus **PostgreSQL** and **Redis**. User accounts live in PostgreSQL (`users` table); the gateway issues JWTs and protects `/api/*` (set `AUTH_ENABLED=false` only for local debugging).
## Prerequisites
- Docker and Docker Compose v2+
- Enough disk and RAM for first-time model downloads (Whisper, Hugging Face, etc.)
## Environment variables
Compose substitutes `${VAR}` values from:
1. Your **shell** environment, and
2. A **`.env` file** in the **same directory as `docker-compose.yml`** (the project root).
Copy the template and edit:
```bash
cp .env.example .env
```
Set at least:
| Variable | Purpose |
|----------|---------|
| `GHANA_NLP_API_KEY` | Required for **intelligence** `/analyze` and **speech** (after transcription). Get a key from Khaya / Ghana NLP. |
| `DATABASE_URL` | Default inside Compose is `postgresql://infra:infra@postgres:5432/infra` — usually fine as-is for local Docker. |
| `JWT_SECRET` | Signing key for gateway JWTs; set a strong random value in any shared or production environment. |
| `AUTH_ENABLED` | Default `true`. When `true`, `/api/*` on the gateway requires `Authorization: Bearer `. |
Optional overrides (see `.env.example`): `CORS_ORIGINS`, upstream URLs, ports, Postgres credentials.
## API docs (Swagger) and authentication
- Open **`
localhost`** (or your `GATEWAY_PORT`) for a **single** Swagger UI that lists gateway **authentication** routes and **merged** paths for dataset-manager, intelligence, and speech (tagged as “proxied”). Use **Authorize** and paste a JWT from `POST /auth/login`.
- Register: `POST /auth/register` with JSON `{"email":"you@example.com","password":"yourpassword"}` (minimum 8 characters).
- Token: `POST /auth/login` returns `access_token`; send `Authorizat …