For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending
.mdto page URLs; this page is available as Markdown.
Hosting and deployment
Deploying on Vercel
How it works
- The repo includes a Vercel configuration: all requests are rewritten to
/api?path=<original path>. The serverless function inapi/index.tsreconstructs the request and passes it to the main Hono app (built fromsrc/index.ts). - The build runs
npm run build, which compiles TypeScript, runs Prisma generate, and builds Tailwind. The output used in production isdist/index.jsplusapi/index.tsas the Vercel serverless entry.
Steps
-
Connect the repo to Vercel (GitHub/GitLab/Bitbucket).
-
Set environment variables in the Vercel project:
- DATABASE_URL – Your PostgreSQL URL. For Vercel Postgres, use the connection string from the Vercel dashboard (often with
?connection_limit=1for serverless). - APP_BASE_URL – Your production URL, e.g.
https://your-app.vercel.app. - Optional: STRIPE_SECRET_KEY, BLOB_READ_WRITE_TOKEN, SMTP_*, Discord vars (see Environment Variables).
- DATABASE_URL – Your PostgreSQL URL. For Vercel Postgres, use the connection string from the Vercel dashboard (often with
-
Build command:
npm run build
Output directory: leave default (Vercel uses the repo root; the function is inapi/). -
Deploy. On first deploy, ensure migrations have been applied to your production database. You can run:
bashnpx prisma migrate deploylocally with
DATABASE_URLpointing to the production DB, or run it in a one-off script/CI step.
Notes for Vercel
- Read-only filesystem: The app cannot write files to disk at runtime. Commission file uploads and user banners should use Vercel Blob (or an external store) if you need them in production. The code already supports
BLOB_READ_WRITE_TOKENfor banner uploads; commission uploads currently write touploads/and will only work on a host with a writable filesystem unless you add Blob (or S3) for those too. - Connection pooling: For serverless, add
?connection_limit=1toDATABASE_URLif recommended by your DB provider to avoid exhausting connections.
Self-hosting (VPS, Railway, Render, etc.)
-
Server requirements: Node.js 18+, PostgreSQL.
-
Clone, install, set env:
bashgit clone <repo> cd <project> npm install cp .env.example .env # Edit .env with DATABASE_URL and other vars -
Database:
bashnpx prisma migrate deploy -
Build and start:
bashnpm run build npm start -
Process manager (recommended): Use PM2, systemd, or the platform’s process manager so the app restarts on crash and on reboot. Example with PM2:
bashnpx pm2 start dist/index.js --name panel -
Reverse proxy: Put Nginx (or Caddy) in front and proxy to the Node port. Use HTTPS (e.g. Let’s Encrypt). Set APP_BASE_URL to your public URL (e.g.
https://panel.yourdomain.com). -
Uploads: On a VPS,
uploads/is writable; commission uploads and banners will be stored on disk. Ensure the app has write permissions to theuploads(anduploads/banners) directories. Serve user-uploaded files via the existing/static/:file(and any route that serves/uploads/) so paths match what the app expects.
Summary
| Aspect | Vercel | Self-hosted (Node) |
|---|---|---|
| Database | Use Vercel Postgres or external | Your own PostgreSQL |
| File uploads | Use Blob for banners (and commissions if you add it) | Can use local uploads/ |
| Env vars | In Vercel project settings | In .env or process manager |
| Migrations | Run prisma migrate deploy against prod DB | Same |
| Build | npm run build on deploy | Run before npm start |
