# khemaseng/cineverse architecture

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

- Interactive diagram: https://gitdiagram.com/khemaseng/cineverse
- Repository: https://github.com/khemaseng/cineverse

## Overview

CineVerse is a Next.js movie-discovery platform. The main workflow assembles landing-page recommendations from TMDB, then lets users browse, filter, paginate, explore genres and trending titles, and open movie details. Separate branches provide local account registration/login, premium-plan checkout UI, and a movie data table. The graph uses documented calls and source-index references; unsampled route implementations and integrations are not inferred.

Main entry points: [`src/app/page.tsx`](https://github.com/khemaseng/cineverse/blob/main/src/app/page.tsx) (Landing page), [`src/lib/api/tmdb.ts`](https://github.com/khemaseng/cineverse/blob/main/src/lib/api/tmdb.ts) (TMDB client), [`src/app/movies/page.tsx`](https://github.com/khemaseng/cineverse/blob/main/src/app/movies/page.tsx) (Movie browsing), [`src/lib/auth/auth-service.ts`](https://github.com/khemaseng/cineverse/blob/main/src/lib/auth/auth-service.ts) (Local auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Movie discovery"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_hero["Hero banner"]
  node_genres_showcase["Genre showcase"]
  node_featured["Featured movies"]
  node_spotlight["Cinematic spotlight"]
  node_trending_preview["Trending preview"]
  node_upcoming["Upcoming movies"]
  node_carousel["Movie carousel"]
  node_movie_browse["Movie browsing<br/>[page.tsx]"]
  node_movie_filters["Movie filters"]
  node_movie_list["Movie list"]
  node_movie_card["Movie card"]
  node_pagination["Pagination<br/>[pagination.tsx]"]
  node_genre_pages["Genre exploration"]
  node_trending_page["Trending page<br/>[page.tsx]"]
  node_movie_detail_page["Movie detail page<br/>[page.tsx]"]
  node_movie_detail["Movie details"]
  node_movie_cast["Cast view"]
  node_movie_trailer["Trailer view"]
end

subgraph group_accounts["Accounts and premium"]
  node_auth_pages["Login and register pages"]
  node_login_form["Login form"]
  node_register_form["Registration form"]
  node_auth_validation["Auth validation<br/>[auth.ts]"]
  node_auth_service["Local auth service<br/>[auth-service.ts]"]
  node_browser_storage[("Browser local storage")]
  node_premium_page["Premium page<br/>[page.tsx]"]
  node_premium_checkout["Premium plans and checkout"]
end

subgraph group_integration["Movie data integration"]
  node_tmdb_client["TMDB client<br/>[tmdb.ts]"]
  node_tmdb_service{{"TMDB API"}}
  node_movie_types["Movie data types<br/>[movie.ts]"]
end

subgraph group_management["Movie management"]
  node_data_table_page["Movie table page<br/>[page.tsx]"]
  node_table_features["Table controls"]
  node_table_columns["Table columns<br/>[columns.tsx]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens"| node_landing
node_landing -->|"fetches movie sets"| node_tmdb_client
node_landing -->|"renders"| node_hero
node_landing -->|"renders"| node_genres_showcase
node_landing -->|"renders"| node_featured
node_landing -->|"renders"| node_spotlight
node_landing -->|"renders"| node_trending_preview
node_landing -->|"renders"| node_upcoming
node_landing -->|"renders"| node_carousel
node_movie_browse -->|"fetches movies"| node_tmdb_client
node_movie_browse -->|"renders"| node_movie_filters
node_movie_browse -->|"renders"| node_movie_list
node_movie_browse -->|"renders"| node_pagination
node_movie_list -->|"renders"| node_movie_card
node_genre_pages -->|"uses movie API"| node_tmdb_client
node_trending_page -->|"fetches trending"| node_tmdb_client
node_movie_detail_page -->|"fetches details"| node_tmdb_client
node_movie_detail_page -->|"renders"| node_movie_detail
node_movie_detail -->|"renders"| node_movie_cast
node_movie_detail -->|"renders"| node_movie_trailer
node_tmdb_client -->|"requests data"| node_tmdb_service
node_visitor -->|"opens"| node_auth_pages
node_auth_pages -->|"renders"| node_login_form
node_auth_pages -->|"renders"| node_register_form
node_login_form -->|"validates input"| node_auth_validation
node_register_form -->|"validates input"| node_auth_validation
node_login_form -->|"authenticates"| node_auth_service
node_register_form -->|"registers account"| node_auth_service
node_auth_service -->|"reads and writes"| node_browser_storage
node_premium_page -->|"renders"| node_premium_checkout
node_premium_checkout -->|"reads session"| node_auth_service
node_data_table_page -->|"renders"| node_table_features
node_data_table_page -->|"builds columns"| node_table_columns
node_data_table_page -->|"uses movie data"| node_movie_types

click node_landing "https://github.com/khemaseng/cineverse/blob/main/src/app/page.tsx"
click node_hero "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/HeroBannerComponent.tsx"
click node_genres_showcase "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/GenresShowcaseComponent.tsx"
click node_featured "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/FeaturedMoviesComponent.tsx"
click node_spotlight "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/CinematicSpotlightComponent.tsx"
click node_trending_preview "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/TrendingPreviewComponent.tsx"
click node_upcoming "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/UpcomingMoviesComponent.tsx"
click node_carousel "https://github.com/khemaseng/cineverse/blob/main/src/components/landing/CoverFlowCarouselComponent.tsx"
click node_movie_browse "https://github.com/khemaseng/cineverse/blob/main/src/app/movies/page.tsx"
click node_movie_filters "https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieFilterComponent.tsx"
click node_movie_list "https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieCardListComponent.tsx"
click node_movie_card "https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieCardComponent.tsx"
click node_pagination "https://github.com/khemaseng/cineverse/blob/main/src/components/pagination.tsx"
click node_genre_pages "https://github.com/khemaseng/cineverse/tree/main/src/app/genre"
click node_trending_page "https://github.com/khemaseng/cineverse/blob/main/src/app/trending/page.tsx"
click node_movie_detail_page "https://github.com/khemaseng/cineverse/blob/main/src/app/movies/%5BmovieId%5D/page.tsx"
click node_movie_detail "https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieDetailComponent.tsx"
click node_movie_cast "https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieCastComponent.tsx"
click node_movie_trailer "https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieTrailerComponent.tsx"
click node_auth_pages "https://github.com/khemaseng/cineverse/tree/main/src/app/auth"
click node_login_form "https://github.com/khemaseng/cineverse/blob/main/src/components/auth/LoginFormComponent.tsx"
click node_register_form "https://github.com/khemaseng/cineverse/blob/main/src/components/auth/RegisterFormComponent.tsx"
click node_auth_validation "https://github.com/khemaseng/cineverse/blob/main/src/lib/validations/auth.ts"
click node_auth_service "https://github.com/khemaseng/cineverse/blob/main/src/lib/auth/auth-service.ts"
click node_premium_page "https://github.com/khemaseng/cineverse/blob/main/src/app/explore-premium/page.tsx"
click node_premium_checkout "https://github.com/khemaseng/cineverse/blob/main/src/components/premium/ExplorePremiumComponent.tsx"
click node_tmdb_client "https://github.com/khemaseng/cineverse/blob/main/src/lib/api/tmdb.ts"
click node_movie_types "https://github.com/khemaseng/cineverse/blob/main/src/lib/api/types/movie.ts"
click node_data_table_page "https://github.com/khemaseng/cineverse/blob/main/src/app/data-tables/page.tsx"
click node_table_features "https://github.com/khemaseng/cineverse/blob/main/src/app/data-tables/data-table-features.tsx"
click node_table_columns "https://github.com/khemaseng/cineverse/blob/main/src/app/data-tables/columns.tsx"

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_landing,node_hero,node_genres_showcase,node_featured,node_spotlight,node_trending_preview,node_upcoming,node_carousel,node_movie_browse,node_movie_filters,node_movie_list,node_movie_card,node_pagination,node_genre_pages,node_trending_page,node_movie_detail_page,node_movie_detail,node_movie_cast,node_movie_trailer toneBlue
class node_auth_pages,node_login_form,node_register_form,node_auth_validation,node_auth_service,node_browser_storage,node_premium_page,node_premium_checkout toneAmber
class node_tmdb_client,node_tmdb_service,node_movie_types toneMint
class node_data_table_page,node_table_features,node_table_columns toneRose
class node_visitor toneIndigo
```

## Components

### Movie discovery

- [Landing page](https://github.com/khemaseng/cineverse/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Hero banner](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/HeroBannerComponent.tsx): `src/components/landing/HeroBannerComponent.tsx`
- [Genre showcase](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/GenresShowcaseComponent.tsx): `src/components/landing/GenresShowcaseComponent.tsx`
- [Featured movies](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/FeaturedMoviesComponent.tsx): `src/components/landing/FeaturedMoviesComponent.tsx`
- [Cinematic spotlight](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/CinematicSpotlightComponent.tsx): `src/components/landing/CinematicSpotlightComponent.tsx`
- [Trending preview](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/TrendingPreviewComponent.tsx): `src/components/landing/TrendingPreviewComponent.tsx`
- [Upcoming movies](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/UpcomingMoviesComponent.tsx): `src/components/landing/UpcomingMoviesComponent.tsx`
- [Movie carousel](https://github.com/khemaseng/cineverse/blob/main/src/components/landing/CoverFlowCarouselComponent.tsx): `src/components/landing/CoverFlowCarouselComponent.tsx`
- [Movie browsing](https://github.com/khemaseng/cineverse/blob/main/src/app/movies/page.tsx): `src/app/movies/page.tsx`
- [Movie filters](https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieFilterComponent.tsx): `src/components/movies/MovieFilterComponent.tsx`
- [Movie list](https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieCardListComponent.tsx): `src/components/movies/MovieCardListComponent.tsx`
- [Movie card](https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieCardComponent.tsx): `src/components/movies/MovieCardComponent.tsx`
- [Pagination](https://github.com/khemaseng/cineverse/blob/main/src/components/pagination.tsx): `src/components/pagination.tsx`
- [Genre exploration](https://github.com/khemaseng/cineverse/tree/main/src/app/genre): `src/app/genre`
- [Trending page](https://github.com/khemaseng/cineverse/blob/main/src/app/trending/page.tsx): `src/app/trending/page.tsx`
- [Movie detail page](https://github.com/khemaseng/cineverse/blob/main/src/app/movies/%5BmovieId%5D/page.tsx): `src/app/movies/[movieId]/page.tsx`
- [Movie details](https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieDetailComponent.tsx): `src/components/movies/MovieDetailComponent.tsx`
- [Cast view](https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieCastComponent.tsx): `src/components/movies/MovieCastComponent.tsx`
- [Trailer view](https://github.com/khemaseng/cineverse/blob/main/src/components/movies/MovieTrailerComponent.tsx): `src/components/movies/MovieTrailerComponent.tsx`

### Accounts and premium

- [Login and register pages](https://github.com/khemaseng/cineverse/tree/main/src/app/auth): `src/app/auth`
- [Login form](https://github.com/khemaseng/cineverse/blob/main/src/components/auth/LoginFormComponent.tsx): `src/components/auth/LoginFormComponent.tsx`
- [Registration form](https://github.com/khemaseng/cineverse/blob/main/src/components/auth/RegisterFormComponent.tsx): `src/components/auth/RegisterFormComponent.tsx`
- [Auth validation](https://github.com/khemaseng/cineverse/blob/main/src/lib/validations/auth.ts): `src/lib/validations/auth.ts`
- [Local auth service](https://github.com/khemaseng/cineverse/blob/main/src/lib/auth/auth-service.ts): `src/lib/auth/auth-service.ts`
- **Browser local storage**
- [Premium page](https://github.com/khemaseng/cineverse/blob/main/src/app/explore-premium/page.tsx): `src/app/explore-premium/page.tsx`
- [Premium plans and checkout](https://github.com/khemaseng/cineverse/blob/main/src/components/premium/ExplorePremiumComponent.tsx): `src/components/premium/ExplorePremiumComponent.tsx`

### Movie data integration

- [TMDB client](https://github.com/khemaseng/cineverse/blob/main/src/lib/api/tmdb.ts): `src/lib/api/tmdb.ts`
- **TMDB API**
- [Movie data types](https://github.com/khemaseng/cineverse/blob/main/src/lib/api/types/movie.ts): `src/lib/api/types/movie.ts`

### Movie management

- [Movie table page](https://github.com/khemaseng/cineverse/blob/main/src/app/data-tables/page.tsx): `src/app/data-tables/page.tsx`
- [Table controls](https://github.com/khemaseng/cineverse/blob/main/src/app/data-tables/data-table-features.tsx): `src/app/data-tables/data-table-features.tsx`
- [Table columns](https://github.com/khemaseng/cineverse/blob/main/src/app/data-tables/columns.tsx): `src/app/data-tables/columns.tsx`

### Other components

- **Visitor**

## Connections

- Visitor → Landing page: opens
- Landing page → TMDB client: fetches movie sets (evidence: `src/app/page.tsx`)
- Landing page → Hero banner: renders (evidence: `src/app/page.tsx`)
- Landing page → Genre showcase: renders (evidence: `src/app/page.tsx`)
- Landing page → Featured movies: renders (evidence: `src/app/page.tsx`)
- Landing page → Cinematic spotlight: renders (evidence: `src/app/page.tsx`)
- Landing page → Trending preview: renders (evidence: `src/app/page.tsx`)
- Landing page → Upcoming movies: renders (evidence: `src/app/page.tsx`)
- Landing page → Movie carousel: renders (evidence: `src/app/page.tsx`)
- Movie browsing → TMDB client: fetches movies (evidence: `src/app/movies/page.tsx`)
- Movie browsing → Movie filters: renders (evidence: `src/app/movies/page.tsx`)
- Movie browsing → Movie list: renders (evidence: `src/app/movies/page.tsx`)
- Movie browsing → Pagination: renders (evidence: `src/app/movies/page.tsx`)
- Movie list → Movie card: renders (evidence: `src/components/movies/MovieCardListComponent.tsx`)
- Genre exploration → TMDB client: uses movie API (evidence: `src/app/genre/page.tsx`)
- Trending page → TMDB client: fetches trending (evidence: `src/app/trending/page.tsx`)
- Movie detail page → TMDB client: fetches details (evidence: `src/app/movies/[movieId]/page.tsx`)
- Movie detail page → Movie details: renders (evidence: `src/app/movies/[movieId]/page.tsx`)
- Movie details → Cast view: renders (evidence: `src/components/movies/MovieDetailComponent.tsx`)
- Movie details → Trailer view: renders (evidence: `src/components/movies/MovieDetailComponent.tsx`)
- TMDB client → TMDB API: requests data (evidence: `src/lib/api/tmdb.ts`)
- Visitor → Login and register pages: opens
- Login and register pages → Login form: renders (evidence: `src/app/auth/login/page.tsx`)
- Login and register pages → Registration form: renders (evidence: `src/app/auth/register/page.tsx`)
- Login form → Auth validation: validates input (evidence: `src/components/auth/LoginFormComponent.tsx`)
- Registration form → Auth validation: validates input (evidence: `src/components/auth/RegisterFormComponent.tsx`)
- Login form → Local auth service: authenticates (evidence: `src/components/auth/LoginFormComponent.tsx`)
- Registration form → Local auth service: registers account (evidence: `src/components/auth/RegisterFormComponent.tsx`)
- Local auth service → Browser local storage: reads and writes (evidence: `src/lib/auth/auth-service.ts`)
- Premium page → Premium plans and checkout: renders (evidence: `src/app/explore-premium/page.tsx`)
- Premium plans and checkout → Local auth service: reads session (evidence: `src/components/premium/ExplorePremiumComponent.tsx`)
- Movie table page → Table controls: renders (evidence: `src/app/data-tables/page.tsx`)
- Movie table page → Table columns: builds columns (evidence: `src/app/data-tables/page.tsx`)
- Movie table page → Movie data types: uses movie data (evidence: `src/app/data-tables/page.tsx`)
