Codebase Structure

Doc Status: Good | ✓ Clear summary | ✓ Easy to read | ✓ Matches code | ✓ Good structure | ✓ Professional look | ✓ Visual components

Top-Level Directory Tree


Per-App Descriptions

apps/website/ — Public Marketing Site

Next.js 16 (App Router), public marketing site — no auth required. Serves course listings, enrollment forms (phiếu), and practice tools.
pnpm dev          # Dev server
pnpm build        # Static export → out/
wrangler deploy   # Deploy to CF Workers Static Assets

apps/admin/ — Internal Staff Dashboard

Next.js 16, internal staff dashboard, auth-gated via Convex Auth. Manages students, courses, attendance, and payments.
pnpm dev          # Dev server on :3001
pnpm build        # Static export
wrangler deploy   # Deploy to admin.wondersound.vn

apps/mobile/ — Student Mobile App

Expo + Expo Router + NativeWind. Student-facing app for accessing course content and tools. Auth via ConvexAuthProvider + expo-secure-store.
pnpm dev          # Expo dev
eas build         # Build for store

apps/lark-sync/ — Lark Webhook Worker

Cloudflare Worker (Hono). HTTP entry point for Lark Base webhook events. Verifies HMAC signature and forwards to Convex httpAction. Does not call the Lark API.
wrangler deploy   # Deploy to CF Workers

apps/meta-conversions-worker/ — Meta CAPI Webhook Worker

Cloudflare Worker (Hono). HTTP entry point for Meta Conversions API webhook events. Verifies signature and forwards to Convex httpAction.
wrangler deploy   # Deploy to CF Workers

Packages

packages/backend/ — Convex Schema + Functions

Convex schema and functions shared by admin and mobile. The convex/ directory uses flat files (no subdirectories) — Convex’s runtime rejects hyphens in module paths.
convex/
├── schema.ts              # defineSchema + all table definitions
├── users.ts              # viewer, list, setRole, bootstrapAdmin
├── students.ts           # student CRUD + phiếu form actions
├── formSubmissions.ts    # form audit log queries + markForRetry
├── products.ts          # product listing query
├── rooms.ts             # Piano Mirror room CRUD
├── signaling.ts         # WebRTC signaling + turnConfig
├── crons.ts             # scheduled jobs
├── auth.ts              # Convex Auth provider config
├── auth.config.ts       # Convex Auth app ID
├── authEmailResend.ts   # Email OTP provider (Resend)
├── http.ts              # HTTP router for auth routes
└── _generated/          # CLI-managed — do NOT edit

packages/ui/ — Shared Components

Shared shadcn/ui primitives and domain components. Used by both website and admin.

docs/ — Documentation

You are here. Mintlify-powered technical documentation.

brd/ — Business Requirements

Non-code authoring docs. Business logic, product decisions, and requirements.