Marvox Development Guide
Status: Active (Storyworld Production Studio)
This guide reflects the current PostgreSQL-only, Docker-based development setup with the inference provider backend.
Prerequisites
- Docker Desktop (or Docker Engine + Docker Compose) — required for PostgreSQL + Redis
- Python 3.11+ (match production runtime)
- Node.js 20.9+, npm 10+
1. Start Docker Services
PostgreSQL and Redis must run via Docker:
bashdocker-compose up -d
Verify connectivity:
bashdocker ps # Should show postgres and redis containers running
2. Install Dependencies
bashpip install -r requirements.txt npm install
3. Environment Setup
- Copy
.env.exampleto.env. - Set required values:
envDATABASE_URL=postgresql://marvox:marvox@localhost:5432/marvox REDIS_URL=redis://localhost:6379/0 OPENAI_API_KEY=sk-... JWT_SECRET_KEY=change-me-to-random-256-bit-value
Optional but common:
OPENAI_MODEL_NAME(configures the language model)CORS_ALLOWED_ORIGINSVECTOR_DB_BACKEND(default:pgvector— PostgreSQL is the only supported vector backend)
4. Run Services
Backend:
bash# Terminal 1
source .venv/bin/activate
python main.py
Frontend:
bash# Terminal 2
npm run dev
API docs: http://localhost:8000/docs
Frontend: http://localhost:3000
Auth in Development
Most /api/* routes require a JWT Bearer token.
Register:
bashcurl -X POST http://localhost:8000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"password","name":"You"}'
Or demo login:
bashcurl -X POST http://localhost:8000/api/auth/demo-login \
-H "Content-Type: application/json"
Useful Scripts
scripts/export_openapi.pyexports OpenAPI todocs/openapi.jsonscripts/scan_env_vars.pybuilds the env var inventoryscripts/scan_routes.pybuilds the route inventoryscripts/run_docs_checks.shruns doc link checks and OpenAPI diff
Tests
Backend tests:
bashpytest tests/
Frontend checks:
bashnpm run type-check
E2E tests (Playwright):
bashnpx playwright test
Documentation Source of Truth
- API reference is generated from
docs/openapi.jsonintodocs/API.md - Primary onboarding docs:
START_HERE.mdandREADME.md - System design:
ARCHITECTURE.md
Deployment
See DEPLOYMENT.md for Railway + Vercel deployment and production environment variables.