How dinesh-dk007/codesync works
Purpose and runtime
CodeSync is a browser-based technical-interview platform: authenticated users schedule or join interview meetings with shared coding, challenge context, and live audio/video. It runs as a Next.js App Router application, deployed for Vercel, with Convex as the realtime backend and Stream for call transport. Core entry points are src/app/layout.tsx, src/app/(root)/(home)/page.tsx, and convex/schema.ts.
Application routing and access boundary
The route tree separates general interview workflows from administration. Root pages cover home, scheduling, recordings, and per-meeting sessions; the admin dashboard is isolated under its own route group. Request-level access handling is centralized in src/middleware.ts. Key routes: src/app/(root)/meeting/[id]/page.tsx, src/app/(root)/schedule/page.tsx, and src/app/(admin)/dashboard/page.tsx.
Client provider composition
The root UI is wrapped by providers that establish cross-cutting client state: Convex plus Clerk identity, Stream client connectivity, and theme state. This is the principal integration boundary between React UI and external services. Paths: src/app/layout.tsx, src/components/providers/ConvexClerkProviders.tsx, src/components/providers/StreamClientProvider.tsx.
Meeting lifecycle and call orchestration
Meeting creation, lookup, joining, and termination are represented in UI components and hooks, with Stream server-side/token-related actions supplying call access. The meeting route resolves a call by ID, then renders setup or active-room experiences. Paths: src/components/MeetingSetup.tsx, src/components/MeetingRoom.tsx, src/actions/stream.actions.ts.
Collaborative interview workspace
The active room combines Stream communications with the interview-specific workspace: code editing, problem-oriented interaction, and comments. UI components define this collaboration boundary while persisted interview state is managed through Convex. Paths: src/components/CodeEditor.tsx, src/components/CommentDialog.tsx, convex/interviews.ts.
Convex domain backend
Convex owns realtime application data and mutations/queries for users, interviews, meeting-code resolution, and comments. Its schema is the durable domain contract; generated bindings connect frontend code to typed backend APIs. HTTP/auth configuration provides backend integration points. Paths: convex/schema.ts, convex/interviews.ts, convex/comments.ts.
Scheduling, discovery, and recordings flow
Users schedule interviews, retrieve available calls, and view past recordings through route-level screens backed by call-oriented hooks. These screens consume Convex/Stream-derived meeting data rather than maintaining an independent application server. Paths: src/app/(root)/schedule/InterviewScheduleUI.tsx, src/app/(root)/recordings/page.tsx, src/hooks/useGetCalls.ts.
Identity, roles, and external services
Clerk supplies authentication and is connected to Convex through backend auth configuration; user records and roles support interviewer/candidate/admin-oriented behavior. Stream.io provides low-latency calling and recordings, while Convex provides reactive persistence. Paths: convex/auth.config.ts, convex/users.ts, src/hooks/useUserRole.ts.
Main entry points: page.tsx Interview routes · ConvexClerkProviders.tsx Convex + Clerk provider · MeetingRoom.tsx Meeting setup and room · CodeEditor.tsx Collaborative workspace
Components 21
Next.js web app
- Access middleware · Centralizes request-level access handling.
src/middleware.ts - Interview routes · Home, scheduling, recordings, and meeting workflows.
src/app/(root)/(home)/page.tsx - Meeting session route · Resolves a meeting by call ID.
src/app/(root)/meeting/[id]/page.tsx - Scheduling UI
src/app/(root)/schedule/InterviewScheduleUI.tsx - Recordings screen
src/app/(root)/recordings/page.tsx - Admin dashboard
src/app/(admin)/dashboard/page.tsx - Client providers · Composes identity, realtime, call connectivity, and theme state.
src/app/layout.tsx - Convex + Clerk provider
src/components/providers/ConvexClerkProviders.tsx - Stream client provider
src/components/providers/StreamClientProvider.tsx - Meeting setup and room · Transitions users from call setup into an active room.
src/components/MeetingRoom.tsx - Collaborative workspace · Shared coding and comment interaction inside the active room.
src/components/CodeEditor.tsx - Call discovery hook · Retrieves available and past calls.
src/hooks/useGetCalls.ts - User role hook
src/hooks/useUserRole.ts
Convex backend
- Domain schema · Durable contract for users, interviews, and comments.
convex/schema.ts - Interview domain API · Realtime interview state and meeting-code resolution.
convex/interviews.ts - Comment domain API
convex/comments.ts - User domain API · User records and role-oriented behavior.
convex/users.ts - Convex auth config · Connects Clerk identity to Convex.
convex/auth.config.ts
External services
- Stream call actions · Supplies call creation and access tokens.
src/actions/stream.actions.ts - Clerk
- Stream.io · Provides live audio/video transport and recordings.
Connections 23
- Access middleware → Interview routes: guards requests
- Access middleware → Admin dashboard: isolates access
- Client providers → Convex + Clerk provider: composes
- Client providers → Stream client provider: composes
- Convex + Clerk provider → Clerk: authenticates with
- Convex + Clerk provider → Convex auth config: connects identity
- Stream client provider → Stream.io: connects calls
- Interview routes → Scheduling UI: scheduling flow
- Interview routes → Recordings screen: recordings flow
- Scheduling UI → Call discovery hook: discovers calls
- Recordings screen → Call discovery hook: loads past calls
- Meeting session route → Meeting setup and room: renders setup or room
- Meeting setup and room → Stream call actions: gets call access
- Stream call actions → Stream.io: creates and authorizes calls
- Meeting setup and room → Collaborative workspace: hosts
- Collaborative workspace → Interview domain API: syncs interview state
- Collaborative workspace → Comment domain API: persists comments
- Call discovery hook → Interview domain API: reads meeting data
- User role hook → User domain API: reads role data
- Admin dashboard → User role hook: uses authorization role
- Interview domain API → Domain schema: uses
- Comment domain API → Domain schema: uses
- User domain API → Domain schema: uses