Flagship/Edge platform
GSites
Static site hosting on the edge
Deploying a small static site still means a repo, a build and a CI pipeline. GSites skips all of it: paste code into an in-browser editor, upload a folder or ZIP - or a single React .jsx file - and it is live on Cloudflare's edge in seconds, with immutable versions and one-click rollback.
- Built with
- What sets it apart
- Deploy a React app from one .jsx file: GSites wraps it with React and Babel automatically - no build step, no config.
§ 01
Problem
For a landing page, a demo or a one-file React prototype, the usual path - create a repo, configure a build, wire up CI, pick a host - costs more time than the site itself.
§ 02
Architecture
- 01
Dashboard
A React app with a Monaco editor, file explorer and live preview, plus upload by files, folder or ZIP.
- 02
Edge API
A single Cloudflare Worker built on Hono: authenticated routes for sites, uploads, editor saves, publish, rollback, downloads and analytics, and public routes that serve the sites themselves.
- 03
File storage (KV)
Every file is stored under
sites:{slug}:v{version}:{path}with its content type as metadata. Unpublished editor changes live under separate draft keys. - 04
Metadata (D1)
SQLite on D1 holds sites, deployments, per-version file lists and analytics. A deploy writes all of its rows in one batch.
- 05
Delivery
Live sites are served from
/{slug}using the active version; any older version stays reachable at/{slug}/_versions/v{n}for preview.
§ 03
Key decisions
Immutable versions
A deploy never overwrites files; it writes a new version and moves the site's active pointer. Rollback is a pointer change, and every past version can still be previewed.
KV for bytes, D1 for relationships
KV is a fast key-value read at the edge for serving files; D1 handles the queries KV can't - listing versions, counting storage, aggregating analytics.
Single-file React without a build step
An uploaded .jsx file is rewritten - React imports removed, the default export mapped to App - and wrapped in an HTML page that loads React and Babel from a CDN, so it runs as-is.
Validate every upload on the server
Paths are normalised and path traversal rejected, executables and dotfiles such as .env are blocked, only static file types are accepted, and uploads are capped at 1,000 files, 10 MB per file and 50 MB in total.
§ 04
Hard parts
- Accepting folders and ZIPs from any tool: stripping a shared top-level folder, rejecting duplicate paths and requiring an index.html at the root.
- Publishing editor drafts safely: copying the active version plus any drafts into a new version before switching, then clearing the drafts.
- Per-site analytics recorded from the same request that serves the page, with browser, device, OS and referrer derived at the edge.
§ 05
The product
A self-serve static hosting platform. Projects are written or pasted into a Monaco (VS Code engine) editor with a file explorer and live preview, or uploaded as files or a ZIP, then deployed with one click. A Cloudflare Workers API built on Hono serves each site from the edge, storing files in KV under versioned keys and site, deployment, file and analytics records in D1. Every deploy is an immutable version that can be previewed at its own URL and restored with one click, and each site gets its own traffic analytics. Accounts sign in with email or phone OTP, and an admin dashboard covers users and activity.
My part
- Designed the storage model: versioned KV keys for file bytes, D1 for sites, deployments, files and analytics.
- Single-file React deploys, versioned previews, one-click rollback and per-site analytics.
Where it is now
Live at gsites.vercel.app with editor, uploads, versioned deploys, rollback, analytics, OTP sign-in and an admin dashboard.