How felixnt0/fkt_calling_webapp works
Purpose and Runtime
This is a Next.js App Router application for creating, discovering, joining, and conducting online meetings. It combines browser-rendered meeting UI with server-side route handlers for meeting operations, chat, and Agora video-token issuance. The primary runtime is Next.js/React; deployment is compatible with Vercel per the project README.
Application Entry and Route Structure
The root application shell and public landing entry are:
• src/app/layout.tsx
• src/app/page.tsx
• src/app/globals.css
App Router pages expose meeting-specific navigation and general product pages. The central meeting lifecycle routes are:
• src/app/[id]/page.tsx
• src/app/[id]/join/page.tsx
• src/app/[id]/room/page.tsx
A meeting identifier is the boundary connecting meeting details, pre-join behavior, and the live room.
Meeting Lifecycle and State
Meeting creation and browsing are represented in UI components, while shared React context likely coordinates client-side meeting and user state:
• src/components/CreateMeetingModal.tsx
• src/components/MeetingDetails.tsx
• src/context/MeetingContext.tsx
• src/context/UserContext.tsx
The expected control flow is: users discover or create a meeting, navigate through an ID-scoped meeting page, optionally complete a join step, then enter the room. Context is the client-state boundary; API handlers are the persistence/service boundary.
Server API Boundary
Next.js route handlers provide the backend surface for meeting operations:
• src/app/api/meeting/route.ts
• src/app/api/meeting/[id]/route.ts
• src/app/api/meeting/[id]/chat/route.ts
These handlers separate browser UI from meeting resource management and per-meeting chat. src/api/index.ts is a separate API-facing module and may act as a client/service aggregation point.
Real-Time Video and Chat
Agora is the material external real-time communications service. Live-room rendering and Agora client integration are concentrated in:
• src/components/AgoraCall.tsx
• src/components/Agora/AgoraVideoPlayer.tsx
• src/components/Agora/AgoraUIVideoPlayer.tsx
Agora credentials/tokens are issued through:
• src/app/api/meeting/agora/token/route.ts
• src/components/AgoraConfig.tsx
The token endpoint is the security boundary between browser media clients and Agora credentials; live media should consume issued tokens rather than embed server secrets.
Identity and Data Infrastructure
Authentication-facing pages are:
• src/app/auth/login/page.tsx
• src/app/auth/signup/page.tsx
Firebase is an explicit infrastructure dependency, with administrative/server integration isolated in:
• src/lib/firebaseAdmin.ts
• src/lib/schemas.ts
This suggests Firebase-backed identity and/or meeting data, while schemas establish validation or shared data contracts. Server route handlers should own use of Firebase Admin credentials; client components should interact through APIs or client-safe providers.
Presentation and Operational Pages
The product includes discovery, profile, administration, and documentation surfaces:
• src/app/explore/page.tsx
• src/app/profile/page.tsx
• src/app/admin/page.tsx
• src/app/api-docs/page.tsx
Reusable navigation, provider composition, meeting cards, and room actions are centered in:
• src/components/Providers.tsx
• src/components/NavBar.tsx
• src/components/MeetingCard.tsx
• src/components/BottomActionButtons.tsx
Main entry points: AgoraCall.tsx Agora call UI · route.ts Meeting API · CreateMeetingModal.tsx Discovery & meeting UI · page.tsx Live room
Components 18
Next.js client
- App shell · Root layout, global styles, and provider composition.
src/app/layout.tsx - Discovery & meeting UI · Meeting creation, browsing, cards, and navigation.
src/components/CreateMeetingModal.tsx - Meeting state · Client-side meeting and user state boundary.
src/context/MeetingContext.tsx - API module · API-facing client or service aggregation.
src/api/index.ts
App routes
- Landing
src/app/page.tsx - Meeting details · ID-scoped meeting entry and details.
src/app/[id]/page.tsx - Pre-join
src/app/[id]/join/page.tsx - Live room
src/app/[id]/room/page.tsx - Product pages · Explore, profile, admin, and API documentation surfaces.
src/app/explore/page.tsx
Server API
- Meeting API · Creates and lists meeting resources.
src/app/api/meeting/route.ts - Meeting resource API · Reads or updates an ID-scoped meeting.
src/app/api/meeting/[id]/route.ts - Meeting chat API · Per-meeting chat boundary.
src/app/api/meeting/[id]/chat/route.ts - Agora token API · Security boundary issuing browser media tokens.
src/app/api/meeting/agora/token/route.ts
Real-time media
- Agora call UI · Live-room media integration.
src/components/AgoraCall.tsx - Agora video players · Renders remote and local video streams.
src/components/Agora/AgoraVideoPlayer.tsx
Infrastructure
- Firebase Admin · Server-side identity and data access.
src/lib/firebaseAdmin.ts - Data schemas · Shared validation and data contracts.
src/lib/schemas.ts - Agora · Real-time video communications provider.
Connections 20
- App shell → Landing: hosts
- App shell → Meeting state: provides
- Landing → Discovery & meeting UI: renders
- Discovery & meeting UI → Meeting state: reads and updates
- Discovery & meeting UI → Meeting API: creates and browses
- Meeting API → Firebase Admin: persists through
- Meeting API → Data schemas: validates with
- Meeting details → Meeting resource API: loads meeting
- Meeting resource API → Firebase Admin: accesses
- Meeting details → Pre-join: continues to
- Pre-join → Live room: enters
- Live room → Agora call UI: renders
- Agora call UI → Agora video players: uses
- Agora call UI → Agora token API: requests token
- Agora token API → Agora: issues access for
- Agora call UI → Agora: joins media channel
- Live room → Meeting chat API: uses chat
- Meeting chat API → Firebase Admin: stores through
- API module → Meeting API: calls
- Product pages → API module: uses