Installation
This guide gets CallMineAI running from source. For the full environment reference see Configuration; for production hosting see Deployment.
Requirements
| Requirement | Minimum |
|---|---|
| Node.js | 20 LTS or newer (22 recommended) |
| npm | 10+ (ships with Node 20) |
| Database | MySQL 8 / MariaDB 10.4+ |
| Web server | Any Node host — Vercel, a VPS behind Nginx, or Docker. HTTPS required for Twilio webhooks |
| Background worker | npm run worker, or a hosted cron POSTing /api/cron/* |
HTTPS in production
Twilio only calls publicly reachable HTTPS webhook URLs. Local development can place calls only through a tunnel (e.g. ngrok) pointed at your machine.
Install steps
# 1. Dependencies
npm install
# 2. Environment
cp .env.example .env
# 3. Configure .env (see the Configuration page) — at minimum:
# DATABASE_URL, AUTH_SECRET, APP_NAME, APP_URL
# 4. Database — create an empty MySQL database, point DATABASE_URL at it,
# then push the Prisma schema and seed essential data
# (RBAC, plans, currencies, locales, email templates, admin + demo accounts)
npx prisma db push
npm run db:seed
# 5. Run
npm run dev # http://localhost:3000
For production, build once and serve the compiled output:
npm run build # prisma generate + next build
npm start # http://localhost:3000
Prisma client
npm run build runs prisma generate for you. After editing prisma/schema.prisma in development, run npm run db:generate so the client picks up the change.
Background worker (required for calling)
The dialer runs on scheduled tasks — without them, campaigns queue calls but nothing dials.
npm run worker
The worker is a thin scheduler: it POSTs /api/cron/{task} on the running app with the X-Cron-Secret header, so the tasks execute inside Next.js. Set CRON_SECRET in .env (it falls back to AUTH_SECRET).
| Task | Schedule | Endpoint |
|---|---|---|
| Dispatch due outbound calls | every minute | POST /api/cron/dispatch |
| Recover calls with no terminal webhook | every 5 minutes | POST /api/cron/reap-stuck |
| Grant monthly plan credits | daily 02:00 | POST /api/cron/grant-monthly |
| Reconcile gateway subscriptions | daily 03:00 | POST /api/cron/sync-subscriptions |
| Heartbeat (verify cron is wired) | on demand | POST /api/cron/heartbeat |
Any hosted cron (Vercel Cron, a systemd timer, crontab) can replace npm run worker by calling the same endpoints — see Deployment. dispatch claims due calls bounded by your ElevenLabs key-pool capacity; see Campaigns & Calls for the full pipeline.
Default accounts
npm run db:seed creates both accounts. Change these before production (override with ADMIN_SEED_* / CLIENT_SEED_* in .env before seeding).
| Panel | Sign in at | Password | |
|---|---|---|---|
| Super admin | /admin/login | admin@spagreen.net | 12345678 |
| Customer | /login (workspace at /app) | client@spagreen.net | 12345678 |
The customer account is seeded with a starting credit balance so you can launch campaigns immediately.
Post-install configuration
Sign in to the admin panel and connect the integrations:
- ElevenLabs →
/admin/elevenlabs-keys→ add an API key, run Health check, then Sync voices. See Voice & AI. - Twilio → set
TWILIO_ACCOUNT_SID+TWILIO_AUTH_TOKEN(+ a From number) in.env. See Telephony. - OpenAI → set
OPENAI_API_KEYfor the agent conversation + call analysis. - Plans & Credit Packages → review the seeded plans and packs. See Billing & Credits.
- Payment gateways → enable Stripe / PayPal / Paddle if you want paid subscriptions.
Restart after editing .env
Next.js reads the environment at boot. Restart npm run dev (or npm start) after changing .env.
Demo mode
Set APP_DEMO_MODE=true to disable all create/update/delete actions in both panels — ideal for a public live-preview deployment.
Next
Head to Configuration for the complete .env reference, then Deployment to go live.