# shyamnakka/video-chat-app architecture

> Architecture diagram of the GitHub repository shyamnakka/video-chat-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shyamnakka/video-chat-app
- Repository: https://github.com/shyamnakka/video-chat-app

## Overview

CartickMeet lets a user create or enter a room, then join a four-person video call with peer-to-peer media and in-room chat. The room page coordinates socket signaling, local media capture, WebRTC peer connections, chat, controls, and video tiles; the server maintains in-memory membership and relays signaling/chat. README capabilities are represented, including status, capacity handling, and health check. Evidence comes from the excerpts and README; internal WebRTC details are represented together because the hook is one implementation module.

Main entry points: [`app/room/[roomId]/page.tsx`](https://github.com/shyamnakka/video-chat-app/blob/main/app/room/%5BroomId%5D/page.tsx) (Room interface), [`hooks/useWebRTC.ts`](https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useWebRTC.ts) (Peer calls and chat), [`server.ts`](https://github.com/shyamnakka/video-chat-app/blob/main/server.ts) (Room signaling server), [`app/page.tsx`](https://github.com/shyamnakka/video-chat-app/blob/main/app/page.tsx) (Create or join)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Room entry"]
  node_lobby["Create or join<br/>[page.tsx]"]
end

subgraph group_client["Call experience"]
  node_room["Room interface<br/>[page.tsx]"]
  node_media["Local media capture<br/>[useUserMedia.ts]"]
  node_socket["Socket connection<br/>[useSocket.ts]"]
  node_rtc["Peer calls and chat<br/>[useWebRTC.ts]"]
  node_video["Video tiles<br/>[media-video.tsx]"]
end

subgraph group_realtime["Realtime services"]
  node_server["Room signaling server<br/>[server.ts]"]
  node_membership[("Room membership<br/>[server.ts]")]
end

subgraph group_operations["Service status"]
  node_health["Health endpoint<br/>[route.ts]"]
end

node_participant(("Participant"))

node_participant -->|"creates or joins"| node_lobby
node_lobby -->|"navigates to"| node_room
node_participant -.->|"opens link"| node_room
node_room -->|"uses"| node_socket
node_room -->|"requests"| node_media
node_room -->|"coordinates"| node_rtc
node_room -->|"renders"| node_video
node_socket -->|"connects"| node_server
node_rtc -->|"signals and chats"| node_server
node_server -->|"tracks members"| node_membership
node_server -->|"forwards events"| node_rtc
node_rtc -->|"streams peer media"| node_participant
node_participant -.->|"checks service"| node_health

click node_lobby "https://github.com/shyamnakka/video-chat-app/blob/main/app/page.tsx"
click node_room "https://github.com/shyamnakka/video-chat-app/blob/main/app/room/%5BroomId%5D/page.tsx"
click node_media "https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useUserMedia.ts"
click node_socket "https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useSocket.ts"
click node_rtc "https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useWebRTC.ts"
click node_video "https://github.com/shyamnakka/video-chat-app/blob/main/components/media-video.tsx"
click node_server "https://github.com/shyamnakka/video-chat-app/blob/main/server.ts"
click node_membership "https://github.com/shyamnakka/video-chat-app/blob/main/server.ts"
click node_health "https://github.com/shyamnakka/video-chat-app/blob/main/app/api/health/route.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_lobby toneBlue
class node_room,node_media,node_socket,node_rtc,node_video toneAmber
class node_server,node_membership toneMint
class node_health toneRose
class node_participant toneIndigo
```

## Components

### Room entry

- [Create or join](https://github.com/shyamnakka/video-chat-app/blob/main/app/page.tsx): `app/page.tsx`

### Call experience

- [Room interface](https://github.com/shyamnakka/video-chat-app/blob/main/app/room/%5BroomId%5D/page.tsx): `app/room/[roomId]/page.tsx`
- [Local media capture](https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useUserMedia.ts): `hooks/useUserMedia.ts`
- [Socket connection](https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useSocket.ts): `hooks/useSocket.ts`
- [Peer calls and chat](https://github.com/shyamnakka/video-chat-app/blob/main/hooks/useWebRTC.ts): `hooks/useWebRTC.ts`
- [Video tiles](https://github.com/shyamnakka/video-chat-app/blob/main/components/media-video.tsx): `components/media-video.tsx`

### Realtime services

- [Room signaling server](https://github.com/shyamnakka/video-chat-app/blob/main/server.ts): `server.ts`
- [Room membership](https://github.com/shyamnakka/video-chat-app/blob/main/server.ts): `server.ts`

### Service status

- [Health endpoint](https://github.com/shyamnakka/video-chat-app/blob/main/app/api/health/route.ts): `app/api/health/route.ts`

### Other components

- **Participant**

## Connections

- Participant → Create or join: creates or joins (evidence: `app/page.tsx`)
- Create or join → Room interface: navigates to (evidence: `app/page.tsx`)
- Participant → Room interface: opens link (evidence: `README.md`)
- Room interface → Socket connection: uses (evidence: `app/room/[roomId]/page.tsx`)
- Room interface → Local media capture: requests (evidence: `app/room/[roomId]/page.tsx`)
- Room interface → Peer calls and chat: coordinates (evidence: `app/room/[roomId]/page.tsx`)
- Room interface → Video tiles: renders (evidence: `app/room/[roomId]/page.tsx`)
- Socket connection → Room signaling server: connects (evidence: `README.md`)
- Peer calls and chat → Room signaling server: signals and chats (evidence: `README.md`)
- Room signaling server → Room membership: tracks members (evidence: `server.ts`)
- Room signaling server → Peer calls and chat: forwards events (evidence: `README.md`)
- Peer calls and chat → Participant: streams peer media (evidence: `README.md`)
- Participant → Health endpoint: checks service (evidence: `README.md`)
