Repository layout
What each top-level folder holds, how the backend and the web app are organised inside, and which files are leftovers.
One repository holds both applications, the Docker setup, these docs and the plans. Each application has its own dependencies and its own lockfile, and there is no shared workspace at the root, so the backend and the web app install and build independently.
Top level
| Folder | Holds | Becomes |
|---|---|---|
backend | The API, the AI reply agent and the campaign engine, plus the database schema, seeds and agent eval scripts | The backend image, or the backend dev container |
frontend | The React web app | The web app image (nginx), or the Vite dev container |
docker | The one dev image every dev container runs: Node to run the code, bun to install and run scripts, with the container user matched to yours | The dev containers |
docs | This site, its screenshot capture pipeline, and the design specs and plans written before a feature is built | The docs site |
plans | Implementation plans, one folder per piece of work, such as the redesign and this docs site | Nothing; read by people |
.superdesign | The design system for redesign B, brand and logo sources, research notes, and the master images for this site | Nothing; the docs publish copies of the images |
.github | The only CI job: backend tests with coverage on pushes and pull requests to main that touch the backend | A CI run |
tmp | Local scratch, ignored by git | Nothing |
The Compose file at the root describes every service for both the dev and the prod profile, and the comments at its top are the shortest account of how the stack runs. .env.example at the root is the template for the values Compose reads.
A larger change usually moves through the folders in this order:
- 1 Spec Design spec in the docs folder
- 2 Plan Implementation plan in the plans folder
- 3 Backend Schema, service, routes, tests
- 4 Web app API calls, queries, pages
- 5 Docs Pages and screenshots in both languages
Inside the backend
The backend is organised by business area: accounts, sign-in, CRM, content and knowledge, the reply agent, the campaign engine, analytics, and third-party integrations. Under them sits a shared infrastructure layer that every area uses: database access, the messaging clients for each channel, the model clients, the event bus, the cache, file storage and the locks. A thin layer of plain helpers (errors, pagination, small utilities) has no framework wiring at all.
Every area has the same shape. HTTP routes, bus subscribers, agent tools and campaign steps are all entry points, and they all call the area’s services, where the domain rules live:
- 1 Entry point HTTP route, bus subscriber, agent tool or campaign step
- 2 Input schema Request bodies and queries checked
- 3 Service The area's domain rules, in one place
- 4 Database Reads and writes through one client
- 5 Events and errors Events for other areas; errors from the area's own list
Besides the code, the backend folder holds the database schema split into one file per area, the hand-written SQL that runs before a schema push, the demo seeds, and the scripts that evaluate the agent and check stored campaigns. Several areas keep notes of their own in a README next to their code.
Inside the web app
The web app is organised by feature area: people, inbox, campaigns, deals, reports and so on. An area holds its pages and components, and for each entity three small layers: the API calls, the query keys and hooks that cache the results, and the types.
- 1 Route Each page is loaded lazily
- 2 Page The feature area's screen
- 3 Query hook Cached server data
- 4 API client Adds the token, refreshes it
- 5 Backend Through /api
Shared across areas: the base UI primitives (buttons, inputs, modals), the redesign B building blocks (page header, empty state, fit score pill, kanban board, icons), the single HTTP client, the reader for the inbox stream, and two small stores, one for the session and one for the campaign builder’s working graph. A build plugin bundles only the icons whose full names appear in the source. The mascot and illustration images the app shows live in its public folder.
Leftovers
These files are tracked, and each describes an older state of the repository:
| Where | What |
|---|---|
| Web app folder | Agent instructions that point at a workflow folder git ignores, so a fresh clone has none of it |
| Web app folder | A text file meant to hold the folder tree, which holds only the error from a missing command |
| Web app folder | A committed build of the app used for the product demo video |
| Web app folder | The old binary lockfile, next to the current text lockfile |
| Backend folder | A README that says to test with npm and quotes 540 tests in 77 suites. The suite runs with bun and had 1253 tests in 142 suites on 2026-11-11. |
| Backend folder | A Vietnamese checklist drawn from the agent evaluation rounds, a Vietnamese to-do list, and an older plan for the email builder |