# mohamed-07/login-by-supabase architecture

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

- Interactive diagram: https://gitdiagram.com/mohamed-07/login-by-supabase
- Repository: https://github.com/mohamed-07/login-by-supabase

## Overview

This is a React media-discovery application with Supabase authentication and a personal watchlist. Users sign in, enter protected browsing pages, explore trending titles, movies and TV shows, open media details, and manage a list. The graph shows the routed workflow and the main query/service layers for the documented-in-code capabilities. Some feature services and components were not excerpted, so their connections to external APIs are left unverified rather than inferred.

Main entry points: [`src/routes/router.tsx`](https://github.com/mohamed-07/login-by-supabase/blob/main/src/routes/router.tsx) (Route dispatch), [`src/features/auth/store/authStore.ts`](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/auth/store/authStore.ts) (Auth state), [`src/App.tsx`](https://github.com/mohamed-07/login-by-supabase/blob/main/src/App.tsx) (App bootstrap), [`src/features/myList/hooks/useMyList.ts`](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/hooks/useMyList.ts) (List queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application Shell"]
  node_app["App bootstrap<br/>[App.tsx]"]
  node_router["Route dispatch<br/>[router.tsx]"]
  node_navbar["Navigation bar<br/>[Navbar.tsx]"]
end

subgraph group_auth["Authentication"]
  node_authstore[("Auth state<br/>[authStore.ts]")]
  node_authpages["Login and registration"]
  node_supabase["Supabase Auth<br/>[supabaseClient.ts]"]
end

subgraph group_discovery["Media Discovery"]
  node_home["Home and trending"]
  node_heroquery["Hero item query<br/>[useHeroItems.ts]"]
  node_genreapi["Genre service<br/>[genres.api.ts]"]
  node_movies["Movie browsing<br/>[MovisePage.tsx]"]
  node_tvshows["TV browsing<br/>[TvShowsPage.tsx]"]
  node_tmdbclient["TMDB client<br/>[tmdbClient.ts]"]
end

subgraph group_details["Media Details"]
  node_detailspage["Media detail view"]
  node_detailsquery["Details queries<br/>[useMediaDetails.ts]"]
  node_detailsapi["Details service"]
end

subgraph group_list["Personal List"]
  node_mylistpage["My List page<br/>[MyListPage.tsx]"]
  node_mylistquery["List queries<br/>[useMyList.ts]"]
  node_mylistapi["List service<br/>[my-list.api.ts]"]
end

node_user(("Viewer"))
node_tmdb["TMDB API"]

node_user -->|"opens app"| node_app
node_app -->|"initializes auth"| node_authstore
node_app -->|"renders routes"| node_router
node_router -->|"routes to"| node_authpages
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_movies
node_router -->|"routes to"| node_tvshows
node_router -->|"routes to"| node_detailspage
node_router -->|"routes to"| node_mylistpage
node_home -->|"uses"| node_heroquery
node_heroquery -->|"fetches genres"| node_genreapi
node_genreapi -->|"uses client"| node_tmdbclient
node_tmdbclient -.->|"requests data"| node_tmdb
node_detailspage -->|"loads details"| node_detailsquery
node_detailsquery -->|"queries service"| node_detailsapi
node_detailsapi -->|"uses client"| node_tmdbclient
node_mylistpage -->|"uses"| node_mylistquery
node_mylistquery -->|"reads user"| node_authstore
node_mylistquery -->|"calls service"| node_mylistapi
node_authstore -->|"auth operations"| node_supabase
node_navbar -->|"reads user"| node_authstore
node_navbar -.->|"navigates routes"| node_router

click node_app "https://github.com/mohamed-07/login-by-supabase/blob/main/src/App.tsx"
click node_router "https://github.com/mohamed-07/login-by-supabase/blob/main/src/routes/router.tsx"
click node_navbar "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/layout/Navbar.tsx"
click node_authstore "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/auth/store/authStore.ts"
click node_authpages "https://github.com/mohamed-07/login-by-supabase/tree/main/src/features/auth/pages"
click node_supabase "https://github.com/mohamed-07/login-by-supabase/blob/main/src/lib/supabaseClient.ts"
click node_home "https://github.com/mohamed-07/login-by-supabase/tree/main/src/features/home/pages"
click node_heroquery "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/home/hooks/useHeroItems.ts"
click node_genreapi "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/home/services/genres.api.ts"
click node_movies "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/mouvise/page/MovisePage.tsx"
click node_tvshows "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/tvShows/page/TvShowsPage.tsx"
click node_tmdbclient "https://github.com/mohamed-07/login-by-supabase/blob/main/src/lib/tmdbClient.ts"
click node_detailspage "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/movisTvDetails/pages/MovisTvDetailsPage.tsx"
click node_detailsquery "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/movisTvDetails/hooks/useMediaDetails.ts"
click node_detailsapi "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/movisTvDetails/services/mediaDetails.api.ts"
click node_mylistpage "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/pages/MyListPage.tsx"
click node_mylistquery "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/hooks/useMyList.ts"
click node_mylistapi "https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/services/my-list.api.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_router,node_navbar,node_user toneBlue
class node_authstore,node_authpages,node_supabase toneAmber
class node_home,node_heroquery,node_genreapi,node_movies,node_tvshows,node_tmdbclient,node_tmdb toneMint
class node_detailspage,node_detailsquery,node_detailsapi toneRose
class node_mylistpage,node_mylistquery,node_mylistapi toneIndigo
```

## Components

### Application Shell

- [App bootstrap](https://github.com/mohamed-07/login-by-supabase/blob/main/src/App.tsx): `src/App.tsx`
- [Route dispatch](https://github.com/mohamed-07/login-by-supabase/blob/main/src/routes/router.tsx): `src/routes/router.tsx`
- [Navigation bar](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/layout/Navbar.tsx): `src/features/layout/Navbar.tsx`

### Authentication

- [Auth state](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/auth/store/authStore.ts): `src/features/auth/store/authStore.ts`
- [Login and registration](https://github.com/mohamed-07/login-by-supabase/tree/main/src/features/auth/pages): `src/features/auth/pages`
- [Supabase Auth](https://github.com/mohamed-07/login-by-supabase/blob/main/src/lib/supabaseClient.ts): `src/lib/supabaseClient.ts`

### Media Discovery

- [Home and trending](https://github.com/mohamed-07/login-by-supabase/tree/main/src/features/home/pages): `src/features/home/pages`
- [Hero item query](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/home/hooks/useHeroItems.ts): `src/features/home/hooks/useHeroItems.ts`
- [Genre service](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/home/services/genres.api.ts): `src/features/home/services/genres.api.ts`
- [Movie browsing](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/mouvise/page/MovisePage.tsx): `src/features/mouvise/page/MovisePage.tsx`
- [TV browsing](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/tvShows/page/TvShowsPage.tsx): `src/features/tvShows/page/TvShowsPage.tsx`
- [TMDB client](https://github.com/mohamed-07/login-by-supabase/blob/main/src/lib/tmdbClient.ts): `src/lib/tmdbClient.ts`

### Media Details

- [Media detail view](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/movisTvDetails/pages/MovisTvDetailsPage.tsx): `src/features/movisTvDetails/pages/MovisTvDetailsPage.tsx`
- [Details queries](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/movisTvDetails/hooks/useMediaDetails.ts): `src/features/movisTvDetails/hooks/useMediaDetails.ts`
- [Details service](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/movisTvDetails/services/mediaDetails.api.ts): `src/features/movisTvDetails/services/mediaDetails.api.ts`

### Personal List

- [My List page](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/pages/MyListPage.tsx): `src/features/myList/pages/MyListPage.tsx`
- [List queries](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/hooks/useMyList.ts): `src/features/myList/hooks/useMyList.ts`
- [List service](https://github.com/mohamed-07/login-by-supabase/blob/main/src/features/myList/services/my-list.api.ts): `src/features/myList/services/my-list.api.ts`

### Other components

- **Viewer**
- **TMDB API**

## Connections

- Viewer → App bootstrap: opens app
- App bootstrap → Auth state: initializes auth (evidence: `src/App.tsx`)
- App bootstrap → Route dispatch: renders routes (evidence: `src/App.tsx`)
- Route dispatch → Login and registration: routes to (evidence: `src/routes/router.tsx`)
- Route dispatch → Home and trending: routes to (evidence: `src/routes/router.tsx`)
- Route dispatch → Movie browsing: routes to (evidence: `src/routes/router.tsx`)
- Route dispatch → TV browsing: routes to (evidence: `src/routes/router.tsx`)
- Route dispatch → Media detail view: routes to (evidence: `src/routes/router.tsx`)
- Route dispatch → My List page: routes to (evidence: `src/routes/router.tsx`)
- Home and trending → Hero item query: uses (evidence: `src/features/home/pages/HomePage.tsx`)
- Hero item query → Genre service: fetches genres (evidence: `src/features/home/hooks/useHeroItems.ts`)
- Genre service → TMDB client: uses client (evidence: `src/features/home/services/genres.api.ts`)
- TMDB client → TMDB API: requests data
- Media detail view → Details queries: loads details (evidence: `src/features/movisTvDetails/pages/MovisTvDetailsPage.tsx`)
- Details queries → Details service: queries service (evidence: `src/features/movisTvDetails/hooks/useMediaDetails.ts`)
- Details service → TMDB client: uses client (evidence: `src/features/movisTvDetails/services/mediaDetails.api.ts`)
- My List page → List queries: uses (evidence: `src/features/myList/pages/MyListPage.tsx`)
- List queries → Auth state: reads user (evidence: `src/features/myList/hooks/useMyList.ts`)
- List queries → List service: calls service (evidence: `src/features/myList/hooks/useMyList.ts`)
- Auth state → Supabase Auth: auth operations (evidence: `src/features/auth/store/authStore.ts`)
- Navigation bar → Auth state: reads user (evidence: `src/features/layout/Navbar.tsx`)
- Navigation bar → Route dispatch: navigates routes
