# vodailocz/rophim architecture

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

- Interactive diagram: https://gitdiagram.com/vodailocz/rophim
- Repository: https://github.com/vodailocz/rophim

## Overview

RoPhim is a film-discovery and streaming web application with a NestJS backend for movie data and member accounts. The principal user journey is browsing or searching the catalogue, opening a film, and watching it; signed-in members can also manage favorites, comments, and viewing history. The graph preserves those distinct stages and the backend’s auth, member, and movie layers. Most web-page internals were not sampled, so web-to-backend wiring is shown only at the documented application/API level; other uncertain connections are omitted.

Main entry points: [`apps/server/src/database/prisma.service.ts`](https://github.com/vodailocz/rophim/blob/main/apps/server/src/database/prisma.service.ts) (Prisma service), [`apps/server/src/app.module.ts`](https://github.com/vodailocz/rophim/blob/main/apps/server/src/app.module.ts) (API application), [`apps/server/src/modules/member/infrastructure/member.controller.ts`](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/member/infrastructure/member.controller.ts) (Member endpoints), [`apps/server/src/modules/auth/infrastructure/auth.controller.ts`](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/infrastructure/auth.controller.ts) (Auth endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_catalog["Browse and search"]
  node_film["Film details<br/>[page.tsx]"]
  node_playback["Watch film<br/>[page.tsx]"]
  node_web_member["Member UI"]
  node_navbar["Navigation<br/>[navbar.tsx]"]
  node_proxy["Backend API proxy<br/>[route.ts]"]
  node_web_api["Web API client<br/>[member-client.ts]"]
end

subgraph group_server["Backend API"]
  node_server_app["API application<br/>[app.module.ts]"]
  node_movie_api["Movie endpoints"]
  node_movie_query["Movie query"]
end

subgraph group_identity["Identity and membership"]
  node_auth_api["Auth endpoints<br/>[auth.controller.ts]"]
  node_auth_logic["Auth service<br/>[auth.service.ts]"]
  node_session_cookie["Session cookies<br/>[session-cookie.ts]"]
  node_member_api["Member endpoints"]
  node_member_logic["Member service<br/>[member.service.ts]"]
end

subgraph group_data["Persistence"]
  node_db_module["Database module<br/>[database.module.ts]"]
  node_prisma["Prisma service<br/>[prisma.service.ts]"]
  node_database[("Database client<br/>[index.ts]")]
end

node_viewer(("Viewer"))

node_viewer -->|"browses"| node_catalog
node_viewer -->|"opens"| node_film
node_viewer -->|"watches"| node_playback
node_viewer -->|"uses"| node_web_member
node_navbar -->|"uses"| node_web_member
node_proxy -.->|"forwards API"| node_server_app
node_server_app -->|"registers"| node_movie_api
node_server_app -->|"registers"| node_auth_api
node_server_app -->|"registers"| node_member_api
node_movie_api -->|"calls"| node_movie_query
node_auth_api -->|"calls"| node_auth_logic
node_auth_api -->|"uses"| node_session_cookie
node_member_api -->|"checks session"| node_auth_logic
node_member_api -->|"reads token"| node_session_cookie
node_member_api -->|"calls"| node_member_logic
node_auth_logic -->|"reads and writes"| node_prisma
node_member_logic -->|"reads and writes"| node_prisma
node_movie_query -->|"queries"| node_prisma
node_db_module -->|"provides"| node_prisma
node_prisma -->|"extends client"| node_database

click node_catalog "https://github.com/vodailocz/rophim/tree/main/apps/web/app"
click node_film "https://github.com/vodailocz/rophim/blob/main/apps/web/app/phim/%5Bslug%5D/page.tsx"
click node_playback "https://github.com/vodailocz/rophim/blob/main/apps/web/app/xem-phim/%5Bslug%5D/page.tsx"
click node_web_member "https://github.com/vodailocz/rophim/blob/main/apps/web/components/member-provider.tsx"
click node_navbar "https://github.com/vodailocz/rophim/blob/main/apps/web/components/navbar.tsx"
click node_proxy "https://github.com/vodailocz/rophim/blob/main/apps/web/app/api/backend/%5B...path%5D/route.ts"
click node_web_api "https://github.com/vodailocz/rophim/blob/main/apps/web/lib/member-client.ts"
click node_server_app "https://github.com/vodailocz/rophim/blob/main/apps/server/src/app.module.ts"
click node_movie_api "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/movie/infrastructure/movie.controller.ts"
click node_movie_query "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/movie/application/use-cases/get-movies.use-case.ts"
click node_auth_api "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/infrastructure/auth.controller.ts"
click node_auth_logic "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/application/auth.service.ts"
click node_session_cookie "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/infrastructure/session-cookie.ts"
click node_member_api "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/member/infrastructure/member.controller.ts"
click node_member_logic "https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/member/application/member.service.ts"
click node_db_module "https://github.com/vodailocz/rophim/blob/main/apps/server/src/database/database.module.ts"
click node_prisma "https://github.com/vodailocz/rophim/blob/main/apps/server/src/database/prisma.service.ts"
click node_database "https://github.com/vodailocz/rophim/blob/main/packages/database/index.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_catalog,node_film,node_playback,node_web_member,node_navbar,node_proxy,node_web_api,node_viewer toneBlue
class node_server_app,node_movie_api,node_movie_query toneAmber
class node_auth_api,node_auth_logic,node_session_cookie,node_member_api,node_member_logic toneMint
class node_db_module,node_prisma,node_database toneRose
```

## Components

### Web experience

- [Browse and search](https://github.com/vodailocz/rophim/tree/main/apps/web/app): `apps/web/app`
- [Film details](https://github.com/vodailocz/rophim/blob/main/apps/web/app/phim/%5Bslug%5D/page.tsx): `apps/web/app/phim/[slug]/page.tsx`
- [Watch film](https://github.com/vodailocz/rophim/blob/main/apps/web/app/xem-phim/%5Bslug%5D/page.tsx): `apps/web/app/xem-phim/[slug]/page.tsx`
- [Member UI](https://github.com/vodailocz/rophim/blob/main/apps/web/components/member-provider.tsx): `apps/web/components/member-provider.tsx`
- [Navigation](https://github.com/vodailocz/rophim/blob/main/apps/web/components/navbar.tsx): `apps/web/components/navbar.tsx`
- [Backend API proxy](https://github.com/vodailocz/rophim/blob/main/apps/web/app/api/backend/%5B...path%5D/route.ts): `apps/web/app/api/backend/[...path]/route.ts`
- [Web API client](https://github.com/vodailocz/rophim/blob/main/apps/web/lib/member-client.ts): `apps/web/lib/member-client.ts`

### Backend API

- [API application](https://github.com/vodailocz/rophim/blob/main/apps/server/src/app.module.ts): `apps/server/src/app.module.ts`
- [Movie endpoints](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/movie/infrastructure/movie.controller.ts): `apps/server/src/modules/movie/infrastructure/movie.controller.ts`
- [Movie query](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/movie/application/use-cases/get-movies.use-case.ts): `apps/server/src/modules/movie/application/use-cases/get-movies.use-case.ts`

### Identity and membership

- [Auth endpoints](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/infrastructure/auth.controller.ts): `apps/server/src/modules/auth/infrastructure/auth.controller.ts`
- [Auth service](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/application/auth.service.ts): `apps/server/src/modules/auth/application/auth.service.ts`
- [Session cookies](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/auth/infrastructure/session-cookie.ts): `apps/server/src/modules/auth/infrastructure/session-cookie.ts`
- [Member endpoints](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/member/infrastructure/member.controller.ts): `apps/server/src/modules/member/infrastructure/member.controller.ts`
- [Member service](https://github.com/vodailocz/rophim/blob/main/apps/server/src/modules/member/application/member.service.ts): `apps/server/src/modules/member/application/member.service.ts`

### Persistence

- [Database module](https://github.com/vodailocz/rophim/blob/main/apps/server/src/database/database.module.ts): `apps/server/src/database/database.module.ts`
- [Prisma service](https://github.com/vodailocz/rophim/blob/main/apps/server/src/database/prisma.service.ts): `apps/server/src/database/prisma.service.ts`
- [Database client](https://github.com/vodailocz/rophim/blob/main/packages/database/index.ts): `packages/database/index.ts`

### Other components

- **Viewer**

## Connections

- Viewer → Browse and search: browses
- Viewer → Film details: opens
- Viewer → Watch film: watches
- Viewer → Member UI: uses
- Navigation → Member UI: uses (evidence: `apps/web/components/navbar.tsx`)
- Backend API proxy → API application: forwards API
- API application → Movie endpoints: registers (evidence: `apps/server/src/app.module.ts`)
- API application → Auth endpoints: registers (evidence: `apps/server/src/app.module.ts`)
- API application → Member endpoints: registers (evidence: `apps/server/src/app.module.ts`)
- Movie endpoints → Movie query: calls (evidence: `apps/server/src/modules/movie/infrastructure/movie.controller.ts`)
- Auth endpoints → Auth service: calls (evidence: `apps/server/src/modules/auth/infrastructure/auth.controller.ts`)
- Auth endpoints → Session cookies: uses (evidence: `apps/server/src/modules/auth/infrastructure/auth.controller.ts`)
- Member endpoints → Auth service: checks session (evidence: `apps/server/src/modules/member/infrastructure/member.controller.ts`)
- Member endpoints → Session cookies: reads token (evidence: `apps/server/src/modules/member/infrastructure/member.controller.ts`)
- Member endpoints → Member service: calls (evidence: `apps/server/src/modules/member/infrastructure/member.controller.ts`)
- Auth service → Prisma service: reads and writes (evidence: `apps/server/src/modules/auth/application/auth.service.ts`)
- Member service → Prisma service: reads and writes (evidence: `apps/server/src/modules/member/application/member.service.ts`)
- Movie query → Prisma service: queries (evidence: `apps/server/src/modules/movie/application/use-cases/get-movies.use-case.ts`)
- Database module → Prisma service: provides (evidence: `apps/server/src/database/database.module.ts`)
- Prisma service → Database client: extends client (evidence: `apps/server/src/database/prisma.service.ts`)
