Skip to content

Repo layout

One Bun workspace. TypeScript strict, ESM only.

apps/app Vue 3 + Vite SPA: staff app and customer portal (/portal), Rapport shell, PWA
apps/www Astro landing page (www.cemco.app)
apps/docs Astro Starlight: user guide and developer docs (docs.cemco.app)
workers/web cemco-web: hostname router, static assets, same-origin proxies
workers/api cemco-api: Hono API, CrmService RPC, queue consumer, cron
workers/auth cemco-auth: better-auth, AuthService RPC
workers/mcp cemco-mcp: MCP server, codemode, MCP Apps views host
workers/agents cemco-agents: Agents (Durable Objects), Workflows, email handler
packages/core constants, Zod schemas, business rules, the operation registry, typed client
packages/db D1 migrations, seed data, typed query helpers
packages/ui Rapport kit CSS/JS (unchanged) + Cemco tokens, fonts and shared styles
packages/views MCP Apps in-chat views (Lit), each built to one HTML file
prototype/ the earlier static prototypes, kept for reference
docs/ requirements (PRD, prototype handoff, screenshots) and the design contract
scripts/ setup, dev and deploy scripts
workers/api/src
app.ts Hono routes: /v1/ops/:name, /v1/ops, /v1/openapi.json, /v1/me, documents, calendar feed, invites
index.ts default export (fetch, queue, scheduled) and the CrmService entrypoint
framework/ dispatch (roles, validation, customer scoping, audit), actor mapping, signing, OpenAPI
handlers/<group>.ts one file per operation group
events.ts queue consumers (status emails, alerts)
workers/api/test Vitest in workerd with a real local D1
  • @cemco/core has no runtime dependencies besides Zod and never touches storage. Import from subpaths (@cemco/core/constants, /schemas, /rules, /operations, /errors, /auth, /client) to keep bundles small.
  • @cemco/db: migrations in packages/db/migrations, the seed builder in packages/db/scripts, and helpers: mapRow, insertStatement, updateStatement, the Where builder, nextSequence, ftsQuery, reindexSearch.
  • @cemco/ui: import "@cemco/ui/styles.css" for fonts, kit, tokens and Cemco additions; setTheme, toggleTheme and BRAND from @cemco/ui. The kit/ files are the unmodified Rapport kit; a test checks their hash.
  • Money is integer cents, dates are ISO 8601 text, ids are UUIDs (crypto.randomUUID()).
  • The API is camelCase; the database is snake_case.
  • New packages use caret ranges, never exact pins.
  • No React. Vue in the app, Lit in the views, Astro for www and docs.
  • No secrets in the repo. Each Worker documents its settings in .dev.vars.example.