# strikec71/movie-gallery architecture

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

- Interactive diagram: https://gitdiagram.com/strikec71/movie-gallery
- Repository: https://github.com/strikec71/movie-gallery

## Overview

React Movie Gallery is a film-discovery and personal catalog SPA. Users browse and filter the Kinopoisk catalog, inspect films, and manage favorites and watched lists; signed-in users’ lists are stored in Supabase. Admins can add or edit custom films, and the movie-page experience also offers an AI recommendation assistant. The graph shows documented capabilities and relationships evidenced by excerpts, the source index, or the README; unsampled implementation details and undocumented connections are omitted.

Main entry points: [`src/context/MovieContext.jsx`](https://github.com/strikec71/movie-gallery/blob/main/src/context/MovieContext.jsx) (Movie data and actions), [`src/App.jsx`](https://github.com/strikec71/movie-gallery/blob/main/src/App.jsx) (App routing), [`src/pages/MoviesPage.jsx`](https://github.com/strikec71/movie-gallery/blob/main/src/pages/MoviesPage.jsx) (Movie discovery), [`src/context/AuthContext.jsx`](https://github.com/strikec71/movie-gallery/blob/main/src/context/AuthContext.jsx) (Authentication state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Application experience"]
  node_app["App routing<br/>[App.jsx]"]
  node_home["Home page<br/>[HomePage.jsx]"]
  node_movies["Movie discovery<br/>[MoviesPage.jsx]"]
  node_favorites["Favorites page<br/>[FavoritesPage.jsx]"]
  node_watched["Watched page<br/>[WatchedPage.jsx]"]
  node_profile["User profile<br/>[ProfilePage.jsx]"]
  node_addmovie["Custom movie form<br/>[AddMoviePage.jsx]"]
end

subgraph group_catalog["Catalog and discovery"]
  node_moviecontext["Movie data and actions<br/>[MovieContext.jsx]"]
  node_filters["Filter controls<br/>[FilterBar.jsx]"]
  node_genres["Genre mapping<br/>[movieGenres.js]"]
  node_moviecard["Movie card<br/>[MovieCard.jsx]"]
  node_movielist["Movie list<br/>[MovieList.jsx]"]
  node_moviemodal["Movie details<br/>[Modal.jsx]"]
  node_roulette["Movie roulette<br/>[RouletteModal.jsx]"]
  node_aiassistant["AI assistant<br/>[AiAssistant.jsx]"]
  node_aiservice["AI request service<br/>[aiService.js]"]
end

subgraph group_personal["User collections and access"]
  node_auth["Authentication state<br/>[AuthContext.jsx]"]
  node_authmodal["Sign-in dialog<br/>[AuthModal.jsx]"]
  node_authguard["Access guard<br/>[withAuth.jsx]"]
end

subgraph group_services["External services"]
  node_supabaseclient["Supabase client<br/>[supabase.js]"]
  node_supabase[("Supabase backend")]
  node_kinopoiskapi["Kinopoisk API client<br/>[kinopoisk.js]"]
  node_kinopoisk["Kinopoisk API"]
  node_groq["Groq API"]
end

subgraph group_shared["Shared application state"]
  node_theme["Theme state<br/>[ThemeContext.jsx]"]
  node_notifications["Notifications"]
  node_entry["Provider setup<br/>[main.jsx]"]
end

node_moviegoer(("Moviegoer"))

node_moviegoer -.->|"uses"| node_app
node_entry -->|"renders"| node_app
node_entry -->|"provides state"| node_moviecontext
node_entry -->|"provides state"| node_auth
node_entry -->|"provides state"| node_theme
node_entry -->|"provides state"| node_notifications
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_movies
node_app -->|"routes to"| node_favorites
node_app -->|"routes to"| node_watched
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_addmovie
node_movies -->|"reads state"| node_moviecontext
node_movies -->|"renders"| node_filters
node_movies -->|"renders"| node_aiassistant
node_favorites -->|"reads state"| node_moviecontext
node_favorites -->|"renders"| node_filters
node_watched -->|"reads state"| node_moviecontext
node_profile -->|"reads state"| node_moviecontext
node_profile -->|"checks access"| node_auth
node_addmovie -->|"refreshes custom films"| node_moviecontext
node_addmovie -->|"writes film"| node_supabaseclient
node_addmovie -->|"checks admin"| node_auth
node_moviecontext -->|"requests catalog"| node_kinopoiskapi
node_kinopoiskapi -.->|"fetches films"| node_kinopoisk
node_moviecontext -->|"syncs collections"| node_supabaseclient
node_auth -->|"authenticates"| node_supabaseclient
node_supabaseclient -.->|"connects"| node_supabase
node_moviecontext -->|"reports errors"| node_notifications
node_moviecontext -->|"maps catalog genres"| node_genres
node_filters -->|"updates filters"| node_moviecontext
node_filters -->|"opens"| node_roulette
node_movies -->|"renders"| node_movielist
node_movielist -->|"renders"| node_moviecard
node_moviecard -->|"toggles lists"| node_moviecontext
node_movies -->|"renders details"| node_moviemodal
node_moviemodal -->|"requests trailer and actions"| node_moviecontext
node_aiassistant -->|"sends prompts"| node_aiservice
node_aiservice -->|"requests completion"| node_groq
node_authmodal -->|"signs in"| node_auth
node_authguard -->|"checks access"| node_auth

click node_app "https://github.com/strikec71/movie-gallery/blob/main/src/App.jsx"
click node_home "https://github.com/strikec71/movie-gallery/blob/main/src/pages/HomePage.jsx"
click node_movies "https://github.com/strikec71/movie-gallery/blob/main/src/pages/MoviesPage.jsx"
click node_favorites "https://github.com/strikec71/movie-gallery/blob/main/src/pages/FavoritesPage.jsx"
click node_watched "https://github.com/strikec71/movie-gallery/blob/main/src/pages/WatchedPage.jsx"
click node_profile "https://github.com/strikec71/movie-gallery/blob/main/src/pages/ProfilePage.jsx"
click node_addmovie "https://github.com/strikec71/movie-gallery/blob/main/src/pages/AddMoviePage.jsx"
click node_moviecontext "https://github.com/strikec71/movie-gallery/blob/main/src/context/MovieContext.jsx"
click node_filters "https://github.com/strikec71/movie-gallery/blob/main/src/components/FilterBar.jsx"
click node_genres "https://github.com/strikec71/movie-gallery/blob/main/src/constants/movieGenres.js"
click node_moviecard "https://github.com/strikec71/movie-gallery/blob/main/src/components/MovieCard.jsx"
click node_movielist "https://github.com/strikec71/movie-gallery/blob/main/src/components/MovieList.jsx"
click node_moviemodal "https://github.com/strikec71/movie-gallery/blob/main/src/components/Modal.jsx"
click node_roulette "https://github.com/strikec71/movie-gallery/blob/main/src/components/RouletteModal.jsx"
click node_aiassistant "https://github.com/strikec71/movie-gallery/blob/main/src/components/AiAssistant.jsx"
click node_aiservice "https://github.com/strikec71/movie-gallery/blob/main/src/api/aiService.js"
click node_auth "https://github.com/strikec71/movie-gallery/blob/main/src/context/AuthContext.jsx"
click node_authmodal "https://github.com/strikec71/movie-gallery/blob/main/src/components/AuthModal.jsx"
click node_authguard "https://github.com/strikec71/movie-gallery/blob/main/src/hoc/withAuth.jsx"
click node_supabaseclient "https://github.com/strikec71/movie-gallery/blob/main/src/api/supabase.js"
click node_kinopoiskapi "https://github.com/strikec71/movie-gallery/blob/main/src/api/kinopoisk.js"
click node_theme "https://github.com/strikec71/movie-gallery/blob/main/src/context/ThemeContext.jsx"
click node_notifications "https://github.com/strikec71/movie-gallery/blob/main/src/context/NotificationContext.jsx"
click node_entry "https://github.com/strikec71/movie-gallery/blob/main/src/main.jsx"

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_movies,node_favorites,node_watched,node_profile,node_addmovie toneBlue
class node_moviecontext,node_filters,node_genres,node_moviecard,node_movielist,node_moviemodal,node_roulette,node_aiassistant,node_aiservice toneAmber
class node_auth,node_authmodal,node_authguard toneMint
class node_supabaseclient,node_supabase,node_kinopoiskapi,node_kinopoisk,node_groq toneRose
class node_theme,node_notifications,node_entry,node_moviegoer toneIndigo
```

## Components

### Application experience

- [App routing](https://github.com/strikec71/movie-gallery/blob/main/src/App.jsx): `src/App.jsx`
- [Home page](https://github.com/strikec71/movie-gallery/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Movie discovery](https://github.com/strikec71/movie-gallery/blob/main/src/pages/MoviesPage.jsx): `src/pages/MoviesPage.jsx`
- [Favorites page](https://github.com/strikec71/movie-gallery/blob/main/src/pages/FavoritesPage.jsx): `src/pages/FavoritesPage.jsx`
- [Watched page](https://github.com/strikec71/movie-gallery/blob/main/src/pages/WatchedPage.jsx): `src/pages/WatchedPage.jsx`
- [User profile](https://github.com/strikec71/movie-gallery/blob/main/src/pages/ProfilePage.jsx): `src/pages/ProfilePage.jsx`
- [Custom movie form](https://github.com/strikec71/movie-gallery/blob/main/src/pages/AddMoviePage.jsx): `src/pages/AddMoviePage.jsx`

### Catalog and discovery

- [Movie data and actions](https://github.com/strikec71/movie-gallery/blob/main/src/context/MovieContext.jsx): `src/context/MovieContext.jsx`
- [Filter controls](https://github.com/strikec71/movie-gallery/blob/main/src/components/FilterBar.jsx): `src/components/FilterBar.jsx`
- [Genre mapping](https://github.com/strikec71/movie-gallery/blob/main/src/constants/movieGenres.js): `src/constants/movieGenres.js`
- [Movie card](https://github.com/strikec71/movie-gallery/blob/main/src/components/MovieCard.jsx): `src/components/MovieCard.jsx`
- [Movie list](https://github.com/strikec71/movie-gallery/blob/main/src/components/MovieList.jsx): `src/components/MovieList.jsx`
- [Movie details](https://github.com/strikec71/movie-gallery/blob/main/src/components/Modal.jsx): `src/components/Modal.jsx`
- [Movie roulette](https://github.com/strikec71/movie-gallery/blob/main/src/components/RouletteModal.jsx): `src/components/RouletteModal.jsx`
- [AI assistant](https://github.com/strikec71/movie-gallery/blob/main/src/components/AiAssistant.jsx): `src/components/AiAssistant.jsx`
- [AI request service](https://github.com/strikec71/movie-gallery/blob/main/src/api/aiService.js): `src/api/aiService.js`

### User collections and access

- [Authentication state](https://github.com/strikec71/movie-gallery/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Sign-in dialog](https://github.com/strikec71/movie-gallery/blob/main/src/components/AuthModal.jsx): `src/components/AuthModal.jsx`
- [Access guard](https://github.com/strikec71/movie-gallery/blob/main/src/hoc/withAuth.jsx): `src/hoc/withAuth.jsx`

### External services

- [Supabase client](https://github.com/strikec71/movie-gallery/blob/main/src/api/supabase.js): `src/api/supabase.js`
- **Supabase backend**
- [Kinopoisk API client](https://github.com/strikec71/movie-gallery/blob/main/src/api/kinopoisk.js): `src/api/kinopoisk.js`
- **Kinopoisk API**
- **Groq API**

### Shared application state

- [Theme state](https://github.com/strikec71/movie-gallery/blob/main/src/context/ThemeContext.jsx): `src/context/ThemeContext.jsx`
- [Notifications](https://github.com/strikec71/movie-gallery/blob/main/src/context/NotificationContext.jsx): `src/context/NotificationContext.jsx`
- [Provider setup](https://github.com/strikec71/movie-gallery/blob/main/src/main.jsx): `src/main.jsx`

### Other components

- **Moviegoer**

## Connections

- Moviegoer → App routing: uses (evidence: `README.md`)
- Provider setup → App routing: renders (evidence: `src/main.jsx`)
- Provider setup → Movie data and actions: provides state (evidence: `src/main.jsx`)
- Provider setup → Authentication state: provides state (evidence: `src/main.jsx`)
- Provider setup → Theme state: provides state (evidence: `src/main.jsx`)
- Provider setup → Notifications: provides state (evidence: `src/main.jsx`)
- App routing → Home page: routes to (evidence: `src/App.jsx`)
- App routing → Movie discovery: routes to (evidence: `src/App.jsx`)
- App routing → Favorites page: routes to (evidence: `src/App.jsx`)
- App routing → Watched page: routes to (evidence: `src/App.jsx`)
- App routing → User profile: routes to (evidence: `src/App.jsx`)
- App routing → Custom movie form: routes to (evidence: `src/App.jsx`)
- Movie discovery → Movie data and actions: reads state (evidence: `src/pages/MoviesPage.jsx`)
- Movie discovery → Filter controls: renders (evidence: `src/pages/MoviesPage.jsx`)
- Movie discovery → AI assistant: renders (evidence: `src/pages/MoviesPage.jsx`)
- Favorites page → Movie data and actions: reads state (evidence: `src/pages/FavoritesPage.jsx`)
- Favorites page → Filter controls: renders (evidence: `src/pages/FavoritesPage.jsx`)
- Watched page → Movie data and actions: reads state (evidence: `src/pages/WatchedPage.jsx`)
- User profile → Movie data and actions: reads state (evidence: `src/pages/ProfilePage.jsx`)
- User profile → Authentication state: checks access (evidence: `src/pages/ProfilePage.jsx`)
- Custom movie form → Movie data and actions: refreshes custom films (evidence: `src/pages/AddMoviePage.jsx`)
- Custom movie form → Supabase client: writes film (evidence: `src/pages/AddMoviePage.jsx`)
- Custom movie form → Authentication state: checks admin (evidence: `src/pages/AddMoviePage.jsx`)
- Movie data and actions → Kinopoisk API client: requests catalog (evidence: `src/context/MovieContext.jsx`)
- Kinopoisk API client → Kinopoisk API: fetches films (evidence: `README.md`)
- Movie data and actions → Supabase client: syncs collections (evidence: `src/context/MovieContext.jsx`)
- Authentication state → Supabase client: authenticates (evidence: `src/context/AuthContext.jsx`)
- Supabase client → Supabase backend: connects (evidence: `README.md`)
- Movie data and actions → Notifications: reports errors (evidence: `src/context/MovieContext.jsx`)
- Movie data and actions → Genre mapping: maps catalog genres
- Filter controls → Movie data and actions: updates filters (evidence: `src/components/FilterBar.jsx`)
- Filter controls → Movie roulette: opens (evidence: `src/components/FilterBar.jsx`)
- Movie discovery → Movie list: renders (evidence: `src/pages/MoviesPage.jsx`)
- Movie list → Movie card: renders (evidence: `src/components/MovieList.jsx`)
- Movie card → Movie data and actions: toggles lists (evidence: `src/components/MovieCard.jsx`)
- Movie discovery → Movie details: renders details (evidence: `src/pages/MoviesPage.jsx`)
- Movie details → Movie data and actions: requests trailer and actions (evidence: `src/components/Modal.jsx`)
- AI assistant → AI request service: sends prompts (evidence: `src/components/AiAssistant.jsx`)
- AI request service → Groq API: requests completion (evidence: `src/api/aiService.js`)
- Sign-in dialog → Authentication state: signs in (evidence: `src/components/AuthModal.jsx`)
- Access guard → Authentication state: checks access (evidence: `src/hoc/withAuth.jsx`)
