A sophisticated AI-driven Mafia game simulation where LLM agents play against each other.
- Monorepo: Managed with
pnpmworkspaces. - Frontend: React (Vite) in
frontend/. - Backend: Cloudflare Workers + Hono + Durable Objects in
backend/. - Database: Cloudflare D1 (SQLite).
- AI: Google Gemini (via Google Gen AI SDK).
- Node.js v20+
- pnpm (
npm install -g pnpm) - Cloudflare Wrangler CLI (
npm install -g wrangler) - GitHub CLI (
brew install gh) - Optional, for repo setup.
Just run:
pnpm devThis magic command will:
- Check for secrets: It will try to fetch secrets or create a dummy
.envif missing. - Sync Environment: It ensures the backend has the correct
.dev.vars. - Start Everything: It launches both the Frontend (localhost:3000) and Backend (localhost:8787) in parallel.
To easily create a private GitHub repository and sync your local secrets:
./scripts/setup-github.shRun End-to-End Tests:
pnpm test:e2ePre-commit Hooks: Husky is configured to run linting on staged files before commit.
Deployment is automated via GitHub Actions on push to main.
To deploy manually:
pnpm deploy