AI runbook
CLI provisioning, to paste into a Claude Code session (or similar).
Paste this runbook into an AI session with terminal access. The AI executes as much as possible through a CLI, stopping only at the points that require a human (login/2FA, payment, domain ownership).
Instruction for the AI executing this
Follow the steps in order. Before any command that creates a billable resource or is hard to reverse, confirm with the human. After each marked step, show the result before moving on. The app host must run a persistent Node process β never suggest Vercel or any serverless platform.
Choosing a path
All three paths use the same environment variables β only where each piece runs changes.
| Local | Demo (free) | Production | |
|---|---|---|---|
| App | pnpm dev on your machine | Render Free | Railway Hobby |
| Postgres | Docker container | Neon Free | Railway addon |
| LiveKit | Docker container | Cloud (Build plan) | Paid Cloud or self-host on a VPS |
| Storage | MinIO container | Neon Object Storage | Cloudflare R2 |
| Domain | localhost:3000 | none (*.onrender.com) | your own |
| Cost | US$ 0 | US$ 0 | ~US$ 10-15/month |
| Ceiling | that machine only | 5 simultaneous people in a call | whatever you pay for |
Prerequisites only the human can resolve
- A Discord Developer Portal account
- Docker Desktop installed and open β the daemon does not start itself
- Node.js installed
- A fork of the OpenCall repository, or the original repo to clone
No cloud account, no card, no domain. The clickable version of this path is Run locally with Docker.
1. Check the machine
docker info > /dev/null && echo "docker ok"
node --version
pnpm --version || npm install -g pnpmIf docker info fails, Docker Desktop is not running: pause for human
action, do not try to start the daemon yourself.
2. Clone and install
git clone https://github.com/YOUR-USERNAME/OpenCall.git
cd OpenCall
pnpm installThe repo's postinstall runs prisma generate. If it fails, stop here and show
the output before moving on.
3. Discord Application
There is no official CLI β 100% manual (see Set up Discord). Ask the human to create the application with the local Redirect URI:
http://localhost:3000/api/auth/callback/discordThen ask for DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET.
4. Environment variables
cp .env.docker.example .envThe file already ships every value matching docker-compose.yml (Postgres on
5433, MinIO on 9000, LiveKit on 7880) plus a development NEXTAUTH_SECRET.
Fill in only the two Discord lines:
DISCORD_CLIENT_ID=...
DISCORD_CLIENT_SECRET=...It has to be .env, not .env.local: the Prisma CLI only reads .env, and the
migration in step 5 fails with Environment variable not found: DATABASE_URL.
5. Bring up the infrastructure and the app
pnpm dev:dockerThe script chains three things: pnpm docker:up (Postgres + MinIO + LiveKit),
prisma migrate dev (creates the tables) and pnpm dev (Next.js on 3000).
pnpm dev never exits β it is a long-running process. Run it in the
background or in a separate terminal, otherwise the session hangs waiting on it.
The minio-init container finishing with exited (0) is success: it creates
the bucket, makes it publicly readable, runs once and stops.
Here the command is prisma migrate dev, not db push: the repository does
version prisma/migrations/.
6. Final validation
- Ask the human to open
http://localhost:3000and log in with Discord β it is that first login that creates theADMIN. - Confirm access to
/admin/channels. - Test a voice call in the
Geralchannel, on that same machine. - Send a message with an image attached β MinIO stands in for R2.
Warn the human about one structural limit: voice and video only work on that
machine. The LiveKit container announces 127.0.0.1 as its ICE candidate, so
another device on the same network opens the page but never joins the call. To
test with other people, the path is the Free demo tab.
Shutting down
pnpm docker:down # stops the containers, keeps the data
docker compose down -v # stops and WIPES database and uploadsHuman checkpoints (summary)
- Open Docker Desktop before starting
- Create the Discord Application and paste client id/secret (there is no API)
- Register
http://localhost:3000/api/auth/callback/discordas the Redirect URI - Be the first to log in, to become
ADMIN