How sunithvs/jiobase works
1. Repository shape and deployment model
JioBase is a pnpm monorepo split into three runtime applications plus shared libraries and a CLI. The production stack is intentionally Cloudflare-centric: a reverse proxy Worker, a management API Worker, and a SvelteKit frontend deployed on Cloudflare Pages.
2. End-user request path: the reverse proxy
apps/proxy is the runtime that actually sits in the traffic path. It accepts requests on a slug.jiobase.com subdomain, resolves the target Supabase project from app config, and forwards HTTP traffic and WebSockets transparently to the upstream Supabase origin. The proxy is the core boundary between Indian ISP-facing traffic and the blocked *.supabase.co destination.
3. Management plane: the API Worker
apps/api is a Hono-based API on Cloudflare Workers. It handles account/app management, authentication, and operational concerns for the dashboard. Its route split suggests two main domains: auth for user/session flows and apps for CRUD and configuration of proxied apps.
4. Persistence and state
The API uses Cloudflare D1 with Drizzle ORM for persistent metadata. The presence of migrations and schema.ts indicates a relational model for users, apps, and related settings. Cloudflare KV is used alongside D1 for synchronization or cached operational state, reflected by the kv-sync service.
5. Security and abuse controls
The API has dedicated middleware for authentication and rate limiting. Password hashing utilities and ID generation helpers live under src/lib, which implies the API owns user identity creation and credential verification rather than delegating those concerns to the frontend.
6. Frontend: marketing site, docs, and dashboard
apps/web is a SvelteKit application that combines public content, documentation, blog posts, and the authenticated dashboard. Route groups separate concerns: landing and informational pages, blog content, docs, fix/guides sections, and dashboard pages for creating and editing apps.
7. Frontend-to-API boundary
The web app uses a small client API layer and an auth store, showing a clear boundary where the browser talks to the management API for login, registration, and dashboard actions. Server-side route modules under fix/[slug] and guides/[framework] indicate some pages also fetch or compute data during SSR/build time.
8. Content and conversion surfaces
The web app is not just a dashboard; it also serves SEO-heavy educational content around Supabase blocking in India, self-hosting, and proxy usage. Components like donation gates, related pages, blog suggestions, and platform installers show that content, onboarding, and conversion are first-class parts of the product architecture.
9. Shared contracts across apps
packages/shared contains constants, types, and validation logic reused by the API, web app, proxy, and CLI. This package is the repo’s contract layer, keeping configuration formats, enums, and input validation consistent across deployment targets and reducing drift between services.
10. CLI and scaffolding flow
packages/cli provides a create-jiobase command that scaffolds worker-based projects from templates. It generates starter files such as wrangler.toml, package.json, tsconfig, and worker entrypoints, which means the repo includes a developer-facing product surface for bootstrapping self-hosted or companion Workers.
11. Infrastructure and build boundaries
Each app has its own wrangler.toml, .env.example, and TypeScript config, reinforcing that they are deployed independently even though they share code. Drizzle migrations are checked into the API app, while the web app is built through SvelteKit/Vite and the proxy/API are built for the Workers runtime.
12. Overall system diagram view
The main data flow is: browser or app client → apps/web for dashboard/login/content → apps/api for app/account management → D1/KV for persistence and operational state → apps/proxy for live request forwarding to Supabase. The proxy is the runtime traffic plane, the API is the control plane, and the web app is the operator-facing UI plus public site.
Main entry points: api API · proxy Proxy · web Web · cli CLI
Components 18
Applications
Deployable runtime apps and the public site
- Web · Public marketing site, docs, blog, and authenticated dashboard
apps/web - Routes · Landing pages, blog, docs, guides, fix pages, auth screens, and dashboard views
apps/web/src/routes - Components · Reusable UI for onboarding, conversion, navigation, and content presentation
apps/web/src/lib/components - API Client · Frontend boundary for login, registration, and dashboard actions
apps/web/src/lib/api.ts - Auth Store · Client-side auth state for the dashboard and account flows
apps/web/src/lib/stores/auth.svelte.ts - API · Management plane for auth, app CRUD, and operational control
apps/api - Auth Routes · User registration, login, and session handling
apps/api/src/routes/auth.ts - App Routes · CRUD and configuration endpoints for proxied apps
apps/api/src/routes/apps.ts - Middleware · Authentication and rate limiting around API requests
apps/api/src/middleware - Proxy · Traffic plane that forwards slug-based requests to upstream Supabase
apps/proxy - Handler · Resolves target projects and forwards HTTP traffic transparently
apps/proxy/src/handler.ts - WebSocket · WebSocket forwarding path for live upstream connections
apps/proxy/src/websocket.ts - Config · Runtime configuration and origin mapping for slug routing
apps/proxy/src/config.ts
Shared Packages
Reusable contracts and developer tooling
Platform State
Persistence and external services
- D1 · Persistent metadata store for users, apps, and settings
- KV · Operational cache or synchronization state paired with D1
- Supabase · Blocked or proxied backend destination for live application traffic
Connections 20
- Web → Routes: renders · Page routing and SSR content live here
- Web → Components: uses · Pages compose reusable UI components
- Web → API Client: calls · Browser-side actions talk to the management API
- Web → Auth Store: tracks · Client session state for authenticated dashboard flows
- API Client → API: HTTP · Login, registration, and dashboard requests
- API → Auth Routes: serves · Auth endpoints are mounted in the worker
- API → App Routes: serves · App management endpoints are mounted in the worker
- API → Middleware: protects · Authentication and rate limits wrap routes
- API → D1: persists · Primary relational storage for metadata
- API → KV: syncs · Operational cache / synchronization state
- API → Shared: shares contracts · Uses common types and validation with other runtimes
- Proxy → Config: configures · Loads slug and origin mapping at runtime
- Proxy → Handler: executes · Core request forwarding path
- Proxy → WebSocket: tunnels · WebSocket forwarding path for upstream connections
- Proxy → Shared: shares contracts · Uses shared config and validation shapes
- Handler → Supabase: forwards to · Transparent HTTP proxy to upstream origin
- WebSocket → Supabase: bridges to · WebSocket traffic is relayed upstream
- CLI → Shared: validates with · Uses shared schema and config rules for scaffolding
- CLI → Proxy: generates · Creates worker-style starter projects similar to runtime apps
- CLI → API: generates · Scaffolds worker-based project templates