# sirkvonleben/cinemax architecture

> Architecture diagram of the GitHub repository sirkvonleben/cinemax, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sirkvonleben/cinemax
- Repository: https://github.com/sirkvonleben/cinemax

## Overview

##### Project type and purpose
- This is a single-page React application (bootstrapped with Create React App) for browsing and viewing movie data. There is no custom backend in this repo; it fetches data via a service layer (`src/services/movieService.js`) and uses client-side state and storage (Context API, hooks, localStorage).

##### File structure
- Top-level: configuration (`.eslintrc.js`, `.prettierrc`, Husky hooks), standard CRA files (`public/`, `README.md`, `package.json`).
- `public/`: static HTML shell and manifest.
- `src/`:
- `index.jsx` and `App.jsx` bootstrap React and wrap the app in providers.
- `appRoutes.js`: client-side routing.
- `components/`: reusable UI controls (Header, Footer, HeroSection, MovieCard, MovieModal).
- `layouts/`: `MainLayout.jsx` applies common page chrome.
- `pages/`: two routes—`Home` and `MovieDetails`.
- `context/AuthContext.jsx`: app-wide authentication or user state container.
- `hooks/`: custom hooks—`useFetchMovies`, `useLocalStorage`.
- `services/movieService.js`: abstracts API calls or static data.
- `data/movies.js`: fallback/static movie dataset.
- `utils/formatDate.js`: helper function.
- `styles/` and module CSS files for styling.

## Diagram (Mermaid)

```mermaid
flowchart TB
    Browser["Browser/Client"]:::external
    Server["Static File Server"]:::server
    Browser -->|"requests index.html"| Server
    Server -->|"serves index.html"| ReactApp["React Application"]:::app

    subgraph "React Application"
        subgraph "Entry Point"
            Index["index.jsx"]:::entry
            App["App.jsx"]:::entry
        end

        subgraph "Routing Layer"
            Routes["appRoutes.js"]:::routing
        end

        subgraph "Layout"
            Layout["MainLayout.jsx"]:::layout
        end

        subgraph "Pages"
            Home["Home.jsx"]:::page
            Details["MovieDetails.jsx"]:::page
        end

        subgraph "UI Components"
            Header["Header.jsx"]:::ui
            Footer["Footer.jsx"]:::ui
            Hero["HeroSection.jsx"]:::ui
            Card["MovieCard.jsx"]:::ui
            Modal["MovieModal.jsx"]:::ui
        end

        subgraph "State & Hooks"
            Auth["AuthContext.jsx"]:::state
            FetchHook["useFetchMovies.js"]:::hook
            LocalHook["useLocalStorage.js"]:::hook
            HooksIndex["index.js"]:::hook
        end

        subgraph "Service & Data"
            Service["movieService.js"]:::service
            Data["movies.js"]:::data
            API["External API"]:::externalAPI
        end

        subgraph "Utilities"
            Format["formatDate.js"]:::util
        end

        subgraph "Storage"
            LocalStorage["LocalStorage"]:::storage
        end

        ReactApp --> Index
        Index --> App
        App --> Routes
        Routes --> Home
        Routes --> Details
        Home --> Layout
        Details --> Layout
        Layout --> Header
        Layout --> Footer
        Home --> Hero
        Home --> Card
        Card --> Modal
        Home --> FetchHook
        Details --> FetchHook
        FetchHook --> Service
        Service --> API
        Service --> Data
        FetchHook --> LocalHook
        LocalHook --> LocalStorage
        Layout -.-> Format
        App --> Auth
        Format --> Card
    end

    click Index "https://github.com/sirkvonleben/cinemax/blob/main/src/index.jsx"
    click App "https://github.com/sirkvonleben/cinemax/blob/main/src/App.jsx"
    click Routes "https://github.com/sirkvonleben/cinemax/blob/main/src/appRoutes.js"
    click Layout "https://github.com/sirkvonleben/cinemax/blob/main/src/layouts/MainLayout.jsx"
    click Home "https://github.com/sirkvonleben/cinemax/blob/main/src/pages/Home/Home.jsx"
    click Details "https://github.com/sirkvonleben/cinemax/blob/main/src/pages/MovieDetails/MovieDetails.jsx"
    click Header "https://github.com/sirkvonleben/cinemax/blob/main/src/components/Header/header.jsx"
    click Footer "https://github.com/sirkvonleben/cinemax/blob/main/src/components/Footer/Footer.jsx"
    click Hero "https://github.com/sirkvonleben/cinemax/blob/main/src/components/HeroSection/HeroSection.jsx"
    click Card "https://github.com/sirkvonleben/cinemax/blob/main/src/components/MovieCard/MovieCard.jsx"
    click Modal "https://github.com/sirkvonleben/cinemax/blob/main/src/components/MovieModal/MovieModal.jsx"
    click Auth "https://github.com/sirkvonleben/cinemax/blob/main/src/context/AuthContext.jsx"
    click FetchHook "https://github.com/sirkvonleben/cinemax/blob/main/src/hooks/useFetchMovies.js"
    click LocalHook "https://github.com/sirkvonleben/cinemax/blob/main/src/hooks/useLocalStorage.js"
    click HooksIndex "https://github.com/sirkvonleben/cinemax/blob/main/src/hooks/index.js"
    click Service "https://github.com/sirkvonleben/cinemax/blob/main/src/services/movieService.js"
    click Data "https://github.com/sirkvonleben/cinemax/blob/main/src/data/movies.js"
    click Format "https://github.com/sirkvonleben/cinemax/blob/main/src/utils/formatDate.js"

    classDef external fill:#D0E6FF,stroke:#0066CC,color:#003366
    classDef server fill:#FFF4CC,stroke:#FFCC00,color:#997700
    classDef app fill:#EFEFEF,stroke:#CCCCCC,color:#333333
    classDef entry fill:#CCF2FF,stroke:#00BFFF,color:#005F7F
    classDef routing fill:#CCF2FF,stroke:#00BFFF,color:#005F7F
    classDef layout fill:#CCF2FF,stroke:#00BFFF,color:#005F7F
    classDef page fill:#CCE5FF,stroke:#3399FF,color:#003366
    classDef ui fill:#CCE5FF,stroke:#3399FF,color:#003366
    classDef state fill:#E6FFE6,stroke:#33CC33,color:#006600
    classDef hook fill:#E6FFE6,stroke:#33CC33,color:#006600
    classDef service fill:#FFE6CC,stroke:#FF9933,color:#994D00
    classDef data fill:#F3E6FF,stroke:#CC99FF,color:#660099
    classDef util fill:#E6E6E6,stroke:#999999,color:#333333
    classDef storage fill:#FFD9E6,stroke:#FF66A3,color:#990033
    classDef externalAPI fill:#D0E6FF,stroke:#0066CC,color:#003366
```
