A web platform for running and watching multi-agent LLM simulations inside a retro pixel-art town. Agents powered by large language models (Ollama / OpenAI-compatible) live, work, and interact on a shared Phaser 3 tilemap — visible in real time through a React SPA.
Built on top of Park et al. — Generative Agents (UIST '23).
| Layer | Technology |
|---|---|
| Frontend | React 19 + TypeScript + Vite + Tailwind v4 + Phaser 3 |
| Backend | Django 4.2 + DRF + Django Channels (WebSocket) |
| Auth | django-allauth (Google / GitHub OAuth) + JWT httpOnly cookies |
| LLM runtime | Ollama (local) — swap for any OpenAI-compatible endpoint |
| Vector store | Qdrant |
| Database | PostgreSQL 12 |
| Cache / broker | Redis 7 |
| Reverse proxy | nginx (Docker) |
| Containerisation | docker-compose |
- Docker + Docker Compose v2
- An
.envfile in the project root (see below)
# Django
DJANGO_SECRET_KEY=change-me
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
# Postgres
POSTGRES_USER=freeguy
POSTGRES_PASSWORD=freeguy
POSTGRES_DB=freeguy
# Optional: expose via ngrok or similar tunnel
# DJANGO_SITE_DOMAIN=your-tunnel.ngrok-free.devdocker compose up --buildThe app is available at http://localhost (nginx on port 80).
docker compose exec backend python manage.py migrate
docker compose exec backend python manage.py setup_social_auth \
--google-client-id YOUR_GOOGLE_CLIENT_ID \
--google-client-secret YOUR_GOOGLE_CLIENT_SECRETNavigate to http://localhost, sign in with Google, and create your first simulation.
The Vite dev server runs inside the frontend container and proxies /api and /accounts to the Django backend. nginx routes all traffic so you only need one port (80).
# Rebuild after code changes
docker compose up --build --force-recreate frontend
# Watch Django logs
docker compose logs -f backend
# Run frontend unit tests (Vitest)
docker compose exec frontend npx vitest run- Start ngrok:
ngrok http 80 - Set in
.env:DJANGO_SITE_DOMAIN=your-subdomain.ngrok-free.dev
- Recreate the backend and run
setup_social_authagain so the Django Sites framework picks up the new domain:docker compose up --force-recreate backend docker compose exec backend python manage.py setup_social_auth ...
Free_Guy/
├── frontend/ # React SPA (Vite)
│ ├── public/assets/ # symlink → frontend_server/static_dirs/assets
│ └── src/
│ ├── components/ # Header, Primitives, ...
│ ├── pages/ # LandingPage, Dashboard, SimulatePage, ...
│ └── game/ # Phaser 3 GameCanvas
├── frontend_server/ # Django project
│ ├── translator/ # DRF views, auth, agent API
│ ├── static_dirs/assets/ # Game assets (tilemap, tilesets, sprites)
│ └── templates/ # Django HTML templates (allauth overrides)
├── design-system/ # Design tokens + React primitives
├── nginx/nginx.conf # Reverse proxy config
├── scripts/ # Utility / migration scripts
└── docker-compose.yml
- User clicks Sign in with Google →
/api/v1/auth/social/google/ - Django-allauth handles the OAuth dance with Google
- On success,
oauth_completeview issues JWT tokens as httpOnly cookies (access_token,refresh_token) and destroys the allauth session - React reads auth state via
/api/v1/auth/me/— no tokens stored in JS
Assets live in frontend_server/static_dirs/assets/ and are symlinked into frontend/public/assets/ for Vite. Inside Docker the symlink is broken (build context boundary), so docker-compose.yml mounts the real directory:
volumes:
- ./frontend_server/static_dirs/assets:/app/public/assets:roThis project is derived from the open-source release accompanying:
Generative Agents: Interactive Simulacra of Human Behavior Joon Sung Park, Joseph C. O'Brien, Carrie J. Cai, Meredith Ringel Morris, Percy Liang, Michael S. Bernstein UIST 2023 — arxiv.org/abs/2304.03442
Game asset credits:
- Background art: PixyMoon (@_PixyMoon_)
- Furniture / interior: LimeZu (@lime_px)
- Character sprites: ぴぽ (@pipohi)
