|
| 1 | +--- |
| 2 | +user-invocable: false |
| 3 | +description: Use when discussing app structure, deployment, or spec compliance |
| 4 | +--- |
| 5 | + |
| 6 | +# Towlion Spec Context (v1.0) |
| 7 | + |
| 8 | +Key rules from the Towlion platform specification: |
| 9 | + |
| 10 | +## Required Structure |
| 11 | +- `app/` — FastAPI backend with `Dockerfile` and `main.py` |
| 12 | +- `deploy/` — `docker-compose.yml`, `docker-compose.standalone.yml`, `Caddyfile`, `env.template` |
| 13 | +- `.github/workflows/deploy.yml` |
| 14 | +- `scripts/health-check.sh` |
| 15 | +- `README.md` |
| 16 | +- `frontend/` — optional (Next.js) |
| 17 | + |
| 18 | +## Backend |
| 19 | +- HTTP server on **port 8000**: `uvicorn app.main:app --host 0.0.0.0 --port 8000` |
| 20 | +- Health endpoint: `GET /health` returns `200` with `{"status": "ok"}` |
| 21 | + |
| 22 | +## Environment Variables |
| 23 | +- **Required**: `APP_DOMAIN`, `DATABASE_URL`, `REDIS_URL` |
| 24 | +- **Optional**: `S3_ENDPOINT`, `S3_BUCKET`, `S3_ACCESS_KEY`, `S3_SECRET_KEY`, `EMAIL_API_KEY`, `EMAIL_FROM` |
| 25 | + |
| 26 | +## Dependencies |
| 27 | +- `requirements.txt` (at repo root) or `pyproject.toml` |
| 28 | +- Must include `fastapi` and `uvicorn` |
| 29 | + |
| 30 | +## Docker |
| 31 | +- `app/Dockerfile` is required, `frontend/Dockerfile` if frontend exists |
| 32 | +- Container must expose port 8000 and read config from env vars |
| 33 | + |
| 34 | +## Compose Files |
| 35 | +- `docker-compose.yml` — app containers only (multi-app setup, no infra) |
| 36 | +- `docker-compose.standalone.yml` — full stack with postgres/redis/minio/caddy (for self-hosted forks) |
| 37 | + |
| 38 | +## Validation Tiers |
| 39 | +- **Tier 1**: Structure — required files and directories exist |
| 40 | +- **Tier 2**: Content — YAML valid, port 8000 referenced, env vars present, FastAPI used, no hardcoded secrets |
| 41 | +- **Tier 3**: Runtime — containers build, compose validates, health endpoint responds |
0 commit comments