Both the backend and frontend services are configured entirely through environment variables. No source files or config files need to be edited manually — set the variables in your shell, Docker Compose file, or Railway dashboard before starting the services.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Andr21Da16/UNITRU-ACADEMIC/llms.txt
Use this file to discover all available pages before exploring further.
Backend environment variables
The backend is a FastAPI application served by Uvicorn. It reads its configuration at startup from the process environment.| Variable | Default | Description | Required |
|---|---|---|---|
ALLOWED_ORIGINS | http://localhost:3000 | Comma-separated list of CORS-allowed origins. In production, set this to the Railway-generated frontend domain (e.g. https://unitru-academic.up.railway.app). Required for cross-origin WebSocket connections to succeed. | Yes |
PORT | 8000 | Server listen port. The backend CMD expands ${PORT:-8000}, so it works with or without the variable. | No |
Railway injects
PORT automatically into every service at runtime. Do not set it manually in the Railway dashboard — the backend’s Dockerfile CMD already handles it with ${PORT:-8000}.Frontend environment variables
The frontend is a Next.js application compiled to a standalone Node.js server. Because it uses aNEXT_PUBLIC_* variable, the value is embedded into the JavaScript bundle at build time, not at runtime.
| Variable | Default | Description | Required |
|---|---|---|---|
NEXT_PUBLIC_BACKEND_WS_URL | ws://localhost:8000/ws | WebSocket URL the student’s browser connects to. In production this must use the wss:// scheme with the Railway backend domain: wss://unitru-backend.up.railway.app/ws. | Yes (production) |
Docker Compose configuration
For local development, both variables are set directly indocker-compose.yml. The frontend receives NEXT_PUBLIC_BACKEND_WS_URL as a Docker build argument (args:), not as a runtime environment: entry, because Next.js embeds it at build time.
docker-compose.yml
Railway cross-service references
Railway can resolve references between services in the same project using the${{service.VARIABLE}} syntax. This means you never have to paste a domain manually — Railway fills it in when the referenced service generates its public domain.
Backend service — Variables tab:
wss:// scheme (TLS) and the /ws path suffix. Railway terminates TLS at its proxy layer and forwards traffic to the backend Uvicorn process, which must be started with --proxy-headers --forwarded-allow-ips="*" — the backend Dockerfile already does this.
Schedule catalog
The schedule catalog (data/horarios_catalogo.json) is a JSON file that maps course names to their official section timetables for the current semester. It is baked into the backend Docker image at build time via the COPY . . instruction in the backend Dockerfile — it is not fetched at runtime.
To update the catalog when the university publishes a new semester schedule:
- Re-run
scripts/download_horarios.pywith the new Google Sheets URL. - Re-run
scripts/parse_horarios.pyto regeneratedata/horarios_catalogo.json. - Commit the updated JSON file to the repository.
- Redeploy the backend service so Docker rebuilds the image with the new catalog baked in.