# movixstream/movixopensource architecture

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

- Interactive diagram: https://gitdiagram.com/movixstream/movixopensource
- Repository: https://github.com/movixstream/movixopensource

## Overview

Movix is a community streaming platform in which users discover media, select a playback source, and watch through a web or mobile client. The monorepo also provides account and community features, source extraction/proxying, and WatchParty synchronization. The README documents the major product subsystems; source-index references support a few internal API and mobile relationships. Many routes and integrations are unsampled, so their detailed call paths are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/movixstream/movixopensource/blob/main/src/App.tsx) (Web application), [`API/Mainapi/server.js`](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/server.js) (Main API), [`API/Mainapi/mysqlPool.js`](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/mysqlPool.js) (MySQL store), [`app/src`](https://github.com/movixstream/movixopensource/tree/main/app/src) (Mobile browser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User clients"]
  node_web["Web application<br/>[App.tsx]"]
  node_home["Media discovery"]
  node_search["Search context<br/>[SearchContext.tsx]"]
  node_header["Navigation header<br/>[Header.tsx]"]
  node_browser["Browser tools"]
  node_mobile["Mobile browser"]
end

subgraph group_api["Main API"]
  node_api["Main API<br/>[server.js]"]
  node_auth["Authentication<br/>[authRoutes.js]"]
  node_authmw["Auth middleware<br/>[auth.js]"]
  node_sync["Account sync<br/>[sync.js]"]
  node_community["Community features<br/>[commentsRoutes.js]"]
  node_wrapped["Yearly stories<br/>[wrappedRoutes.js]"]
  node_db[("MySQL store<br/>[mysqlPool.js]")]
  node_redis[("Redis cache<br/>[redis.js]")]
end

subgraph group_playback["Playback services"]
  node_extract["Embed extraction<br/>[server.py]"]
  node_drm["DRM services"]
  node_cloudproxy["CORS proxy<br/>[worker.js]"]
  node_androidproxy["Android media proxy"]
  node_iosproxy["iOS media proxy"]
end

subgraph group_party["WatchParty"]
  node_watchapi["WatchParty service<br/>[watchparty.js]"]
  node_watchsync["Sync engine<br/>[lib.rs]"]
  node_watchworker["Browser sync worker"]
end

subgraph group_aux["Companion services"]
  node_premid["PreMiD presence<br/>[presence.ts]"]
  node_social["Social previews<br/>[socialPreview.js]"]
end

node_viewer(("Viewer"))

node_viewer -->|"uses"| node_web
node_web -.->|"renders"| node_home
node_web -->|"renders"| node_header
node_home -.->|"searches"| node_search
node_web -.->|"requests"| node_api
node_browser -.->|"integrates"| node_api
node_mobile -.->|"connects"| node_api
node_api -.->|"routes"| node_auth
node_auth -->|"uses"| node_authmw
node_auth -->|"persists sessions"| node_db
node_sync -->|"validates requests"| node_authmw
node_sync -->|"reads and writes"| node_db
node_community -->|"stores community data"| node_db
node_community -->|"caches profiles"| node_redis
node_wrapped -->|"uses sync policy"| node_sync
node_wrapped -.->|"loads metadata"| node_db
node_web -.->|"gets stream sources"| node_extract
node_extract -.->|"serves DRM"| node_drm
node_web -.->|"uses proxy"| node_cloudproxy
node_mobile -.->|"relays media"| node_androidproxy
node_mobile -->|"proxies playback"| node_iosproxy
node_web -.->|"joins parties"| node_watchapi
node_watchworker -.->|"uses engine"| node_watchsync
node_watchapi -.->|"synchronizes playback"| node_watchsync
node_web -.->|"reports presence"| node_premid
node_viewer -.->|"opens media links"| node_social

click node_web "https://github.com/movixstream/movixopensource/blob/main/src/App.tsx"
click node_home "https://github.com/movixstream/movixopensource/tree/main/src/pages"
click node_search "https://github.com/movixstream/movixopensource/blob/main/src/context/SearchContext.tsx"
click node_header "https://github.com/movixstream/movixopensource/blob/main/src/components/Header.tsx"
click node_browser "https://github.com/movixstream/movixopensource/tree/main/extension/Chrome"
click node_mobile "https://github.com/movixstream/movixopensource/tree/main/app/src"
click node_api "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/server.js"
click node_auth "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/routes/authRoutes.js"
click node_authmw "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/middleware/auth.js"
click node_sync "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/routes/sync.js"
click node_community "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/commentsRoutes.js"
click node_wrapped "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/wrappedRoutes.js"
click node_db "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/mysqlPool.js"
click node_redis "https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/config/redis.js"
click node_extract "https://github.com/movixstream/movixopensource/blob/main/API/proxiesembed/server.py"
click node_drm "https://github.com/movixstream/movixopensource/tree/main/API/proxiesembed/drmproxy"
click node_cloudproxy "https://github.com/movixstream/movixopensource/blob/main/cloudflareproxy/worker.js"
click node_androidproxy "https://github.com/movixstream/movixopensource/blob/main/app/android/app/src/main/java/com/movix/app/proxy/MediaProxyServer.kt"
click node_iosproxy "https://github.com/movixstream/movixopensource/blob/main/app/ios/Movix/Proxy/MediaProxyServer.swift"
click node_watchapi "https://github.com/movixstream/movixopensource/blob/main/API/watchpartyAPI/watchparty.js"
click node_watchsync "https://github.com/movixstream/movixopensource/blob/main/wasm/watchparty-sync/src/lib.rs"
click node_watchworker "https://github.com/movixstream/movixopensource/blob/main/src/workers/watchpartySync.worker.ts"
click node_premid "https://github.com/movixstream/movixopensource/blob/main/PreMid/presence.ts"
click node_social "https://github.com/movixstream/movixopensource/blob/main/functions/_lib/socialPreview.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_web,node_home,node_search,node_header,node_browser,node_mobile,node_viewer toneBlue
class node_api,node_auth,node_authmw,node_sync,node_community,node_wrapped,node_db,node_redis toneAmber
class node_extract,node_drm,node_cloudproxy,node_androidproxy,node_iosproxy toneMint
class node_watchapi,node_watchsync,node_watchworker toneRose
class node_premid,node_social toneIndigo
```

## Components

### User clients

- [Web application](https://github.com/movixstream/movixopensource/blob/main/src/App.tsx): `src/App.tsx`
- [Media discovery](https://github.com/movixstream/movixopensource/tree/main/src/pages): `src/pages`
- [Search context](https://github.com/movixstream/movixopensource/blob/main/src/context/SearchContext.tsx): `src/context/SearchContext.tsx`
- [Navigation header](https://github.com/movixstream/movixopensource/blob/main/src/components/Header.tsx): `src/components/Header.tsx`
- [Browser tools](https://github.com/movixstream/movixopensource/tree/main/extension/Chrome): `extension/Chrome`
- [Mobile browser](https://github.com/movixstream/movixopensource/tree/main/app/src): `app/src`

### Main API

- [Main API](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/server.js): `API/Mainapi/server.js`
- [Authentication](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/routes/authRoutes.js): `API/Mainapi/routes/authRoutes.js`
- [Auth middleware](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/middleware/auth.js): `API/Mainapi/middleware/auth.js`
- [Account sync](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/routes/sync.js): `API/Mainapi/routes/sync.js`
- [Community features](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/commentsRoutes.js): `API/Mainapi/commentsRoutes.js`
- [Yearly stories](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/wrappedRoutes.js): `API/Mainapi/wrappedRoutes.js`
- [MySQL store](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/mysqlPool.js): `API/Mainapi/mysqlPool.js`
- [Redis cache](https://github.com/movixstream/movixopensource/blob/main/API/Mainapi/config/redis.js): `API/Mainapi/config/redis.js`

### Playback services

- [Embed extraction](https://github.com/movixstream/movixopensource/blob/main/API/proxiesembed/server.py): `API/proxiesembed/server.py`
- [DRM services](https://github.com/movixstream/movixopensource/tree/main/API/proxiesembed/drmproxy): `API/proxiesembed/drmproxy`
- [CORS proxy](https://github.com/movixstream/movixopensource/blob/main/cloudflareproxy/worker.js): `cloudflareproxy/worker.js`
- [Android media proxy](https://github.com/movixstream/movixopensource/blob/main/app/android/app/src/main/java/com/movix/app/proxy/MediaProxyServer.kt): `app/android/app/src/main/java/com/movix/app/proxy/MediaProxyServer.kt`
- [iOS media proxy](https://github.com/movixstream/movixopensource/blob/main/app/ios/Movix/Proxy/MediaProxyServer.swift): `app/ios/Movix/Proxy/MediaProxyServer.swift`

### WatchParty

- [WatchParty service](https://github.com/movixstream/movixopensource/blob/main/API/watchpartyAPI/watchparty.js): `API/watchpartyAPI/watchparty.js`
- [Sync engine](https://github.com/movixstream/movixopensource/blob/main/wasm/watchparty-sync/src/lib.rs): `wasm/watchparty-sync/src/lib.rs`
- [Browser sync worker](https://github.com/movixstream/movixopensource/blob/main/src/workers/watchpartySync.worker.ts): `src/workers/watchpartySync.worker.ts`

### Companion services

- [PreMiD presence](https://github.com/movixstream/movixopensource/blob/main/PreMid/presence.ts): `PreMid/presence.ts`
- [Social previews](https://github.com/movixstream/movixopensource/blob/main/functions/_lib/socialPreview.js): `functions/_lib/socialPreview.js`

### Other components

- **Viewer**

## Connections

- Viewer → Web application: uses
- Web application → Media discovery: renders (evidence: `src/App.tsx`)
- Web application → Navigation header: renders (evidence: `src/App.tsx`)
- Media discovery → Search context: searches
- Web application → Main API: requests
- Browser tools → Main API: integrates
- Mobile browser → Main API: connects
- Main API → Authentication: routes
- Authentication → Auth middleware: uses (evidence: `API/Mainapi/routes/authRoutes.js`)
- Authentication → MySQL store: persists sessions (evidence: `API/Mainapi/routes/authRoutes.js`)
- Account sync → Auth middleware: validates requests (evidence: `API/Mainapi/routes/sync.js`)
- Account sync → MySQL store: reads and writes (evidence: `API/Mainapi/routes/sync.js`)
- Community features → MySQL store: stores community data (evidence: `API/Mainapi/commentsRoutes.js`)
- Community features → Redis cache: caches profiles (evidence: `API/Mainapi/commentsRoutes.js`)
- Yearly stories → Account sync: uses sync policy (evidence: `API/Mainapi/wrappedRoutes.js`)
- Yearly stories → MySQL store: loads metadata
- Web application → Embed extraction: gets stream sources
- Embed extraction → DRM services: serves DRM (evidence: `API/proxiesembed/server.py`)
- Web application → CORS proxy: uses proxy
- Mobile browser → Android media proxy: relays media
- Mobile browser → iOS media proxy: proxies playback
- Web application → WatchParty service: joins parties
- Browser sync worker → Sync engine: uses engine
- WatchParty service → Sync engine: synchronizes playback
- Web application → PreMiD presence: reports presence
- Viewer → Social previews: opens media links
