Skip to content

Commit 4e8772a

Browse files
committed
Add project context summary
1 parent 41c0cf7 commit 4e8772a

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

CONTEXT.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Project Context Snapshot
2+
3+
## Repository Structure
4+
- `apps/api` – FastAPI BFF, asynchronous SQLAlchemy, Alembic-style migrations (raw SQL in `migrations/sql`).
5+
- `apps/frontend` – Next.js 14 App Router UI with shadcn-style components and HLS preview.
6+
- `services/` – Orchestrator and worker agents (`asr`, `translate`, `tts`, `mix`, `subs`, `textinframe`, `qc`, `yt-uploader`) built from `infrastructure/docker/python-service.Dockerfile` via `SERVICE_NAME` arg.
7+
- `packages/` – Shared Pydantic schemas and service toolkit (DB, S3, RabbitMQ, Redis helpers).
8+
- `infrastructure/docker` – Dockerfiles for API, frontend, generic worker, RabbitMQ, MinIO.
9+
- `scripts/dev` – Utilities: `generate-test-video.sh`, `smoke.sh`, `init-minio.sh`.
10+
- `railway.json` – Maps Railway services to the correct Dockerfiles/args.
11+
12+
## Railway Services (running infrastructure)
13+
- **Postgres** (managed, with attached volume) – needs database `glocal_db` created manually.
14+
- **Redis** (managed) – provides pub/sub for SSE.
15+
- **RabbitMQ** (`rabbitmq:3.12-management` image) – credentials `glocal/glocalpass`.
16+
- **MinIO** (`minio/minio:<latest>` image) – volume mounted at `/data`; bucket `glocal-media` must exist (run `scripts/dev/init-minio.sh`).
17+
18+
## Environment Variables (shared across services)
19+
Set in Railway Shared Variables using internal hostnames:
20+
```
21+
APP_ENV=prod
22+
JWT_SECRET=<random secret>
23+
POSTGRES_DSN=postgresql://<user>:<pass>@<postgres-internal-host>:5432/glocal_db
24+
REDIS_URL=redis://:<redis-password>@<redis-internal-host>:6379/0
25+
RABBITMQ_URL=amqp://glocal:glocalpass@<rabbitmq-internal-host>:5672/
26+
S3_ENDPOINT=http://<minio-internal-host>:9000
27+
S3_PUBLIC_URL=<public MinIO URL or http://minio:9000>
28+
S3_BUCKET=glocal-media
29+
S3_ACCESS_KEY=minioadmin
30+
S3_SECRET_KEY=minioadmin
31+
API_BASE_URL=http://api:8080
32+
PUBLIC_API_URL=https://<api-service>.up.railway.app
33+
NEXT_PUBLIC_API_URL=https://<api-service>.up.railway.app
34+
NEXT_PUBLIC_MINIO_PUBLIC_URL=<public MinIO URL>
35+
```
36+
37+
## Outstanding Tasks
38+
1. **Database prep:** Create database `glocal_db` in Postgres and run migrations `migrations/sql/001_init.sql` & `002_seed.sql`.
39+
2. **MinIO init:** Execute `scripts/dev/init-minio.sh` with `MINIO_HOST`, `MINIO_ACCESS_KEY`, `MINIO_SECRET_KEY` pointing to Railway MinIO internal host.
40+
3. **Deploy app services via Railway CLI** (uses `railway.json`):
41+
- `railway up --service api`
42+
- `railway up --service frontend`
43+
- `railway up --service orchestrator`
44+
- `railway up --service <each-agent>` (`asr-agent`, `translate-agent`, `tts-agent`, `mix-agent`, `subs-agent`, `textinframe-agent`, `qc-agent`, `yt-uploader`)
45+
4. **Verify & smoke test:**
46+
- Check API health (`GET /healthz`).
47+
- Login via frontend (admin@glocal.ai / admin12345).
48+
- Run `scripts/dev/generate-test-video.sh` and `scripts/dev/smoke.sh` with `API_URL` & `S3_PUBLIC_URL` pointing to Railway endpoints.
49+
- Confirm job pipeline completes and assets are downloadable.
50+
51+
Keep this file updated after major changes; hand it to the next assistant session for instant context.

0 commit comments

Comments
 (0)