# taniatripty/cine_tube-backend architecture

> Architecture diagram of the GitHub repository taniatripty/cine_tube-backend, 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/taniatripty/cine_tube-backend
- Repository: https://github.com/taniatripty/cine_tube-backend

## Overview

Cine-Tube is an Express backend for media discovery and access, user accounts, and community interaction. Requests enter through the application, then API controllers delegate work to domain services and return responses; authentication also supports Better Auth sessions and application tokens. Payment handling includes a Stripe webhook. The tree shows additional catalog, episode, subscription, and reporting domains, but their internal calls were not sampled. Edges are limited to relationships visible in excerpts or the source index, so some likely domain and storage links are omitted.

Main entry points: [`src/app/module/auth/auth.services.ts`](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/auth/auth.services.ts) (Account operations), [`src/app.ts`](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app.ts) (Express application), [`src/app/module/payment/payment.controller.ts`](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/payment/payment.controller.ts) (Payment endpoints), [`src/app/module/review/review.services.ts`](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/review/review.services.ts) (Review operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["API entry"]
  node_application["Express application<br/>[app.ts]"]
  node_route_index["API route index<br/>[index.ts]"]
  node_database[("Prisma database<br/>[prisma.ts]")]
end

subgraph group_accounts["Accounts"]
  node_auth_controller["Account endpoints<br/>[auth.controller.ts]"]
  node_auth_service["Account operations<br/>[auth.services.ts]"]
  node_auth_provider["Better Auth<br/>[auth.ts]"]
  node_token_tools["Token utilities<br/>[token.ts]"]
end

subgraph group_catalog["Media catalog"]
  node_media_controller["Media endpoints"]
  node_media_service["Media operations<br/>[media.services.ts]"]
  node_genre["Genre management<br/>[genre.services.ts]"]
  node_episode["Episode management"]
  node_season["Season management<br/>[season.services.ts]"]
  node_platform["Platform management"]
  node_person["Person management<br/>[person.services.ts]"]
  node_tag["Tag management<br/>[tag.services.ts]"]
end

subgraph group_community["Community and commerce"]
  node_review_controller["Review endpoints"]
  node_review_service["Review operations<br/>[review.services.ts]"]
  node_comment_controller["Comment endpoints"]
  node_comment_service["Comment operations"]
  node_watchlist["Watch list"]
  node_reporting["Content reporting"]
  node_payment_controller["Payment endpoints"]
  node_payment_service["Payment operations"]
  node_subscription["Subscriptions"]
  node_media_access["Media access"]
end

node_client(("API client"))
node_stripe["Stripe"]

node_client -->|"sends requests"| node_application
node_application -->|"mounts API routes"| node_route_index
node_application -->|"routes webhook"| node_payment_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"uses auth API"| node_auth_provider
node_auth_service -->|"creates tokens"| node_token_tools
node_auth_service -->|"queries"| node_database
node_media_controller -->|"calls"| node_media_service
node_review_controller -->|"calls"| node_review_service
node_review_service -->|"reads and writes"| node_database
node_comment_controller -->|"calls"| node_comment_service
node_payment_controller -->|"calls"| node_payment_service
node_payment_controller -->|"verifies webhook"| node_stripe

click node_application "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app.ts"
click node_route_index "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/routes/index.ts"
click node_auth_controller "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/auth/auth.controller.ts"
click node_auth_service "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/auth/auth.services.ts"
click node_auth_provider "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/lib/auth.ts"
click node_token_tools "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/utils/token.ts"
click node_media_controller "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/media/media.controller.ts"
click node_media_service "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/media/media.services.ts"
click node_genre "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/genre/genre.services.ts"
click node_episode "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/episode/episode.services.ts"
click node_season "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/season/season.services.ts"
click node_platform "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/streamingPlatform/streamingPlatform.services.ts"
click node_person "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/person/person.services.ts"
click node_tag "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/tag/tag.services.ts"
click node_review_controller "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/review/review.controller.ts"
click node_review_service "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/review/review.services.ts"
click node_comment_controller "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/commnet/comment.controller.ts"
click node_comment_service "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/commnet/comment.services.ts"
click node_watchlist "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/watchList/watchList.services.ts"
click node_reporting "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/contentReport/contentReport.services.ts"
click node_payment_controller "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/payment/payment.controller.ts"
click node_payment_service "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/payment/payment.services.ts"
click node_subscription "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/subscription/subscription.services.ts"
click node_media_access "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/mediaAccess/mediaAccess.services.ts"
click node_database "https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/lib/prisma.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_application,node_route_index,node_database,node_client toneBlue
class node_auth_controller,node_auth_service,node_auth_provider,node_token_tools toneAmber
class node_media_controller,node_media_service,node_genre,node_episode,node_season,node_platform,node_person,node_tag toneMint
class node_review_controller,node_review_service,node_comment_controller,node_comment_service,node_watchlist,node_reporting,node_payment_controller,node_payment_service,node_subscription,node_media_access toneRose
class node_stripe toneIndigo
```

## Components

### API entry

- [Express application](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app.ts): `src/app.ts`
- [API route index](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/routes/index.ts): `src/app/routes/index.ts`
- [Prisma database](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/lib/prisma.ts): `src/app/lib/prisma.ts`

### Accounts

- [Account endpoints](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/auth/auth.controller.ts): `src/app/module/auth/auth.controller.ts`
- [Account operations](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/auth/auth.services.ts): `src/app/module/auth/auth.services.ts`
- [Better Auth](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/lib/auth.ts): `src/app/lib/auth.ts`
- [Token utilities](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/utils/token.ts): `src/app/utils/token.ts`

### Media catalog

- [Media endpoints](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/media/media.controller.ts): `src/app/module/media/media.controller.ts`
- [Media operations](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/media/media.services.ts): `src/app/module/media/media.services.ts`
- [Genre management](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/genre/genre.services.ts): `src/app/module/genre/genre.services.ts`
- [Episode management](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/episode/episode.services.ts): `src/app/module/episode/episode.services.ts`
- [Season management](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/season/season.services.ts): `src/app/module/season/season.services.ts`
- [Platform management](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/streamingPlatform/streamingPlatform.services.ts): `src/app/module/streamingPlatform/streamingPlatform.services.ts`
- [Person management](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/person/person.services.ts): `src/app/module/person/person.services.ts`
- [Tag management](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/tag/tag.services.ts): `src/app/module/tag/tag.services.ts`

### Community and commerce

- [Review endpoints](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/review/review.controller.ts): `src/app/module/review/review.controller.ts`
- [Review operations](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/review/review.services.ts): `src/app/module/review/review.services.ts`
- [Comment endpoints](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/commnet/comment.controller.ts): `src/app/module/commnet/comment.controller.ts`
- [Comment operations](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/commnet/comment.services.ts): `src/app/module/commnet/comment.services.ts`
- [Watch list](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/watchList/watchList.services.ts): `src/app/module/watchList/watchList.services.ts`
- [Content reporting](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/contentReport/contentReport.services.ts): `src/app/module/contentReport/contentReport.services.ts`
- [Payment endpoints](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/payment/payment.controller.ts): `src/app/module/payment/payment.controller.ts`
- [Payment operations](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/payment/payment.services.ts): `src/app/module/payment/payment.services.ts`
- [Subscriptions](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/subscription/subscription.services.ts): `src/app/module/subscription/subscription.services.ts`
- [Media access](https://github.com/taniatripty/cine_tube-backend/blob/main/src/app/module/mediaAccess/mediaAccess.services.ts): `src/app/module/mediaAccess/mediaAccess.services.ts`

### Other components

- **API client**
- **Stripe**

## Connections

- API client → Express application: sends requests (evidence: `src/app.ts`)
- Express application → API route index: mounts API routes (evidence: `src/app.ts`)
- Express application → Payment endpoints: routes webhook (evidence: `src/app.ts`)
- Account endpoints → Account operations: calls (evidence: `src/app/module/auth/auth.controller.ts`)
- Account operations → Better Auth: uses auth API (evidence: `src/app/module/auth/auth.services.ts`)
- Account operations → Token utilities: creates tokens (evidence: `src/app/module/auth/auth.services.ts`)
- Account operations → Prisma database: queries (evidence: `src/app/module/auth/auth.services.ts`)
- Media endpoints → Media operations: calls (evidence: `src/app/module/media/media.controller.ts`)
- Review endpoints → Review operations: calls (evidence: `src/app/module/review/review.controller.ts`)
- Review operations → Prisma database: reads and writes (evidence: `src/app/module/review/review.services.ts`)
- Comment endpoints → Comment operations: calls (evidence: `src/app/module/commnet/comment.controller.ts`)
- Payment endpoints → Payment operations: calls (evidence: `src/app/module/payment/payment.controller.ts`)
- Payment endpoints → Stripe: verifies webhook (evidence: `src/app/module/payment/payment.controller.ts`)
