# donohuedev/entertainme architecture

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

- Interactive diagram: https://gitdiagram.com/donohuedev/entertainme
- Repository: https://github.com/donohuedev/entertainme

## Overview

entertainME is a media-tracking and review application for games, anime, movies, and shows. Users browse or search titles, view details, and—when authenticated—manage ratings and collection status through a dashboard; account flows support registration and sign-in. The React client calls an Express API, whose route handlers delegate to controllers that access PostgreSQL through Prisma. The README documents search, filtering, and movies/shows as capabilities, though their implementations are not sampled. Dashed links mark inferred HTTP or unsampled route wiring.

Main entry points: [`frontend/src/App.js`](https://github.com/donohuedev/entertainme/blob/main/frontend/src/App.js) (App routing), [`backend/src/server.ts`](https://github.com/donohuedev/entertainme/blob/main/backend/src/server.ts) (Express API), [`backend/src/controllers/authController.ts`](https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/authController.ts) (Authentication services), [`frontend/src/hooks/useFetchUserContentData.js`](https://github.com/donohuedev/entertainme/blob/main/frontend/src/hooks/useFetchUserContentData.js) (Collection data hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["App routing<br/>[App.js]"]
  node_home["Home browsing<br/>[HomePage.js]"]
  node_search["Search and filters<br/>[searchPage.js]"]
  node_game_detail["Game details<br/>[gameDetailPage.js]"]
  node_anime_detail["Anime details<br/>[animeDetailPage.js]"]
  node_dashboard["User dashboard"]
  node_profile["Profile management<br/>[ProfilePage.js]"]
end

subgraph group_identity["Accounts"]
  node_user_context["Session context<br/>[userContext.js]"]
  node_login["Login and registration<br/>[LoginPage.js]"]
  node_register["Registration<br/>[RegisterPage.js]"]
  node_oauth_callback["OAuth callback<br/>[OAuthCallback.js]"]
  node_auth_routes["Authentication routes<br/>[auth.ts]"]
  node_auth_controller["Authentication services<br/>[authController.ts]"]
  node_auth_middleware["JWT authorization<br/>[auth.ts]"]
end

subgraph group_catalog["Media catalog"]
  node_anime_controller["Anime catalog<br/>[animeController.ts]"]
  node_games_controller["Game catalog<br/>[gamesController.ts]"]
  node_movie_routes["Movie endpoints<br/>[movies.ts]"]
  node_show_routes["Show endpoints<br/>[shows.ts]"]
end

subgraph group_collections["User collections"]
  node_user_content_hook["Collection data hook"]
  node_user_content_routes["Collection routes<br/>[userGames.ts]"]
  node_user_content_controller["Ratings and status"]
end

subgraph group_platform["API and storage"]
  node_api_server["Express API<br/>[server.ts]"]
  node_postgres[("PostgreSQL<br/>[database.ts]")]
end

node_visitor(("User"))
node_media_api{{"RAWG and anime APIs"}}
node_email_service{{"Email service"}}
node_captcha_service{{"CAPTCHA service"}}

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_game_detail
node_app -->|"routes to"| node_search
node_app -->|"routes to"| node_anime_detail
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_profile
node_app -.->|"provides session"| node_user_context
node_visitor -->|"signs in"| node_login
node_visitor -->|"registers"| node_register
node_login -.->|"submits credentials"| node_auth_routes
node_register -.->|"submits registration"| node_auth_routes
node_oauth_callback -->|"sets session"| node_user_context
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -.->|"reads and writes"| node_postgres
node_auth_controller -->|"verifies challenge"| node_captcha_service
node_auth_controller -->|"sends verification"| node_email_service
node_dashboard -->|"loads collection"| node_user_content_hook
node_user_content_hook -.->|"fetches user data"| node_user_content_routes
node_user_content_routes -->|"dispatches"| node_user_content_controller
node_user_content_controller -.->|"updates ratings"| node_postgres
node_game_detail -.->|"loads user data"| node_user_content_hook
node_anime_detail -.->|"loads user data"| node_user_content_hook
node_home -.->|"requests catalog"| node_api_server
node_search -.->|"searches titles"| node_api_server
node_api_server -->|"mounts routes"| node_anime_controller
node_api_server -->|"mounts routes"| node_games_controller
node_api_server -.->|"mounts routes"| node_movie_routes
node_api_server -.->|"mounts routes"| node_show_routes
node_anime_controller -->|"reads and writes"| node_postgres
node_games_controller -->|"reads and writes"| node_postgres
node_games_controller -->|"imports game data"| node_media_api
node_anime_controller -.->|"imports anime data"| node_media_api
node_profile -.->|"updates profile"| node_api_server
node_api_server -.->|"protects endpoints"| node_auth_middleware

click node_app "https://github.com/donohuedev/entertainme/blob/main/frontend/src/App.js"
click node_home "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/HomePage.js"
click node_search "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/searchPage.js"
click node_game_detail "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/gameDetailPage.js"
click node_anime_detail "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/animeDetailPage.js"
click node_dashboard "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/AccountDashboard.js"
click node_profile "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/ProfilePage.js"
click node_user_context "https://github.com/donohuedev/entertainme/blob/main/frontend/src/context/userContext.js"
click node_login "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/LoginPage.js"
click node_register "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/RegisterPage.js"
click node_oauth_callback "https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/OAuthCallback.js"
click node_auth_routes "https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/auth.ts"
click node_auth_controller "https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/authController.ts"
click node_auth_middleware "https://github.com/donohuedev/entertainme/blob/main/backend/src/middleware/auth.ts"
click node_user_content_hook "https://github.com/donohuedev/entertainme/blob/main/frontend/src/hooks/useFetchUserContentData.js"
click node_user_content_routes "https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/userGames.ts"
click node_user_content_controller "https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/userContentController.ts"
click node_anime_controller "https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/animeController.ts"
click node_games_controller "https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/gamesController.ts"
click node_movie_routes "https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/movies.ts"
click node_show_routes "https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/shows.ts"
click node_api_server "https://github.com/donohuedev/entertainme/blob/main/backend/src/server.ts"
click node_postgres "https://github.com/donohuedev/entertainme/blob/main/backend/src/config/database.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_app,node_home,node_search,node_game_detail,node_anime_detail,node_dashboard,node_profile,node_visitor toneBlue
class node_user_context,node_login,node_register,node_oauth_callback,node_auth_routes,node_auth_controller,node_auth_middleware toneAmber
class node_anime_controller,node_games_controller,node_movie_routes,node_show_routes,node_media_api toneMint
class node_user_content_hook,node_user_content_routes,node_user_content_controller toneRose
class node_api_server,node_postgres,node_email_service,node_captcha_service toneIndigo
```

## Components

### React client

- [App routing](https://github.com/donohuedev/entertainme/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Home browsing](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/HomePage.js): `frontend/src/pages/HomePage.js`
- [Search and filters](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/searchPage.js): `frontend/src/pages/searchPage.js`
- [Game details](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/gameDetailPage.js): `frontend/src/pages/gameDetailPage.js`
- [Anime details](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/animeDetailPage.js): `frontend/src/pages/animeDetailPage.js`
- [User dashboard](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/AccountDashboard.js): `frontend/src/pages/AccountDashboard.js`
- [Profile management](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/ProfilePage.js): `frontend/src/pages/ProfilePage.js`

### Accounts

- [Session context](https://github.com/donohuedev/entertainme/blob/main/frontend/src/context/userContext.js): `frontend/src/context/userContext.js`
- [Login and registration](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/LoginPage.js): `frontend/src/pages/LoginPage.js`
- [Registration](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/RegisterPage.js): `frontend/src/pages/RegisterPage.js`
- [OAuth callback](https://github.com/donohuedev/entertainme/blob/main/frontend/src/pages/OAuthCallback.js): `frontend/src/pages/OAuthCallback.js`
- [Authentication routes](https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/auth.ts): `backend/src/routes/auth.ts`
- [Authentication services](https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/authController.ts): `backend/src/controllers/authController.ts`
- [JWT authorization](https://github.com/donohuedev/entertainme/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`

### Media catalog

- [Anime catalog](https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/animeController.ts): `backend/src/controllers/animeController.ts`
- [Game catalog](https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/gamesController.ts): `backend/src/controllers/gamesController.ts`
- [Movie endpoints](https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/movies.ts): `backend/src/routes/movies.ts`
- [Show endpoints](https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/shows.ts): `backend/src/routes/shows.ts`

### User collections

- [Collection data hook](https://github.com/donohuedev/entertainme/blob/main/frontend/src/hooks/useFetchUserContentData.js): `frontend/src/hooks/useFetchUserContentData.js`
- [Collection routes](https://github.com/donohuedev/entertainme/blob/main/backend/src/routes/userGames.ts): `backend/src/routes/userGames.ts`
- [Ratings and status](https://github.com/donohuedev/entertainme/blob/main/backend/src/controllers/userContentController.ts): `backend/src/controllers/userContentController.ts`

### API and storage

- [Express API](https://github.com/donohuedev/entertainme/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [PostgreSQL](https://github.com/donohuedev/entertainme/blob/main/backend/src/config/database.ts): `backend/src/config/database.ts`

### Other components

- **User**
- **RAWG and anime APIs**
- **Email service**
- **CAPTCHA service**

## Connections

- User → App routing: uses
- App routing → Home browsing: routes to (evidence: `frontend/src/App.js`)
- App routing → Game details: routes to (evidence: `frontend/src/App.js`)
- App routing → Search and filters: routes to (evidence: `frontend/src/App.js`)
- App routing → Anime details: routes to (evidence: `frontend/src/App.js`)
- App routing → User dashboard: routes to (evidence: `frontend/src/App.js`)
- App routing → Profile management: routes to (evidence: `frontend/src/App.js`)
- App routing → Session context: provides session (evidence: `frontend/src/App.js`)
- User → Login and registration: signs in
- User → Registration: registers
- Login and registration → Authentication routes: submits credentials
- Registration → Authentication routes: submits registration
- OAuth callback → Session context: sets session (evidence: `frontend/src/pages/OAuthCallback.js`)
- Authentication routes → Authentication services: dispatches (evidence: `backend/src/routes/auth.ts`)
- Authentication services → PostgreSQL: reads and writes
- Authentication services → CAPTCHA service: verifies challenge (evidence: `backend/src/controllers/authController.ts`)
- Authentication services → Email service: sends verification (evidence: `backend/src/controllers/authController.ts`)
- User dashboard → Collection data hook: loads collection (evidence: `frontend/src/pages/AccountDashboard.js`)
- Collection data hook → Collection routes: fetches user data
- Collection routes → Ratings and status: dispatches (evidence: `backend/src/routes/userGames.ts`)
- Ratings and status → PostgreSQL: updates ratings
- Game details → Collection data hook: loads user data
- Anime details → Collection data hook: loads user data
- Home browsing → Express API: requests catalog
- Search and filters → Express API: searches titles
- Express API → Anime catalog: mounts routes (evidence: `backend/src/server.ts`)
- Express API → Game catalog: mounts routes (evidence: `backend/src/server.ts`)
- Express API → Movie endpoints: mounts routes
- Express API → Show endpoints: mounts routes
- Anime catalog → PostgreSQL: reads and writes (evidence: `backend/src/controllers/animeController.ts`)
- Game catalog → PostgreSQL: reads and writes (evidence: `backend/src/controllers/gamesController.ts`)
- Game catalog → RAWG and anime APIs: imports game data (evidence: `backend/src/controllers/gamesController.ts`)
- Anime catalog → RAWG and anime APIs: imports anime data
- Profile management → Express API: updates profile
- Express API → JWT authorization: protects endpoints
