How mrzorawar/connecto works
1. Project shape
- This is a Next.js App Router application for video conferencing.
- The architecture is split into three major areas: auth routes, authenticated dashboard routes, and meeting-room routes.
2. Route and layout boundaries
- src/app/layout.tsx is the top-level shell for the whole app.
- src/app/(auth) contains Clerk-driven sign-in and sign-up pages.
- src/app/(root) contains the authenticated product UI, including dashboard and meeting pages.
- src/app/(root)/layout.tsx and src/app/(root)/dashboard/(home)/layout.tsx provide nested layout boundaries for the private app sections.
3. Authentication boundary
- Authentication is handled by Clerk.
- The route structure with sign-in/[[...sign-in]] and sign-up/[[...sign-up]] is a strong signal that Clerk owns the auth UI and routing.
- src/middleware.ts is the app’s route guard, enforcing that private routes stay behind auth and that unauthenticated users are sent to login flows.
4. Video provider boundary
- src/providers/StreamClientProvider.tsx is the central integration point for Stream Video SDK.
- This provider likely initializes the Stream client using the authenticated user identity and makes the client available to meeting components.
- This keeps Stream setup out of page components and creates a clean boundary between app state and real-time call infrastructure.
5. Server-side Stream token flow
- src/actions/stream.actions.ts is the backend-facing trust boundary for Stream.
- The presence of a dedicated action file suggests the app generates or fetches Stream auth/token data server-side rather than exposing secrets to the browser.
- This is the main data path for secure meeting access: user logs in via Clerk, then the app obtains Stream credentials through a server action.
6. Dashboard subsystem
- The dashboard lives under src/app/(root)/dashboard/(home).
- It includes separate pages for home, personal room, upcoming meetings, and recordings.
- This area is the “meeting management” subsystem: it does not host live calls, but surfaces meeting metadata and user-facing entry points.
7. Meeting subsystem
- src/app/(root)/meeting/[id]/page.tsx is the live meeting entry point.
- The [id] route parameter is the meeting-room identifier, which ties the URL directly to a Stream call/room.
- Components like MeetingRoom, MeetingSetup, MeetingModal, and EndCallButton indicate the lifecycle: create/join, configure devices, run the call, then end it.
8. Meeting data access
- src/hooks/useGetCalls.ts and src/hooks/useGetCallById.ts are the main data-fetching hooks for call history and individual meetings.
- These hooks likely power the dashboard lists and meeting detail views, keeping fetch logic separate from presentation components.
- src/components/CallList.tsx, MeetingCard.tsx, and src/components/new/RecordingCard.tsx are UI consumers of that data.
9. UI composition
- The UI is built from a mix of custom components and ShadCN primitives in src/components/ui.
- Feature-level components such as Navbar, MobileNav, HomeCard, MeetingTypeList, and the new/ folder components suggest a reusable, compositional design system for both dashboard and marketing-style pages.
- The app uses Tailwind and ShadCN as the primary presentation layer.
10. Cross-cutting state and feedback
- Toast/alert infrastructure exists in src/components/Alert.tsx, src/components/ui/toast.tsx, src/components/ui/toaster.tsx, and src/hooks/use-toast.ts.
- src/components/Loader.tsx handles async/loading states.
- These are shared cross-cutting concerns used across auth, dashboard, and meeting flows.
11. Static/config layer
- src/constants/constants.ts, src/lib/utils.ts, and src/lib/mockdata.ts hold shared configuration, helpers, and fallback data.
- components.json, tailwind.config.ts, postcss.config.mjs, and eslint.config.mjs define UI/tooling conventions rather than runtime behavior.
12. End-to-end runtime flow
- A user enters through the auth routes, is protected by middleware, lands in the dashboard, then either creates/join a meeting or opens a historical meeting record.
- When joining a live call, the app uses the Stream provider and server action/token path to enter a room identified by the URL or selected call metadata.
- Stream handles the actual real-time media transport; the app’s responsibility is session orchestration, meeting lifecycle UI, and history/recording surfacing.
13. External services that shape the architecture
- Clerk is the identity system and route gatekeeper.
- Stream Video is the real-time media backend and meeting-state source.
- Vercel is the intended deployment target, which fits the App Router + server actions model.
14. Diagramming takeaway
- The clearest architecture diagram should show three zones: public/auth pages, authenticated dashboard, and live meeting room.
- Connect them through two core backend integrations: Clerk for identity and Stream for call/session execution.
- Put middleware on the route edge, StreamClientProvider around the client runtime, and stream.actions.ts on the secure server boundary.
Main entry points: (home)/layout.tsx Home layout · MeetingRoom.tsx Meeting room UI · (root)/layout.tsx Root layout · stream.actions.ts Stream actions
Components 22
App routes
Next.js route segments and layout boundaries.
- App shell · Top-level application layout for the entire Next.js app.
src/app/layout.tsx - Auth routes · Sign-in and sign-up route group owned by Clerk.
src/app/(auth)/sign-in/[[...sign-in]]/page.tsx - Root layout · Authenticated app layout boundary for the private product area.
src/app/(root)/layout.tsx
Meeting flow
Live call entry, setup, and in-call UI.
- Meeting room · Live meeting entry route keyed by meeting id.
src/app/(root)/meeting/[id]/page.tsx - Meeting room UI · Main in-call component that hosts the live meeting experience.
src/components/MeetingRoom.tsx - Setup · Device and pre-join configuration before entering a call.
src/components/MeetingSetup.tsx - Meeting modal · Modal flow for creating or joining meetings.
src/components/MeetingModal.tsx - End call · Control for terminating an active meeting.
src/components/EndCallButton.tsx
Dashboard
Authenticated meeting management pages.
- Home layout · Dashboard home section layout for the authenticated area.
src/app/(root)/dashboard/(home)/layout.tsx - Home page · Main dashboard landing page.
src/app/(root)/dashboard/(home)/page.tsx - Personal room · User-specific meeting room page in the dashboard.
src/app/(root)/dashboard/(home)/personal-room/page.tsx - Upcoming · Upcoming meetings view.
src/app/(root)/dashboard/(home)/upcoming/page.tsx - Recordings · Recordings history view.
src/app/(root)/dashboard/(home)/recordings/page.tsx
UI layer
Reusable components and presentation primitives.
- Call list · List view for historical or scheduled calls.
src/components/CallList.tsx - Meeting card · Reusable card for meeting summaries and entry points.
src/components/MeetingCard.tsx - Recording card · Card used to present recording items.
src/components/new/RecordingCard.tsx - Navbar · Primary navigation for the authenticated UI.
src/components/Navbar.tsx
Infra
Shared cross-cutting and integration boundaries.
- Stream provider · Client-side Stream Video SDK provider and runtime boundary.
src/providers/StreamClientProvider.tsx - Stream actions · Server-side trust boundary for Stream credential and token flow.
src/actions/stream.actions.ts - Route guard · Authentication gate that protects private routes and redirects unauthenticated users.
src/middleware.ts - Calls hook · Fetches call history and meeting collections for the dashboard.
src/hooks/useGetCalls.ts - Call by id · Fetches a single call or meeting by identifier.
src/hooks/useGetCallById.ts
Connections 25
- App shell → Auth routes: routes · Top-level shell renders public auth pages.
- App shell → Root layout: routes · Top-level shell renders authenticated app routes.
- Route guard → Auth routes: allows · Unauthenticated users can access Clerk auth flows.
- Route guard → Root layout: protects · Private routes are guarded behind authentication.
- Auth routes → Root layout: sign-in · Successful login transitions into the private app.
- Root layout → Home layout: contains · Authenticated layout nests the dashboard home section.
- Home layout → Home page: hosts · Home layout frames the dashboard landing page.
- Home layout → Personal room: hosts · Home layout frames the personal room page.
- Home layout → Upcoming: hosts · Home layout frames upcoming meetings.
- Home layout → Recordings: hosts · Home layout frames recordings history.
- Home page → Navbar: uses · Dashboard pages share the main navigation.
- Home page → Call list: shows · Dashboard surfaces call history and meeting items.
- Upcoming → Calls hook: loads · Upcoming meetings are populated from call data.
- Recordings → Calls hook: loads · Recordings page derives items from meeting history.
- Call list → Meeting card: renders · Call lists are composed from meeting summary cards.
- Recordings → Recording card: renders · Recordings are shown using dedicated recording cards.
- Meeting room → Call by id: loads · Meeting route resolves the call by URL id.
- Meeting room → Stream provider: wraps · Live meeting UI runs inside the Stream client provider.
- Meeting room → Meeting room UI: opens · The meeting route mounts the live room experience.
- Meeting room UI → Setup: pre-join · Users configure devices before entering the call.
- Meeting room UI → End call: controls · In-call UI exposes call termination controls.
- Meeting modal → Stream actions: requests token · Create/join flows rely on server-side Stream credentials.
- Meeting room UI → Stream actions: authorizes · Live call participation depends on secure Stream session data.
- Stream provider → Stream actions: authenticates · Client provider consumes server-generated Stream access data.
- Calls hook → Stream actions: fetches · Meeting lists may depend on Stream-backed server data.