How abhinavborah/loom-video-conference works
Project type and purpose
• This is a full-stack React/Next.js (App Router) web application bootstrapped with Create Next App.
• From the file tree and UI names (MeetingRoom, CallList, StreamClientProvider, stream.actions.ts), it’s clearly a video/audio call scheduling and room application that uses a third-party streaming service (Stream).
File structure
• Top-level “app” directory: Next.js 13+ App Router layout, routing, and page.tsx files for auth (sign-in, sign-up), home (personal-room, recordings, upcoming, etc.), and dynamic meeting pages by ID.
• “components/ui”: reusable presentational React components (buttons, cards, modals, navbar, sidebar).
• “actions/stream.actions.ts”: wrappers around HTTP calls (fetch/POST) to the streaming service’s API.
• “hooks”: custom React hooks (useGetCalls, useGetCallById) that encapsulate data fetching logic and internal state.
• “providers/StreamClientProvider.tsx”: React Context provider that instantiates the streaming client and makes it available throughout the component tree.
• “lib/utils.ts” & “constants/index.ts”: shared utility functions and constants (endpoints, keys).
• “middleware.ts”: Next.js middleware (likely for auth checks or request logging).
• Configuration & styling: next.config.mjs, tailwind.config.ts, postcss.config.js, globals.css.
README for additional insights
• Standard Next.js docs are referenced; no custom deployment details beyond Vercel.
• No built-in database code—data persistence is off-loaded to the external streaming service.
Key components and their relationships
a. Client Browser (user)
b. Next.js Frontend – App Router
• Server‐side rendering (SSR) / static rendering (SSG) for initial loads
• Client‐side React hydration
c. UI Component Layer (components/ui)
d. State + Data Layer
• Providers (StreamClientProvider)
• Hooks (useGetCalls, useGetCallById)
• Action modules (stream.actions.ts)
e. External Streaming Service API (e.g., Stream)
f. CDN / Static Asset Hosting (public/, Next.js optimization)
g. Middleware Layer (middleware.ts) – for auth enforcement or request transforms
Architectural patterns & design principles
• Layered architecture: Presentation (UI) → Application (routing + hooks) → Infrastructure (actions → external API)
• Separation of concerns:
• “app” handles routing and server/client renders
• UI components solely for visuals and props
• Hooks encapsulate data-fetching logic
• Actions modules wrap all HTTP calls to the external service
• Context Provider for streaming client injection (inversion of control)
• Next.js conventions (App Router, file‐based routing, server/client components)