How ashrithsathu/pawvc works
Project Type and Purpose
• This is a full-stack, server-rendered React application built with Next.js 13 (App Router). Its primary function is to let users sign up/in, schedule and join voice/video meetings. It leverages Stream’s real-time API for calls and messaging.
File Structure Analysis
• app/ – Next.js App Router directory.
• (auth) sub-group for sign-in and sign-up pages.
• (root) sub-group for the main site: home, personal room, previous/upcoming recordings, and dynamic meeting pages.
• layout.tsx files define shared UI shells.
• middleware.ts handles route guards (e.g., auth).
• components/ – Reusable UI and meeting-related modules (MeetingCard, MeetingRoom, CallList, MeetingModal, etc.).
• components/ui/ – Design system primitives (buttons, cards, dialogs, inputs, toasts).
• actions/stream.actions.ts – Next.js Server Actions to interact with Stream API (create calls, fetch call data).
• hooks/ – Client hooks (useGetCalls, useGetCallById) that wrap data-fetch logic.
• providers/StreamClientProvider.tsx – React Context providing Stream client across the tree.
• lib/utils.ts – Shared utility functions.
• Config & tooling: ESLint, Tailwind CSS, PostCSS, TypeScript, pnpm, Vercel deployment config.
Additional Insights from README
• Standard create-next-app setup.
• Uses server-side rendering (SSR) and static optimization where possible.
• TailwindCSS for styling, Next.js next/font for Inter font optimization.
• No custom database layer—relies on external Stream service for real-time data.
a. Main Components
1. Browser / Client (React UI)
2. Next.js Server (App Router)
3. Stream Service (external API for calls & chat)
4. CDN / Static Assets Store (Vercel)
5. Middleware / Auth Guard
b. Relationships & Data Flows
• User’s browser ↔ Next.js server
• Initial page SSR / SSG via App Router
• Static assets delivered from CDN
• Browser components (wrapped by StreamClientProvider) ↔ Stream API
• Real-time WebSocket/REST calls for creating, joining, ending meetings
• Next.js Server Actions (stream.actions.ts) invoked from server components/hooks → Stream API
• Hooks (useGetCalls, useGetCallById) fetch data via client-side fetches or server actions
c. Architectural Patterns & Principles
• App Router + Nested Layouts for route grouping & shared UI
• Server Components vs. Client Components separation
• React Context (StreamClientProvider) for dependency injection
• Single responsibility: components focus on UI, actions on API interaction, hooks on data fetching
d. Key Technologies
• Next.js 13 App Router, React 18, TypeScript
• TailwindCSS, next/font
• Stream Video/Chat SDK
• Vercel for hosting & CDN