Skip to main content

Frontend

Description

apps/web is a Next.js 14 App Router application in TypeScript. It serves both the UI and the REST API — the Backend section covers the API half; this section covers what runs in the browser.

Stack

ConcernChoice
FrameworkNext.js 14 (App Router), React 18.3.1
StylingTailwind CSS, dark mode by class
Canvas@xyflow/react 12 (React Flow)
EditorCodeMirror 6 with per-language modes
RealtimeNative WebSocket via custom hooks
Callslivekit-client + @livekit/components-react
AuthNextAuth v4
Notificationsreact-hot-toast
OnboardingShepherd.js guided tours
AnimationFramer Motion

:::note React 18 is pinned The root package.json has overrides forcing react and react-dom to 18.3.1 across every workspace. Adding a dependency that needs React 19 will not work without lifting that pin. :::

Route map

Under apps/web/app/:

RoutePurpose
/Landing page
/signin, /signup, /auth/*Authentication
/groups, /create-group, /group/[groupId]Group list, creation, chat
/addGroupMember/[id], /viewMembers/[groupId]Membership management
/chat, /chat-room, /chat/[chatId]Direct messages
/workspace/[groupId]Workspace hub
/workspace/[groupId]/ui-designUI design canvas
/workspace/[groupId]/mind-mapMind map
/workspace/[groupId]/db-schemaSchema designer
/workspace/[groupId]/planningKanban, workflow, milestones
/code-editor/[groupId]/[githubRepo]In-browser IDE
/confirm-changes/[groupId]Change-request review
/githubRepo linking
/join/[token]Invite-link join
/notificationsNotification centre
/bugsBug reports
/profileProfile and connected accounts
/friend-searchUser lookup by phone

Directory conventions

apps/web/app/
├── components/ # Shared UI
│ ├── call/ # Call surface
│ └── bug/ # Bug report widget
├── lib/ # 22 cross-cutting modules
│ ├── prisma.ts # DB client singleton
│ ├── encryption.ts # AES-256-CBC for GitHub tokens
│ ├── wsToken.ts # HMAC WS tokens
│ ├── livekit.ts # Call token minting
│ ├── s3.ts # Object storage
│ └── vcs.ts # Branch/diff/merge helpers
├── workspace/
│ ├── components/ # Canvas shell, cursors, presence
│ └── lib/ # Board hooks and pure helpers
└── api/ # Route handlers → Backend section

Feature-local components live beside their route; only genuinely shared ones go in app/components/.

:::tip packages/ui is mostly unused The monorepo has a packages/ui workspace, but the app keeps its components in app/components/. Do not assume shared components live there. :::

Realtime in the browser

Boards and chat both talk to the WebSocket service through hooks:

  • app/workspace/lib/useWorkspaceSocket.ts — connection, auth, reconnect
  • app/workspace/lib/useWorkspaceBoard.ts — board state, op broadcast, persistence

The board hook is the one to read first: it owns optimistic local updates, throttled broadcast, and debounced saves. See Workspace boards for a walk through its internals.

Next

  • Setup — run the frontend alone
  • Testing — component tests and manual checks