A cloud dashboard + print queue for a BIQU B1 SE Plus, deployed on Railway and driving OctoPrint on a Raspberry Pi at home. Upload g-code from anywhere, queue prints, watch temps/progress, pause/cancel, and get Discord notifications — without opening a port on your home router.
[B1 SE Plus] --USB--> [Raspberry Pi: OctoPi + cloudflared]
│ events out (started/done/failed/cancelled)
▼
[Railway: Next.js dashboard + API + Postgres queue] ◀── maxsutton.dev/3dprinter
▲
│ API calls in (upload, start, pause, temps)
Cloudflare Tunnel back to the Pi
Railway lives in the cloud and can't reach the Pi through a home router, so a Cloudflare Tunnel gives the backend a way in. The queue's source of truth is Railway Postgres — OctoPrint just executes whatever it's told and reports back.
- Next.js 14 (App Router) — dashboard UI + API routes, served under
basePath: /3dprinter - Prisma + PostgreSQL — the durable print queue
- OctoPrint REST API — reached through the Cloudflare Tunnel
- Background ticker (
src/lib/ticker.ts) — safety net that re-dispatches the queue if a webhook is ever missed
Full hardware, OctoPi, Cloudflare Tunnel, and Railway deployment instructions are in SETUP.md.
npm install
cp .env.example .env # fill in DATABASE_URL, OCTOPRINT_URL, secrets, etc.
npm run dev # http://localhost:3000/3dprinterAll routes live under …/3dprinter/api and accept Authorization: Bearer $API_TOKEN
for scripting (the inbound webhook uses a separate X-Webhook-Secret). See the API
reference table in SETUP.md.