# sizanrana/bok-flix architecture

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

- Interactive diagram: https://gitdiagram.com/sizanrana/bok-flix
- Repository: https://github.com/sizanrana/bok-flix

## Overview

This is a small Next.js image-hero app rather than a complete book or streaming product. The main workflow renders the home page’s hero, extracts colors from its fixed image URL, derives a gradient background, and displays a loading screen while that work is pending. The excerpts support the component and hook calls; the README describes running and opening the app but provides no product-specific features. The referenced image is not present in the supplied tree, so its asset path is unknown.

Main entry points: [`src/components/heroSection/HeroSection.tsx`](https://github.com/sizanrana/bok-flix/blob/main/src/components/heroSection/HeroSection.tsx) (Hero section), [`src/app/(site)/page.tsx`](https://github.com/sizanrana/bok-flix/blob/main/src/app/(site)/page.tsx) (Home page), [`src/hooks/useGetImageGradientBgCSS.ts`](https://github.com/sizanrana/bok-flix/blob/main/src/hooks/useGetImageGradientBgCSS.ts) (Gradient hook), [`src/hooks/useGetImageColors.ts`](https://github.com/sizanrana/bok-flix/blob/main/src/hooks/useGetImageColors.ts) (Color hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_home["Home page<br/>[page.tsx]"]
  node_layout["Root layout<br/>[layout.tsx]"]
end

subgraph group_hero["Hero interface"]
  node_hero_section["Hero section<br/>[HeroSection.tsx]"]
  node_loading_screen["Loading screen"]
end

subgraph group_image["Image styling"]
  node_gradient_hook["Gradient hook"]
  node_color_hook["Color hook"]
end

node_visitor(("Visitor"))
node_color_extractor["Color extractor"]
node_hero_image["Hero image"]

node_visitor -->|"opens app"| node_home
node_home -->|"renders"| node_hero_section
node_hero_section -->|"gets gradient"| node_gradient_hook
node_gradient_hook -->|"gets colors"| node_color_hook
node_color_hook -->|"extracts colors"| node_color_extractor
node_hero_section -->|"renders while loading"| node_loading_screen
node_hero_section -->|"displays"| node_hero_image

click node_home "https://github.com/sizanrana/bok-flix/blob/main/src/app/(site)/page.tsx"
click node_layout "https://github.com/sizanrana/bok-flix/blob/main/src/app/layout.tsx"
click node_hero_section "https://github.com/sizanrana/bok-flix/blob/main/src/components/heroSection/HeroSection.tsx"
click node_loading_screen "https://github.com/sizanrana/bok-flix/blob/main/src/components/loading/FullPageLoadingScreen.tsx"
click node_gradient_hook "https://github.com/sizanrana/bok-flix/blob/main/src/hooks/useGetImageGradientBgCSS.ts"
click node_color_hook "https://github.com/sizanrana/bok-flix/blob/main/src/hooks/useGetImageColors.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_layout toneBlue
class node_hero_section,node_loading_screen toneAmber
class node_gradient_hook,node_color_hook toneMint
class node_visitor,node_color_extractor,node_hero_image toneIndigo
```

## Components

### App shell

- [Home page](https://github.com/sizanrana/bok-flix/blob/main/src/app/(site)/page.tsx): `src/app/(site)/page.tsx`
- [Root layout](https://github.com/sizanrana/bok-flix/blob/main/src/app/layout.tsx): `src/app/layout.tsx`

### Hero interface

- [Hero section](https://github.com/sizanrana/bok-flix/blob/main/src/components/heroSection/HeroSection.tsx): `src/components/heroSection/HeroSection.tsx`
- [Loading screen](https://github.com/sizanrana/bok-flix/blob/main/src/components/loading/FullPageLoadingScreen.tsx): `src/components/loading/FullPageLoadingScreen.tsx`

### Image styling

- [Gradient hook](https://github.com/sizanrana/bok-flix/blob/main/src/hooks/useGetImageGradientBgCSS.ts): `src/hooks/useGetImageGradientBgCSS.ts`
- [Color hook](https://github.com/sizanrana/bok-flix/blob/main/src/hooks/useGetImageColors.ts): `src/hooks/useGetImageColors.ts`

### Other components

- **Visitor**
- **Color extractor**
- **Hero image**

## Connections

- Visitor → Home page: opens app (evidence: `README.md`)
- Home page → Hero section: renders (evidence: `src/app/(site)/page.tsx`)
- Hero section → Gradient hook: gets gradient (evidence: `src/components/heroSection/HeroSection.tsx`)
- Gradient hook → Color hook: gets colors (evidence: `src/hooks/useGetImageGradientBgCSS.ts`)
- Color hook → Color extractor: extracts colors (evidence: `src/hooks/useGetImageColors.ts`)
- Hero section → Loading screen: renders while loading (evidence: `src/components/heroSection/HeroSection.tsx`)
- Hero section → Hero image: displays (evidence: `src/components/heroSection/HeroSection.tsx`)
