u/Past_Ant4099

I built a single-file admin panel for D1 — paste one worker.js into the dashboard, no CLI needed

I built a single-file admin panel for D1 — paste one worker.js into the dashboard, no CLI needed

I develop entirely from an Android phone (no laptop), so wrangler was never an option for me. Cloudflare's D1 dashboard works, but browsing data and running quick queries on mobile is painful.

So I built D1 Admin: a single worker.js file, ~420 lines, zero dependencies. Deploy path is literally copy → paste → save in the Cloudflare dashboard, bind your D1 database, set a password. You get a phpMyAdmin-style panel: browse tables, run queries, insert/edit rows. Mobile-first UI, because that's the only way I could use it myself.

A few implementation notes:

- Everything (HTML/CSS/JS included) is embedded in the worker — no external requests, works on the free tier.

- Multi-statement SQL is rejected with string-literal-aware parsing, not a naive semicolon split (WHERE name = 'a;b' works fine).

- Password-gated with timing-safe comparison. It's meant for a single admin user — limitations are in the README.

Repo: https://github.com/amirmahdavi2023/d1-admin

Feedback welcome, especially if you try it on a real database. And if anyone else is stuck with a mobile-only dev setup, happy to compare notes.

u/Past_Ant4099 — 2 days ago