Codebase
Apps
What each app owns, how routes are organized, and where to implement changes.
The monorepo has three Next.js applications, each with a distinct ownership boundary.
apps/app owns end-user product behavior: chat/research workflows, authenticated product routes, and primary API entrypoints.
apps/admin owns internal operations workflows: moderation, tracing/log visibility, and subscription/usage operational views.
apps/web owns the public marketing and legal surfaces with localized public routes.
apps/app (@ai/app)
Main product application for end users.
What it owns
- authenticated dashboard UX (
chat,projects,billing,instruments) - public auth/share screens (
sign-in,sign-up, share views) - primary API surface under
src/app/api/* - AI orchestration pipeline and handlers in
src/lib/ai/* - Telegram webhook entrypoint and integration logic (optional)
Key structure
apps/app/src/
actions/
app/
components/
i18n/
lib/
ai/
telegram/
auth.ts
proxy.tsNotable API domains
/api/chat+/api/chat/[id]/stream/api/billing/*/api/files/*/api/instruments/*/api/artifact*and/api/share/*/api/webhooks/telegram
apps/admin (@ai/admin)
Internal operations/admin dashboard.
What it owns
- operator workflows for moderation and support
- trace and log visibility
- usage/payment/subscription/user reporting
- admin authentication surface and admin-only APIs
Key structure
apps/admin/src/
actions/moderation/
app/[locale]/(auth)/
app/[locale]/(dashboard)/
chats/ traces/ users/ subscriptions/ payments/ usage/ logs/
app/api/
lib/
proxy.tsapps/admin uses its own auth setup with admin-specific behavior and cookie isolation.
apps/web (@ai/web)
Public marketing website.
What it owns
- marketing pages and public legal/offer pages
- localized public routing
- light integration with shared UI/i18n/analytics packages
Key structure
apps/web/src/
app/[locale]/
components/
i18n/
proxy.tsChoosing Where to Implement Changes
- User-facing product behavior:
apps/app - Operational/admin tooling:
apps/admin - Marketing/public pages:
apps/web - Reusable business/platform logic:
packages/*