System overview
The product is nine projects in apps/, each deployed on its own, so a change to one audience's site never ships another's. Creators work in the app, Managers (the platform's staff) in the admin, and Supporters and everyone else land on the marketing site or the public guides. All of them keep their data in one Supabase backend, and they share code only through the libraries in packages/.
How it fits together
Seven projects are Cloudflare Workers: small server programs that run on Cloudflare's network, each configured by its wrangler.jsonc. Every request to hobenakicoffee.com, its www and admin hosts and the CDN (content delivery network) host reaches the Router Worker first. The Router redirects the www hosts to the bare host and picks the project for everything else by host and path (apps/router/src/index.js). The MCP (Model Context Protocol) Worker, which AI tools call, and the developer site have their own hosts and skip the Router.
R2 is Cloudflare's file storage; the Router serves its public buckets on cdn.hobenakicoffee.com. The Desktop app opens https://hobenakicoffee.com/app/ (apps/desktop/src/app_url.rs), so it goes through the Router like a browser. The public guides have no backend of their own: their feedback form posts to /api/docs-feedback (apps/docs/src/components/Feedback.astro), which the Router sends to marketing.
Example: Rahim sends Nusrat a Coffee gift
Rahim opens Nusrat's Public page at /@nusrat. Her page is a Demo profile, so its gift form only shows a notice that nothing is charged. On a real Creator's Public page, the same three coffees (৳60) with a message travel like this:
- The Router finds no admin host,
/appor/docsmatch and passes the request to the marketing Worker, which rendersapps/marketing/src/pages/@[handle]/index.astro. - Rahim submits the gift form. That runs an Astro Action (a server function the form posts to):
gift.sendinapps/marketing/src/pages/@[handle]/_components/_gift/actions/gift.ts. It calls thesslcommerz-initEdge Function (a server function that runs on Supabase) throughapps/marketing/src/services/gift.service.tsandapps/marketing/src/lib/sslcommerz-init.ts. sslcommerz-initstores a row inpayment_sessionsand returns the payment page of SSLCOMMERZ, the payment gateway. Rahim pays there.- SSLCOMMERZ sends an IPN (instant payment notification) straight to the
sslcommerz-ipnEdge Function on Supabase, not through the Router. That function runsperform_coffee_gift, which writes the Coffee gift (stored incoffee_gifts,apps/backend/supabase/schemas/services/coffee_gifts.sql). - Rahim's browser comes back to
/checkout/callbackon the marketing site, which checks the payment and sends him back to the page he gave from.
Key parts
| Part | Where it lives | What it does |
|---|---|---|
| Router | apps/router | Worker with no UI: sends each request to a project, serves the CDN host, shows the maintenance page |
| Marketing | apps/marketing | Public site: landing page, blog, Public pages, shop and checkout, rendered by Astro on the server |
| App | apps/app | Creator dashboard, a React single-page app under /app; talks to Supabase from the browser |
| Admin | apps/admin | Manager dashboard on admin.hobenakicoffee.com, built with TanStack Start |
| Docs | apps/docs | Public guides for Creators and Supporters under /docs, in Bangla and English |
| MCP Worker | apps/mcp | Lets a Connected app (an AI tool a user allowed) act for them, on mcp.hobenakicoffee.com |
| Desktop app | apps/desktop | Desktop shell built with Tauri (a toolkit for native windows) that loads the hosted app |
| Developer site | apps/developer | These docs, on developer.hobenakicoffee.com |
| Backend | apps/backend | Supabase: database schema, migrations, Edge Functions and their tests |
| Shared libraries | packages/ | Code the apps share: constants, types, utilities, email templates, the cast drawings |
Run any project with bunx nx dev @hobenakicoffee/<project>; Getting started has the full setup.
Gotchas
- Imports follow fixed boundaries: an app imports only packages from
packages/, a package never imports an app, and nothing importsapps/backend. Check a change withbunx nx run-many -t boundaries. - The Router has a service binding (a direct Worker-to-Worker link) to the developer site, used only by the signed release probe (
apps/router/src/release-health.js) to see that the site is up. It never routes a request there, so the developer site is reached only on its own host.
Related
- Router: the routing order and Maintenance mode.
- Backend: the Supabase schema and Edge Functions.
- Coffee gifts: the gift form and its action in depth.
- Getting started: run the projects locally.