# adrianhajdin/project_video_chat architecture

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

- Interactive diagram: https://gitdiagram.com/adrianhajdin/project_video_chat
- Repository: https://github.com/adrianhajdin/project_video_chat

## Overview

This is a React video-chat application with a Socket.IO signaling server. A caller enters a peer ID in the sidebar; shared context creates a WebRTC peer and signals the server, which relays call offers and answers. The recipient sees a notification and can answer; the video player displays local and remote streams. The browser supplies camera and microphone media. The server also exposes a health-check route. The client and server excerpts show their respective event handling, though the client’s configured signaling URL is not the local server URL.

Main entry points: [`client/src/Context.js`](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/Context.js) (Call context), [`client/src/App.js`](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/App.js) (Chat interface), [`client/src/components/Sidebar.jsx`](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/Sidebar.jsx) (Call controls), [`client/src/components/Notifications.jsx`](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/Notifications.jsx) (Incoming call prompt)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Chat interface<br/>[App.js]"]
  node_sidebar["Call controls<br/>[Sidebar.jsx]"]
  node_notifications["Incoming call prompt<br/>[Notifications.jsx]"]
  node_video["Video display<br/>[VideoPlayer.jsx]"]
end

subgraph group_realtime["Call coordination"]
  node_context["Call context<br/>[Context.js]"]
  node_peer["WebRTC peer<br/>[Context.js]"]
end

subgraph group_server["Signaling server"]
  node_socketserver["Socket.IO event relay<br/>[index.js]"]
  node_health["Health endpoint<br/>[index.js]"]
end

subgraph group_platform["Browser media"]
  node_media["Camera and microphone"]
end

node_user(("Caller or recipient"))

node_user -->|"enters call details"| node_sidebar
node_app -->|"renders"| node_video
node_app -->|"renders"| node_sidebar
node_app -->|"renders"| node_notifications
node_sidebar -->|"calls actions"| node_context
node_notifications -->|"answers call"| node_context
node_context -->|"shares call state"| node_video
node_context -->|"requests stream"| node_media
node_context -->|"creates peer"| node_peer
node_context -.->|"signals call"| node_socketserver
node_socketserver -.->|"relays call events"| node_context
node_user -->|"receives prompt"| node_notifications
node_user -->|"views streams"| node_video
node_user -->|"checks status"| node_health

click node_app "https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/App.js"
click node_context "https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/Context.js"
click node_sidebar "https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/Sidebar.jsx"
click node_notifications "https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/Notifications.jsx"
click node_video "https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/VideoPlayer.jsx"
click node_peer "https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/Context.js"
click node_socketserver "https://github.com/adrianhajdin/project_video_chat/blob/master/index.js"
click node_health "https://github.com/adrianhajdin/project_video_chat/blob/master/index.js"

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_app,node_sidebar,node_notifications,node_video toneBlue
class node_context,node_peer toneAmber
class node_socketserver,node_health toneMint
class node_media toneRose
class node_user toneIndigo
```

## Components

### React client

- [Chat interface](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/App.js): `client/src/App.js`
- [Call controls](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/Sidebar.jsx): `client/src/components/Sidebar.jsx`
- [Incoming call prompt](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/Notifications.jsx): `client/src/components/Notifications.jsx`
- [Video display](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/components/VideoPlayer.jsx): `client/src/components/VideoPlayer.jsx`

### Call coordination

- [Call context](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/Context.js): `client/src/Context.js`
- [WebRTC peer](https://github.com/adrianhajdin/project_video_chat/blob/master/client/src/Context.js): `client/src/Context.js`

### Signaling server

- [Socket.IO event relay](https://github.com/adrianhajdin/project_video_chat/blob/master/index.js): `index.js`
- [Health endpoint](https://github.com/adrianhajdin/project_video_chat/blob/master/index.js): `index.js`

### Browser media

- **Camera and microphone**

### Other components

- **Caller or recipient**

## Connections

- Caller or recipient → Call controls: enters call details (evidence: `client/src/components/Sidebar.jsx`)
- Chat interface → Video display: renders (evidence: `client/src/App.js`)
- Chat interface → Call controls: renders (evidence: `client/src/App.js`)
- Chat interface → Incoming call prompt: renders (evidence: `client/src/App.js`)
- Call controls → Call context: calls actions (evidence: `client/src/components/Sidebar.jsx`)
- Incoming call prompt → Call context: answers call (evidence: `client/src/components/Notifications.jsx`)
- Call context → Video display: shares call state (evidence: `client/src/components/VideoPlayer.jsx`)
- Call context → Camera and microphone: requests stream (evidence: `client/src/Context.js`)
- Call context → WebRTC peer: creates peer (evidence: `client/src/Context.js`)
- Call context → Socket.IO event relay: signals call
- Socket.IO event relay → Call context: relays call events
- Caller or recipient → Incoming call prompt: receives prompt (evidence: `client/src/components/Notifications.jsx`)
- Caller or recipient → Video display: views streams (evidence: `client/src/components/VideoPlayer.jsx`)
- Caller or recipient → Health endpoint: checks status (evidence: `index.js`)
