# jean-patrick2026/rot_tom- architecture

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

- Interactive diagram: https://gitdiagram.com/jean-patrick2026/rot_tom-
- Repository: https://github.com/jean-patrick2026/rot_tom-

## Overview

Rotten_Tomattoes is a Next.js film-catalogue and community app, with account/profile management, user ratings and comments, favorites, and admin movie/user screens. The visible rating workflow runs from the review form through a server action that authenticates the user, stores or updates a review, recalculates the film average, and revalidates pages. The README documents Prisma/MySQL models; sampled code confirms some database access paths, but not all UI wiring or service implementations, so uncertain connections are omitted.

Main entry points: [`lib/auth.ts`](https://github.com/jean-patrick2026/rot_tom-/blob/main/lib/auth.ts) (Auth configuration), [`lib/prisma.ts`](https://github.com/jean-patrick2026/rot_tom-/blob/main/lib/prisma.ts) (Prisma client), [`app/actions/reviewAction.ts`](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/actions/reviewAction.ts) (Save rating), [`services/user.service.ts`](https://github.com/jean-patrick2026/rot_tom-/blob/main/services/user.service.ts) (User service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Film experience"]
  node_home["Home page<br/>[page.tsx]"]
  node_catalogue["Movie catalogue"]
  node_film["Film detail<br/>[page.tsx]"]
  node_review_ui["Review form<br/>[review.tsx]"]
  node_review_action["Save rating<br/>[reviewAction.ts]"]
  node_comments_api["Comments API<br/>[route.ts]"]
  node_comment_delete["Delete comment<br/>[route.ts]"]
  node_favorites["Favorites<br/>[favoriteAction.ts]"]
  node_dashboard["User dashboard<br/>[page.tsx]"]
end

subgraph group_accounts["Accounts and admin"]
  node_auth_pages["Login and register<br/>[page.tsx]"]
  node_auth_route["Auth route<br/>[route.ts]"]
  node_auth_lib["Auth configuration<br/>[auth.ts]"]
  node_register_api["Registration API<br/>[route.ts]"]
  node_user_service["User service<br/>[user.service.ts]"]
  node_profile_api["Profile API<br/>[route.ts]"]
  node_profile_ui["Profile pages<br/>[page.tsx]"]
  node_admin["Admin screens<br/>[page.tsx]"]
end

subgraph group_integrations["Movie data"]
  node_movies_api["Catalogue API<br/>[route.ts]"]
  node_movie_service["Movie service<br/>[movie.service.ts]"]
  node_tmdb_api["TMDB API route<br/>[route.ts]"]
  node_tmdb_service["TMDB service<br/>[tmdb.service.ts]"]
end

subgraph group_runtime["Application runtime"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("MySQL database")]
end

node_visitor(("Visitor"))
node_tmdb["TMDB"]

node_visitor -->|"opens"| node_home
node_visitor -->|"signs in"| node_auth_pages
node_visitor -->|"views film"| node_film
node_review_ui -->|"submits rating"| node_review_action
node_review_action -->|"checks session"| node_auth_lib
node_review_action -->|"writes and aggregates"| node_prisma
node_comments_api -->|"reads and creates"| node_prisma
node_comment_delete -->|"checks session"| node_auth_lib
node_comment_delete -->|"reads and deletes"| node_prisma
node_register_api -->|"registers user"| node_user_service
node_register_api -.-> node_auth_lib
node_user_service -->|"reads and creates"| node_prisma
node_profile_api -->|"checks session"| node_auth_lib
node_profile_api -->|"updates profile"| node_user_service
node_movies_api -->|"checks admin"| node_auth_lib
node_movies_api -->|"manages movies"| node_movie_service
node_tmdb_api -->|"searches or lists"| node_tmdb_service
node_tmdb_service -.->|"requests movie data"| node_tmdb

click node_home "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/page.tsx"
click node_catalogue "https://github.com/jean-patrick2026/rot_tom-/blob/main/components/movie/MoviesCatalogue.tsx"
click node_film "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/film/%5Bid%5D/page.tsx"
click node_review_ui "https://github.com/jean-patrick2026/rot_tom-/blob/main/components/review.tsx"
click node_review_action "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/actions/reviewAction.ts"
click node_comments_api "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/comment/route.ts"
click node_comment_delete "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/comment/%5Bid%5D/route.ts"
click node_favorites "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/actions/favoriteAction.ts"
click node_dashboard "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/dashboard_user/page.tsx"
click node_auth_pages "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/(auth)/login/page.tsx"
click node_auth_route "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/auth/%5B...nextauth%5D/route.ts"
click node_auth_lib "https://github.com/jean-patrick2026/rot_tom-/blob/main/lib/auth.ts"
click node_register_api "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/register/route.ts"
click node_user_service "https://github.com/jean-patrick2026/rot_tom-/blob/main/services/user.service.ts"
click node_profile_api "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/profile/infos/route.ts"
click node_profile_ui "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/profile/page.tsx"
click node_admin "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/Admin/page.tsx"
click node_movies_api "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/movies/route.ts"
click node_movie_service "https://github.com/jean-patrick2026/rot_tom-/blob/main/services/movie.service.ts"
click node_tmdb_api "https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/tmdb/route.ts"
click node_tmdb_service "https://github.com/jean-patrick2026/rot_tom-/blob/main/services/tmdb.service.ts"
click node_prisma "https://github.com/jean-patrick2026/rot_tom-/blob/main/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_home,node_catalogue,node_film,node_review_ui,node_review_action,node_comments_api,node_comment_delete,node_favorites,node_dashboard toneBlue
class node_auth_pages,node_auth_route,node_auth_lib,node_register_api,node_user_service,node_profile_api,node_profile_ui,node_admin toneAmber
class node_movies_api,node_movie_service,node_tmdb_api,node_tmdb_service toneMint
class node_prisma,node_database toneRose
class node_visitor,node_tmdb toneIndigo
```

## Components

### Film experience

- [Home page](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/page.tsx): `app/page.tsx`
- [Movie catalogue](https://github.com/jean-patrick2026/rot_tom-/blob/main/components/movie/MoviesCatalogue.tsx): `components/movie/MoviesCatalogue.tsx`
- [Film detail](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/film/%5Bid%5D/page.tsx): `app/film/[id]/page.tsx`
- [Review form](https://github.com/jean-patrick2026/rot_tom-/blob/main/components/review.tsx): `components/review.tsx`
- [Save rating](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/actions/reviewAction.ts): `app/actions/reviewAction.ts`
- [Comments API](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/comment/route.ts): `app/api/comment/route.ts`
- [Delete comment](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/comment/%5Bid%5D/route.ts): `app/api/comment/[id]/route.ts`
- [Favorites](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/actions/favoriteAction.ts): `app/actions/favoriteAction.ts`
- [User dashboard](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/dashboard_user/page.tsx): `app/dashboard_user/page.tsx`

### Accounts and admin

- [Login and register](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/(auth)/login/page.tsx): `app/(auth)/login/page.tsx`
- [Auth route](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/auth/%5B...nextauth%5D/route.ts): `app/api/auth/[...nextauth]/route.ts`
- [Auth configuration](https://github.com/jean-patrick2026/rot_tom-/blob/main/lib/auth.ts): `lib/auth.ts`
- [Registration API](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/register/route.ts): `app/api/register/route.ts`
- [User service](https://github.com/jean-patrick2026/rot_tom-/blob/main/services/user.service.ts): `services/user.service.ts`
- [Profile API](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/profile/infos/route.ts): `app/api/profile/infos/route.ts`
- [Profile pages](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/profile/page.tsx): `app/profile/page.tsx`
- [Admin screens](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/Admin/page.tsx): `app/Admin/page.tsx`

### Movie data

- [Catalogue API](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/movies/route.ts): `app/api/movies/route.ts`
- [Movie service](https://github.com/jean-patrick2026/rot_tom-/blob/main/services/movie.service.ts): `services/movie.service.ts`
- [TMDB API route](https://github.com/jean-patrick2026/rot_tom-/blob/main/app/api/tmdb/route.ts): `app/api/tmdb/route.ts`
- [TMDB service](https://github.com/jean-patrick2026/rot_tom-/blob/main/services/tmdb.service.ts): `services/tmdb.service.ts`

### Application runtime

- [Prisma client](https://github.com/jean-patrick2026/rot_tom-/blob/main/lib/prisma.ts): `lib/prisma.ts`
- **MySQL database**

### Other components

- **Visitor**
- **TMDB**

## Connections

- Visitor → Home page: opens
- Visitor → Login and register: signs in
- Visitor → Film detail: views film
- Review form → Save rating: submits rating
- Save rating → Auth configuration: checks session
- Save rating → Prisma client: writes and aggregates
- Comments API → Prisma client: reads and creates
- Delete comment → Auth configuration: checks session
- Delete comment → Prisma client: reads and deletes
- Registration API → User service: registers user
- Registration API → Auth configuration
- User service → Prisma client: reads and creates
- Profile API → Auth configuration: checks session
- Profile API → User service: updates profile
- Catalogue API → Auth configuration: checks admin
- Catalogue API → Movie service: manages movies
- TMDB API route → TMDB service: searches or lists
- TMDB service → TMDB: requests movie data
