# shantanum91/r-stream architecture

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

- Interactive diagram: https://gitdiagram.com/shantanum91/r-stream
- Repository: https://github.com/shantanum91/r-stream

## Overview

R-Stream is a LAN video streamer: a browser loads the Angular client, which requests a video listing and lets a user select a file for playback. The Express server serves the client and mounts the video API; its routes enumerate local media and stream selected files, including byte ranges for playback seeking. The graph distinguishes client startup, API hosting, and media access. The fixed media directory is configured in the route source. The excerpts show these relationships; other UI details are not inferred from unsampled templates.

Main entry points: [`src/main.ts`](https://github.com/shantanum91/r-stream/blob/master/src/main.ts) (Angular bootstrap), [`routes/videos.js`](https://github.com/shantanum91/r-stream/blob/master/routes/videos.js) (Video API and streaming), [`src/app/app.module.ts`](https://github.com/shantanum91/r-stream/blob/master/src/app/app.module.ts) (App module), [`src/app/app.component.ts`](https://github.com/shantanum91/r-stream/blob/master/src/app/app.component.ts) (Video UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_client_entry["Angular bootstrap<br/>[main.ts]"]
  node_app_module["App module<br/>[app.module.ts]"]
  node_video_ui["Video UI<br/>[app.component.ts]"]
end

subgraph group_hosting["API hosting"]
  node_express_server["Express server<br/>[server.js]"]
end

subgraph group_media["Media access"]
  node_video_routes["Video API and streaming<br/>[videos.js]"]
  node_media_files["Local media files"]
end

node_browser(("LAN browser"))

node_browser -.->|"opens"| node_client_entry
node_client_entry -->|"bootstraps"| node_app_module
node_client_entry -->|"imports"| node_app_module
node_app_module -->|"declares"| node_video_ui
node_video_ui -->|"requests video API"| node_express_server
node_express_server -->|"mounts routes"| node_video_routes
node_video_routes -->|"lists and reads"| node_media_files
node_video_routes -->|"streams video"| node_browser

click node_client_entry "https://github.com/shantanum91/r-stream/blob/master/src/main.ts"
click node_app_module "https://github.com/shantanum91/r-stream/blob/master/src/app/app.module.ts"
click node_video_ui "https://github.com/shantanum91/r-stream/blob/master/src/app/app.component.ts"
click node_express_server "https://github.com/shantanum91/r-stream/blob/master/server.js"
click node_video_routes "https://github.com/shantanum91/r-stream/blob/master/routes/videos.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_client_entry,node_app_module,node_video_ui,node_browser toneBlue
class node_express_server toneAmber
class node_video_routes,node_media_files toneMint
```

## Components

### Browser client

- [Angular bootstrap](https://github.com/shantanum91/r-stream/blob/master/src/main.ts): `src/main.ts`
- [App module](https://github.com/shantanum91/r-stream/blob/master/src/app/app.module.ts): `src/app/app.module.ts`
- [Video UI](https://github.com/shantanum91/r-stream/blob/master/src/app/app.component.ts): `src/app/app.component.ts`

### API hosting

- [Express server](https://github.com/shantanum91/r-stream/blob/master/server.js): `server.js`

### Media access

- [Video API and streaming](https://github.com/shantanum91/r-stream/blob/master/routes/videos.js): `routes/videos.js`
- **Local media files**

### Other components

- **LAN browser**

## Connections

- LAN browser → Angular bootstrap: opens (evidence: `README.md`)
- Angular bootstrap → App module: bootstraps (evidence: `src/main.ts`)
- Angular bootstrap → App module: imports (evidence: `src/main.ts`)
- App module → Video UI: declares (evidence: `src/app/app.module.ts`)
- Video UI → Express server: requests video API (evidence: `src/app/app.component.ts`)
- Express server → Video API and streaming: mounts routes (evidence: `server.js`)
- Video API and streaming → Local media files: lists and reads (evidence: `routes/videos.js`)
- Video API and streaming → LAN browser: streams video (evidence: `routes/videos.js`)
