# engrtarun/tott architecture

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

- Interactive diagram: https://gitdiagram.com/engrtarun/tott
- Repository: https://github.com/engrtarun/tott

## Overview

TOTT is a movie and TV-show browsing site with a homepage, searchable release listings, title details, and embedded playback. The main path is homepage discovery → title details → movie or trailer playback; a separate admin/API path supports authenticated movie management. The graph also includes the OMDB and TMDB API routes visible in the tree, but their behavior was not sampled. Connections are limited to relationships visible in excerpts or the source index; unsampled admin-page wiring and metadata integrations are not inferred.

Main entry points: [`app/page.tsx`](https://github.com/engrtarun/tott/blob/main/app/page.tsx) (Homepage), [`app/movie/[id]/page.tsx`](https://github.com/engrtarun/tott/blob/main/app/movie/%5Bid%5D/page.tsx) (Movie details), [`app/api/movies/route.ts`](https://github.com/engrtarun/tott/blob/main/app/api/movies/route.ts) (Movies API), [`lib/mongodb.ts`](https://github.com/engrtarun/tott/blob/main/lib/mongodb.ts) (Mongo client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Browse and discovery"]
  node_homepage["Homepage<br/>[page.tsx]"]
  node_header["Navigation and search<br/>[Header.tsx]"]
  node_hero["Featured carousel<br/>[HeroCarousel.tsx]"]
  node_latest["Latest releases"]
  node_footer["Site footer<br/>[Footer.tsx]"]
end

subgraph group_titles["Title experience"]
  node_details["Movie details<br/>[page.tsx]"]
  node_player["Movie player<br/>[MoviePlayer.tsx]"]
end

subgraph group_management["Admin and APIs"]
  node_adminpage["Admin page<br/>[page.tsx]"]
  node_authroute["Admin auth API<br/>[route.ts]"]
  node_moviesroute["Movies API<br/>[route.ts]"]
  node_omdbroute["OMDB API<br/>[route.ts]"]
  node_tmdbroute["TMDB API<br/>[route.ts]"]
end

subgraph group_infrastructure["Data and services"]
  node_authlib["Session verification<br/>[admin-auth.ts]"]
  node_mongolib["Mongo client<br/>[mongodb.ts]"]
  node_mongostore[("MongoDB movies")]
end

node_visitor(("Visitor"))
node_admin(("Admin user"))
node_youtube["YouTube"]

node_visitor -.->|"opens"| node_homepage
node_admin -.->|"opens"| node_adminpage
node_homepage -->|"renders"| node_header
node_homepage -->|"renders"| node_hero
node_homepage -->|"renders"| node_latest
node_homepage -->|"renders"| node_footer
node_homepage -->|"reads through"| node_mongolib
node_homepage -->|"reads movies"| node_mongostore
node_hero -->|"links to"| node_details
node_latest -.->|"links to"| node_details
node_details -->|"renders"| node_header
node_details -->|"renders"| node_player
node_details -->|"renders"| node_footer
node_player -->|"embeds playback"| node_youtube
node_authroute -->|"verifies sessions"| node_authlib
node_moviesroute -->|"checks admin"| node_authlib
node_moviesroute -->|"uses client"| node_mongolib
node_mongolib -.->|"connects to"| node_mongostore
node_moviesroute -->|"reads and writes"| node_mongostore

click node_homepage "https://github.com/engrtarun/tott/blob/main/app/page.tsx"
click node_header "https://github.com/engrtarun/tott/blob/main/components/Header.tsx"
click node_hero "https://github.com/engrtarun/tott/blob/main/components/HeroCarousel.tsx"
click node_latest "https://github.com/engrtarun/tott/blob/main/components/LatestMoviesGrid.tsx"
click node_footer "https://github.com/engrtarun/tott/blob/main/components/Footer.tsx"
click node_details "https://github.com/engrtarun/tott/blob/main/app/movie/%5Bid%5D/page.tsx"
click node_player "https://github.com/engrtarun/tott/blob/main/app/movie/%5Bid%5D/MoviePlayer.tsx"
click node_adminpage "https://github.com/engrtarun/tott/blob/main/app/admin/page.tsx"
click node_authroute "https://github.com/engrtarun/tott/blob/main/app/api/admin-auth/route.ts"
click node_moviesroute "https://github.com/engrtarun/tott/blob/main/app/api/movies/route.ts"
click node_omdbroute "https://github.com/engrtarun/tott/blob/main/app/api/omdb/route.ts"
click node_tmdbroute "https://github.com/engrtarun/tott/blob/main/app/api/tmdb/route.ts"
click node_authlib "https://github.com/engrtarun/tott/blob/main/lib/admin-auth.ts"
click node_mongolib "https://github.com/engrtarun/tott/blob/main/lib/mongodb.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_homepage,node_header,node_hero,node_latest,node_footer,node_admin toneBlue
class node_details,node_player toneAmber
class node_adminpage,node_authroute,node_moviesroute,node_omdbroute,node_tmdbroute toneMint
class node_authlib,node_mongolib,node_mongostore toneRose
class node_visitor,node_youtube toneIndigo
```

## Components

### Browse and discovery

- [Homepage](https://github.com/engrtarun/tott/blob/main/app/page.tsx): `app/page.tsx`
- [Navigation and search](https://github.com/engrtarun/tott/blob/main/components/Header.tsx): `components/Header.tsx`
- [Featured carousel](https://github.com/engrtarun/tott/blob/main/components/HeroCarousel.tsx): `components/HeroCarousel.tsx`
- [Latest releases](https://github.com/engrtarun/tott/blob/main/components/LatestMoviesGrid.tsx): `components/LatestMoviesGrid.tsx`
- [Site footer](https://github.com/engrtarun/tott/blob/main/components/Footer.tsx): `components/Footer.tsx`

### Title experience

- [Movie details](https://github.com/engrtarun/tott/blob/main/app/movie/%5Bid%5D/page.tsx): `app/movie/[id]/page.tsx`
- [Movie player](https://github.com/engrtarun/tott/blob/main/app/movie/%5Bid%5D/MoviePlayer.tsx): `app/movie/[id]/MoviePlayer.tsx`

### Admin and APIs

- [Admin page](https://github.com/engrtarun/tott/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [Admin auth API](https://github.com/engrtarun/tott/blob/main/app/api/admin-auth/route.ts): `app/api/admin-auth/route.ts`
- [Movies API](https://github.com/engrtarun/tott/blob/main/app/api/movies/route.ts): `app/api/movies/route.ts`
- [OMDB API](https://github.com/engrtarun/tott/blob/main/app/api/omdb/route.ts): `app/api/omdb/route.ts`
- [TMDB API](https://github.com/engrtarun/tott/blob/main/app/api/tmdb/route.ts): `app/api/tmdb/route.ts`

### Data and services

- [Session verification](https://github.com/engrtarun/tott/blob/main/lib/admin-auth.ts): `lib/admin-auth.ts`
- [Mongo client](https://github.com/engrtarun/tott/blob/main/lib/mongodb.ts): `lib/mongodb.ts`
- **MongoDB movies**

### Other components

- **Visitor**
- **Admin user**
- **YouTube**

## Connections

- Visitor → Homepage: opens
- Admin user → Admin page: opens
- Homepage → Navigation and search: renders (evidence: `app/page.tsx`)
- Homepage → Featured carousel: renders (evidence: `app/page.tsx`)
- Homepage → Latest releases: renders (evidence: `app/page.tsx`)
- Homepage → Site footer: renders (evidence: `app/page.tsx`)
- Homepage → Mongo client: reads through (evidence: `app/page.tsx`)
- Homepage → MongoDB movies: reads movies (evidence: `app/page.tsx`)
- Featured carousel → Movie details: links to (evidence: `components/HeroCarousel.tsx`)
- Latest releases → Movie details: links to
- Movie details → Navigation and search: renders (evidence: `app/movie/[id]/page.tsx`)
- Movie details → Movie player: renders (evidence: `app/movie/[id]/page.tsx`)
- Movie details → Site footer: renders (evidence: `app/movie/[id]/page.tsx`)
- Movie player → YouTube: embeds playback (evidence: `app/movie/[id]/MoviePlayer.tsx`)
- Admin auth API → Session verification: verifies sessions (evidence: `app/api/admin-auth/route.ts`)
- Movies API → Session verification: checks admin (evidence: `app/api/movies/route.ts`)
- Movies API → Mongo client: uses client (evidence: `app/api/movies/route.ts`)
- Mongo client → MongoDB movies: connects to
- Movies API → MongoDB movies: reads and writes (evidence: `app/api/movies/route.ts`)
