Módulo Horario is configured entirely through environment variables. Each service reads its configuration at startup and will fail immediately if any required variable is missing. For local development, copyDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Luisanchez0/modulo_Horario/llms.txt
Use this file to discover all available pages before exploring further.
services/.env.example to services/.env and fill in the values. For production, use AWS Secrets Manager or HashiCorp Vault — never commit .env files to version control.
The root
services/.env file provides shared variables (database passwords, shared secrets) that Docker Compose injects into each service. Service-level .env.example files show the full variable set for each individual service.Shared variables (root .env)
These variables are defined once in services/.env and referenced by docker-compose.yml across multiple services.
| Variable | Required | Description |
|---|---|---|
MYSQL_ROOT_PASSWORD | Yes | Root password for the MySQL container. Used by usuarios-service and aulas-service. |
MYSQL_DATABASE | Yes | Default MySQL database name. Set to docentes_db. |
POSTGRES_USER | Yes | PostgreSQL username. Used by horario-service and materias-service. |
POSTGRES_PASSWORD | Yes | PostgreSQL password. |
POSTGRES_DB | Yes | Default PostgreSQL database name. Set to postgres. |
JWT_SECRET | Yes | Secret key for signing and verifying JWT tokens. Generate with openssl rand -hex 32. |
ADMIN_CREATION_KEY | Yes | Key required in the X-Admin-Key header to create admin accounts. Generate with openssl rand -hex 16. |
INTERNAL_API_KEY | Yes | Shared key used for authenticated inter-service HTTP calls. Generate with openssl rand -hex 16. |
CORS_ALLOW_ORIGINS | Yes | Comma-separated list of allowed CORS origins. Restrict to actual domains in production. |
Service variables
usuarios-service (port 8001)
usuarios-service (port 8001)
usuarios-service manages user accounts, authentication, and JWT issuance. It connects to MySQL.| Variable | Type | Required | Default | Description |
|---|---|---|---|---|
APP_PORT | integer | No | 8001 | Port the service binds to. |
DATABASE_URL | string | Yes | — | MySQL connection string. Format: mysql+pymysql://user:password@host:port/database |
JWT_SECRET | string | Yes | — | Secret key for HS256 JWT signing. Must match across any service that verifies tokens. |
ADMIN_CREATION_KEY | string | Yes | — | Key checked by POST /auth/register-admin via the X-Admin-Key header. |
INTERNAL_API_KEY | string | Yes | — | Key used to authenticate incoming requests from other services. |
CORS_ALLOW_ORIGINS | string | Yes | — | Comma-separated list of origins permitted by the CORS middleware. |
usuarios-service/.env.example):horario-service (port 8004)
horario-service (port 8004)
horario-service manages academic schedules and depends on all three other services for docente, materia, and aula data. It connects to PostgreSQL.| Variable | Type | Required | Default | Description |
|---|---|---|---|---|
APP_PORT | integer | No | 8004 | Port the service binds to. |
APP_NAME | string | No | Horario Service | Application name shown in logs and error responses. |
DATABASE_URL | string | Yes | — | PostgreSQL connection string. Format: postgresql://user:password@host:port/database |
USUARIOS_SERVICE_URL | string | Yes | — | Base URL of usuarios-service for docente lookups and token verification. |
MATERIAS_SERVICE_URL | string | Yes | — | Base URL of materias-service for subject lookups. |
AULAS_SERVICE_URL | string | Yes | — | Base URL of aulas-service for classroom lookups. |
INTERNAL_API_KEY | string | Yes | — | Key sent in outgoing inter-service requests. Must match the key expected by other services. |
UPSTREAM_TIMEOUT_SECONDS | integer | No | 5 | Timeout in seconds for HTTP calls to upstream services. |
CORS_ALLOW_ORIGINS | string | Yes | — | Comma-separated list of allowed CORS origins. |
horario-service/.env.example):materias-service (port 8002)
materias-service (port 8002)
materias-service manages academic subjects. It connects to PostgreSQL and delegates authentication to usuarios-service.| Variable | Type | Required | Default | Description |
|---|---|---|---|---|
APP_PORT | integer | No | 8002 | Port the service binds to. |
DATABASE_URL | string | Yes | — | PostgreSQL async connection string. Format: postgresql+asyncpg://user:password@host:port/database |
USUARIOS_SERVICE_URL | string | Yes | — | Base URL of usuarios-service used to validate tokens on protected routes. |
UPSTREAM_TIMEOUT_SECONDS | integer | No | 5 | Timeout in seconds for calls to usuarios-service. |
CORS_ALLOW_ORIGINS | string | Yes | — | Comma-separated list of allowed CORS origins. |
aulas-service (port 8003)
aulas-service (port 8003)
aulas-service manages classrooms. It connects to MySQL and delegates authentication to usuarios-service.| Variable | Type | Required | Default | Description |
|---|---|---|---|---|
APP_PORT | integer | No | 8003 | Port the service binds to. |
DATABASE_URL | string | Yes | — | MySQL connection string. Format: mysql+pymysql://user:password@host:port/database |
USUARIOS_SERVICE_URL | string | Yes | — | Base URL of usuarios-service for authentication delegation. |
UPSTREAM_TIMEOUT_SECONDS | integer | No | 5 | Timeout in seconds for calls to usuarios-service. |
CORS_ALLOW_ORIGINS | string | Yes | — | Comma-separated list of allowed CORS origins. |
Production values
| Variable | How to generate |
|---|---|
JWT_SECRET | openssl rand -hex 32 |
ADMIN_CREATION_KEY | openssl rand -hex 16 |
INTERNAL_API_KEY | openssl rand -hex 16 |
MYSQL_ROOT_PASSWORD | Use a password manager or openssl rand -base64 24 |
POSTGRES_PASSWORD | Use a password manager or openssl rand -base64 24 |