Skip to content

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.

How the projects connectBrowsers and the Desktop app reach the Router, which sends the admin host to Admin, /app to App, /docs to Docs, the CDN host to R2 storage and everything else to Marketing. AI tools reach the MCP Worker on its own host, and the developer site has its own host too. App, Admin, Marketing and the MCP Worker read and write Supabase.admin host/app/docscdn hosteverything elsedeveloper hostBrowserRouterDesktop appAdminAppDocsR2 storageMarketingAI toolMCP WorkerDeveloper siteSupabase

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:

A Coffee gift from the Public page to the databaseThe Router passes the page to Marketing. The gift form's action calls sslcommerz-init, Rahim pays on SSLCOMMERZ, and SSLCOMMERZ notifies sslcommerz-ipn, which writes the Coffee gift.open thePublic pagerender thepagesend the gift formstart a paymentpayment pagepay ৳60payment notificationwrite theCoffee giftRahimRouterMarketingsslcommerz-initSSLCOMMERZsslcommerz-ipnRahimRouterMarketingsslcommerz-initSSLCOMMERZsslcommerz-ipn
  1. The Router finds no admin host, /app or /docs match and passes the request to the marketing Worker, which renders apps/marketing/src/pages/@[handle]/index.astro.
  2. Rahim submits the gift form. That runs an Astro Action (a server function the form posts to): gift.send in apps/marketing/src/pages/@[handle]/_components/_gift/actions/gift.ts. It calls the sslcommerz-init Edge Function (a server function that runs on Supabase) through apps/marketing/src/services/gift.service.ts and apps/marketing/src/lib/sslcommerz-init.ts.
  3. sslcommerz-init stores a row in payment_sessions and returns the payment page of SSLCOMMERZ, the payment gateway. Rahim pays there.
  4. SSLCOMMERZ sends an IPN (instant payment notification) straight to the sslcommerz-ipn Edge Function on Supabase, not through the Router. That function runs perform_coffee_gift, which writes the Coffee gift (stored in coffee_gifts, apps/backend/supabase/schemas/services/coffee_gifts.sql).
  5. Rahim's browser comes back to /checkout/callback on the marketing site, which checks the payment and sends him back to the page he gave from.

Key parts ​

PartWhere it livesWhat it does
Routerapps/routerWorker with no UI: sends each request to a project, serves the CDN host, shows the maintenance page
Marketingapps/marketingPublic site: landing page, blog, Public pages, shop and checkout, rendered by Astro on the server
Appapps/appCreator dashboard, a React single-page app under /app; talks to Supabase from the browser
Adminapps/adminManager dashboard on admin.hobenakicoffee.com, built with TanStack Start
Docsapps/docsPublic guides for Creators and Supporters under /docs, in Bangla and English
MCP Workerapps/mcpLets a Connected app (an AI tool a user allowed) act for them, on mcp.hobenakicoffee.com
Desktop appapps/desktopDesktop shell built with Tauri (a toolkit for native windows) that loads the hosted app
Developer siteapps/developerThese docs, on developer.hobenakicoffee.com
Backendapps/backendSupabase: database schema, migrations, Edge Functions and their tests
Shared librariespackages/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 imports apps/backend. Check a change with bunx 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.