# kristiyanenchev/movienet architecture

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

- Interactive diagram: https://gitdiagram.com/kristiyanenchev/movienet
- Repository: https://github.com/kristiyanenchev/movienet

## Overview

MovieNet is a movie and TV discovery app with a React client and a .NET API. Users browse trending and filtered media, search, open details and trailers, and can register or sign in to comment, like, and manage a watchlist. The client sends API requests to ASP.NET controllers, which dispatch application requests through MediatR; application services and infrastructure support media, identity, images, and user interactions. The README documents PostgreSQL, Redis, TMDB, and background synchronization. Some service and client wiring is not shown in the sampled source, so those links are limited to documented integrations and clear entry points.

Main entry points: [`Client/src/App.jsx`](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/App.jsx) (Routes and providers), [`Client/src/features/media/mediaApi.js`](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/features/media/mediaApi.js) (RTK Query APIs), [`Server/Infrastructure/Infrastructure/Services/Movie/MovieService.cs`](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/MovieService.cs) (Media service), [`Server/Infrastructure/Persistence`](https://github.com/kristiyanenchev/movienet/tree/main/Server/Infrastructure/Persistence) (Repositories and context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Routes and providers<br/>[App.jsx]"]
  node_discovery["Browse and search"]
  node_details["Media details<br/>[MovieDetails.jsx]"]
  node_account["Account pages"]
  node_watchlist["Watchlist page<br/>[Watchlist.jsx]"]
  node_client_api["RTK Query APIs<br/>[mediaApi.js]"]
  node_auth_api["Auth API<br/>[authApi.js]"]
end

subgraph group_api["HTTP API"]
  node_movie_http["Media endpoints<br/>[MovieController.cs]"]
  node_interaction_http["Interaction endpoints"]
  node_identity_http["Identity endpoints"]
  node_comment_http["Comment endpoints"]
  node_image_http["Image endpoints<br/>[ImageController.cs]"]
end

subgraph group_application["Application workflows"]
  node_media_handlers["Media queries"]
  node_interaction_handlers["User interactions"]
  node_identity_handlers["Identity commands"]
  node_comment_handlers["Comment workflows"]
  node_image_handlers["Image queries"]
end

subgraph group_infrastructure["Infrastructure"]
  node_movie_service["Media service<br/>[MovieService.cs]"]
  node_interaction_service["Interaction service"]
  node_identity_service["Identity service<br/>[IdentityService.cs]"]
  node_image_service["Image cache service"]
  node_persistence["Repositories and context"]
  node_database[("PostgreSQL")]
  node_redis[("Redis cache")]
  node_sync_job["Media sync job"]
  node_tmdb_service["TMDB adapter<br/>[TmdbService.cs]"]
end

subgraph group_integrations["External systems"]
  node_tmdb["TMDB"]
end

node_user(("MovieNet user"))

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_discovery
node_app -->|"routes to"| node_details
node_app -->|"routes to"| node_account
node_app -->|"routes to"| node_watchlist
node_discovery -->|"requests media"| node_client_api
node_details -->|"requests details"| node_client_api
node_watchlist -->|"requests watchlist"| node_client_api
node_account -->|"requests identity"| node_auth_api
node_client_api -->|"HTTP requests"| node_movie_http
node_client_api -->|"HTTP requests"| node_interaction_http
node_auth_api -->|"HTTP requests"| node_identity_http
node_movie_http -->|"dispatches queries"| node_media_handlers
node_interaction_http -->|"dispatches commands"| node_interaction_handlers
node_identity_http -->|"dispatches commands"| node_identity_handlers
node_comment_http -->|"dispatches requests"| node_comment_handlers
node_image_http -->|"dispatches queries"| node_image_handlers
node_media_handlers -->|"calls service"| node_movie_service
node_interaction_handlers -->|"uses service"| node_interaction_service
node_identity_handlers -->|"uses service"| node_identity_service
node_image_handlers -->|"uses service"| node_image_service
node_movie_service -->|"uses repositories"| node_persistence
node_interaction_service -->|"uses repositories"| node_persistence
node_persistence -->|"reads and writes"| node_database
node_movie_service -->|"gets media data"| node_tmdb_service
node_tmdb_service -->|"requests media"| node_tmdb
node_sync_job -->|"syncs media"| node_tmdb_service
node_image_service -->|"caches images"| node_redis

click node_app "https://github.com/kristiyanenchev/movienet/blob/main/Client/src/App.jsx"
click node_discovery "https://github.com/kristiyanenchev/movienet/tree/main/Client/src/pages"
click node_details "https://github.com/kristiyanenchev/movienet/blob/main/Client/src/pages/MovieDetails.jsx"
click node_account "https://github.com/kristiyanenchev/movienet/tree/main/Client/src/pages/auth"
click node_watchlist "https://github.com/kristiyanenchev/movienet/blob/main/Client/src/pages/Watchlist.jsx"
click node_client_api "https://github.com/kristiyanenchev/movienet/blob/main/Client/src/features/media/mediaApi.js"
click node_auth_api "https://github.com/kristiyanenchev/movienet/blob/main/Client/src/features/auth/authApi.js"
click node_movie_http "https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Movie/MovieController.cs"
click node_interaction_http "https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Movie/UserInteractionsController.cs"
click node_identity_http "https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Identity/IdentityController.cs"
click node_comment_http "https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Comment/CommentController.cs"
click node_image_http "https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Image/ImageController.cs"
click node_media_handlers "https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Movies"
click node_interaction_handlers "https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/UserInteractions"
click node_identity_handlers "https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Identity"
click node_comment_handlers "https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Comments"
click node_image_handlers "https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Image/Query"
click node_movie_service "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/MovieService.cs"
click node_interaction_service "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/UserInteractionService.cs"
click node_identity_service "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Identity/IdentityService.cs"
click node_image_service "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Image/ImageCacheService.cs"
click node_persistence "https://github.com/kristiyanenchev/movienet/tree/main/Server/Infrastructure/Persistence"
click node_database "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Persistence/Context/ApplicationDbContext.cs"
click node_redis "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Cache/RedisCacheService.cs"
click node_sync_job "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/BackgroundJobs/MovieSyncBackgroundService.cs"
click node_tmdb_service "https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/TmdbService.cs"

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_app,node_discovery,node_details,node_account,node_watchlist,node_client_api,node_auth_api,node_user toneBlue
class node_movie_http,node_interaction_http,node_identity_http,node_comment_http,node_image_http toneAmber
class node_media_handlers,node_interaction_handlers,node_identity_handlers,node_comment_handlers,node_image_handlers toneMint
class node_movie_service,node_interaction_service,node_identity_service,node_image_service,node_persistence,node_database,node_redis,node_sync_job,node_tmdb_service toneRose
class node_tmdb toneIndigo
```

## Components

### React client

- [Routes and providers](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/App.jsx): `Client/src/App.jsx`
- [Browse and search](https://github.com/kristiyanenchev/movienet/tree/main/Client/src/pages): `Client/src/pages`
- [Media details](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/pages/MovieDetails.jsx): `Client/src/pages/MovieDetails.jsx`
- [Account pages](https://github.com/kristiyanenchev/movienet/tree/main/Client/src/pages/auth): `Client/src/pages/auth`
- [Watchlist page](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/pages/Watchlist.jsx): `Client/src/pages/Watchlist.jsx`
- [RTK Query APIs](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/features/media/mediaApi.js): `Client/src/features/media/mediaApi.js`
- [Auth API](https://github.com/kristiyanenchev/movienet/blob/main/Client/src/features/auth/authApi.js): `Client/src/features/auth/authApi.js`

### HTTP API

- [Media endpoints](https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Movie/MovieController.cs): `Server/API/Web/Controllers/Movie/MovieController.cs`
- [Interaction endpoints](https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Movie/UserInteractionsController.cs): `Server/API/Web/Controllers/Movie/UserInteractionsController.cs`
- [Identity endpoints](https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Identity/IdentityController.cs): `Server/API/Web/Controllers/Identity/IdentityController.cs`
- [Comment endpoints](https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Comment/CommentController.cs): `Server/API/Web/Controllers/Comment/CommentController.cs`
- [Image endpoints](https://github.com/kristiyanenchev/movienet/blob/main/Server/API/Web/Controllers/Image/ImageController.cs): `Server/API/Web/Controllers/Image/ImageController.cs`

### Application workflows

- [Media queries](https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Movies): `Server/Core/Application/Handlers/Movies`
- [User interactions](https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/UserInteractions): `Server/Core/Application/Handlers/UserInteractions`
- [Identity commands](https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Identity): `Server/Core/Application/Handlers/Identity`
- [Comment workflows](https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Comments): `Server/Core/Application/Handlers/Comments`
- [Image queries](https://github.com/kristiyanenchev/movienet/tree/main/Server/Core/Application/Handlers/Image/Query): `Server/Core/Application/Handlers/Image/Query`

### Infrastructure

- [Media service](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/MovieService.cs): `Server/Infrastructure/Infrastructure/Services/Movie/MovieService.cs`
- [Interaction service](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/UserInteractionService.cs): `Server/Infrastructure/Infrastructure/Services/Movie/UserInteractionService.cs`
- [Identity service](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Identity/IdentityService.cs): `Server/Infrastructure/Infrastructure/Services/Identity/IdentityService.cs`
- [Image cache service](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Image/ImageCacheService.cs): `Server/Infrastructure/Infrastructure/Services/Image/ImageCacheService.cs`
- [Repositories and context](https://github.com/kristiyanenchev/movienet/tree/main/Server/Infrastructure/Persistence): `Server/Infrastructure/Persistence`
- [PostgreSQL](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Persistence/Context/ApplicationDbContext.cs): `Server/Infrastructure/Persistence/Context/ApplicationDbContext.cs`
- [Redis cache](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Cache/RedisCacheService.cs): `Server/Infrastructure/Infrastructure/Services/Cache/RedisCacheService.cs`
- [Media sync job](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/BackgroundJobs/MovieSyncBackgroundService.cs): `Server/Infrastructure/Infrastructure/BackgroundJobs/MovieSyncBackgroundService.cs`
- [TMDB adapter](https://github.com/kristiyanenchev/movienet/blob/main/Server/Infrastructure/Infrastructure/Services/Movie/TmdbService.cs): `Server/Infrastructure/Infrastructure/Services/Movie/TmdbService.cs`

### External systems

- **TMDB**

### Other components

- **MovieNet user**

## Connections

- MovieNet user → Routes and providers: uses
- Routes and providers → Browse and search: routes to
- Routes and providers → Media details: routes to
- Routes and providers → Account pages: routes to
- Routes and providers → Watchlist page: routes to
- Browse and search → RTK Query APIs: requests media
- Media details → RTK Query APIs: requests details
- Watchlist page → RTK Query APIs: requests watchlist
- Account pages → Auth API: requests identity
- RTK Query APIs → Media endpoints: HTTP requests
- RTK Query APIs → Interaction endpoints: HTTP requests
- Auth API → Identity endpoints: HTTP requests
- Media endpoints → Media queries: dispatches queries
- Interaction endpoints → User interactions: dispatches commands
- Identity endpoints → Identity commands: dispatches commands
- Comment endpoints → Comment workflows: dispatches requests
- Image endpoints → Image queries: dispatches queries
- Media queries → Media service: calls service
- User interactions → Interaction service: uses service
- Identity commands → Identity service: uses service
- Image queries → Image cache service: uses service
- Media service → Repositories and context: uses repositories
- Interaction service → Repositories and context: uses repositories
- Repositories and context → PostgreSQL: reads and writes
- Media service → TMDB adapter: gets media data
- TMDB adapter → TMDB: requests media
- Media sync job → TMDB adapter: syncs media
- Image cache service → Redis cache: caches images
