How vikram-353/meetiq works
Project Type and Purpose
• This is a full-stack Next.js application (Next.js App Router) that provides user authentication, a dashboard for managing “agents” and “meetings,” and real-time video calling via Stream.Video.
• The README confirms it was bootstrapped with create-next-app and runs on Node.js with built-in Next.js routing, SSR/SSG, and optimized fonts.
File Structure Analysis
• Top-level config files: next.config.ts, drizzle.config.ts (Drizzle ORM for database), tsconfig.json.
• src/app: Next.js “app” directory including layouts and pages for /auth, /dashboard, /call, plus API route handlers under src/app/api/auth and src/app/api/trpc.
• src/components & src/components/ui: Shared React UI components (buttons, dialogs, tables, etc.).
• src/lib: Utility libraries (auth client, Stream.Video wrapper, common utils).
• src/hooks: Custom React hooks.
• src/db: Database configuration and schema definitions (Drizzle).
• src/modules: Domain-driven directories for agents, meetings, call, auth, dashboard, home—each containing server procedures (tRPC), schemas/types, UI views/components.
• src/trpc: tRPC client/server initialization and router definitions.
README and Architectural Insights
• Uses Next.js’s hybrid SSR/CSR model, Drizzle for ORM, tRPC for type-safe API, NextAuth for authentication ([…all] route), and Stream.Video for real-time calls.
Key Components
a. Frontend (Browser/Client)
• Next.js React pages & components under src/app & src/modules/*/ui
• tRPC & React Query client (src/trpc/client.tsx & src/trpc/query-client.ts)
• Stream.Video SDK wrapper (src/lib/stream.video.ts)
• NextAuth client for sign-in/up (via src/lib/auth-client.ts)
b. API Layer (Next.js Route Handlers + tRPC)
• NextAuth route: src/app/api/auth/[...all]/route.ts
• tRPC route: src/app/api/trpc/[trpc]/route.ts → src/trpc/server.tsx → src/trpc/routers/_app.ts
c. Business Logic & Data Access
• Domain procedures: src/modules/{agents,meetings}/server/procedures.ts (tRPC resolver functions)
• Drizzle ORM: src/db/index.ts & schema.ts
d. Data Store
• Relational database (e.g., PostgreSQL) configured via drizzle.config.ts
e. External Services
• NextAuth (OAuth providers, sessions)
• Stream.Video (real-time call service)
Relationships and Data Flow
• Browser → Next.js frontend (SSR/CSR)
→ On data needs: tRPC client → Next.js API (route.ts) → tRPC server → domain procedures → Drizzle → DB → back up chain → React Query → UI.
• Auth flow: Browser → NextAuth client → /api/auth route → NextAuth server → OAuth provider → session.
• Call flow: Browser → Stream.Video SDK client → Stream.Video service (signalling/media) → peers.
Architectural Patterns & Design Principles
• Feature-module decomposition (agents, meetings, call, auth).
• Type-safe end-to-end contract: tRPC + React Query.
• Monolithic Next.js app (frontend & API in one codebase) with serverless functions.
• ORM abstraction via Drizzle.
• Separation of concerns: UI components, hooks, lib utilities, server procedures.