# skrishnan2001/primeflix architecture

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

- Interactive diagram: https://gitdiagram.com/skrishnan2001/primeflix
- Repository: https://github.com/skrishnan2001/primeflix

## Overview

PrimeFlix is an Expo app for discovering movies, TV shows, and people using TMDb, with account sign-in and sign-up. The user enters through app initialization, then authentication state selects the authentication or user navigation stack; discovery and detail screens support browsing and searching entertainment content. The API layer builds locale-aware TMDb URLs, while Firebase handles account authentication. The README also describes recommendations, but sampled evidence does not show their implementation or routing. Unsampled screen-to-API links are omitted rather than inferred.

Main entry points: [`src/navigation/index.tsx`](https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/index.tsx) (Auth routing), [`src/navigation/authStack.tsx`](https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/authStack.tsx) (Sign-in routes), [`src/api/people.ts`](https://github.com/skrishnan2001/primeflix/blob/master/src/api/people.ts) (People API), [`src/api/api.ts`](https://github.com/skrishnan2001/primeflix/blob/master/src/api/api.ts) (TMDb URL builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app_entry["App setup<br/>[index.tsx]"]
  node_navigation["Auth routing<br/>[index.tsx]"]
  node_auth_stack["Sign-in routes<br/>[authStack.tsx]"]
  node_user_stack["User routes<br/>[userStack.tsx]"]
  node_signin["Sign in<br/>[SignIn.jsx]"]
  node_signup["Sign up<br/>[SignUp.jsx]"]
  node_auth_state["Auth state<br/>[useAuth.ts]"]
end

subgraph group_discovery["Discovery and browsing"]
  node_discover["Discover<br/>[index.tsx]"]
  node_search["Search<br/>[index.tsx]"]
  node_trends["Trends<br/>[index.tsx]"]
  node_genres["Genre browsing<br/>[index.tsx]"]
  node_genre["Genre results<br/>[index.tsx]"]
  node_collections["Collections<br/>[index.tsx]"]
end

subgraph group_catalog["Catalog details"]
  node_movie["Movie details<br/>[index.tsx]"]
  node_tvshow["TV details<br/>[index.tsx]"]
  node_people["People details<br/>[index.tsx]"]
  node_images["Images<br/>[index.tsx]"]
  node_video["Video<br/>[index.tsx]"]
end

subgraph group_services["External services"]
  node_search_api["Search API<br/>[search.ts]"]
  node_people_api["People API<br/>[people.ts]"]
  node_api_urls["TMDb URL builder<br/>[api.ts]"]
end

node_user(("Viewer"))
node_tmdb[("TMDb")]
node_firebase["Firebase Auth"]

node_user -->|"opens"| node_app_entry
node_app_entry -->|"renders"| node_navigation
node_navigation -->|"reads state"| node_auth_state
node_navigation -->|"routes signed-out"| node_auth_stack
node_navigation -->|"routes signed-in"| node_user_stack
node_navigation -->|"shows loading"| node_user_stack
node_auth_stack -->|"registers screen"| node_signin
node_auth_stack -->|"registers screen"| node_signup
node_signin -->|"signs in"| node_firebase
node_signup -->|"creates account"| node_firebase
node_auth_state -->|"observes session"| node_firebase
node_search -.->|"requests results"| node_search_api
node_search_api -->|"builds request URL"| node_api_urls
node_api_urls -.->|"queries"| node_tmdb
node_people -->|"loads profile data"| node_people_api
node_people_api -->|"uses API base"| node_api_urls
node_people_api -.->|"fetches catalog data"| node_tmdb

click node_app_entry "https://github.com/skrishnan2001/primeflix/blob/master/src/index.tsx"
click node_navigation "https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/index.tsx"
click node_auth_stack "https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/authStack.tsx"
click node_user_stack "https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/userStack.tsx"
click node_signin "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Authentication/SignIn.jsx"
click node_signup "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Authentication/SignUp.jsx"
click node_auth_state "https://github.com/skrishnan2001/primeflix/blob/master/src/hooks/useAuth.ts"
click node_discover "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Discover/index.tsx"
click node_search "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Search/index.tsx"
click node_trends "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Trend/index.tsx"
click node_genres "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Genres/index.tsx"
click node_genre "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Genre/index.tsx"
click node_collections "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Collection/index.tsx"
click node_movie "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Movie/index.tsx"
click node_tvshow "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/TvShow/index.tsx"
click node_people "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/People/index.tsx"
click node_images "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Images/index.tsx"
click node_video "https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Video/index.tsx"
click node_search_api "https://github.com/skrishnan2001/primeflix/blob/master/src/api/search.ts"
click node_people_api "https://github.com/skrishnan2001/primeflix/blob/master/src/api/people.ts"
click node_api_urls "https://github.com/skrishnan2001/primeflix/blob/master/src/api/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_entry,node_navigation,node_auth_stack,node_user_stack,node_signin,node_signup,node_auth_state,node_user toneBlue
class node_discover,node_search,node_trends,node_genres,node_genre,node_collections,node_tmdb toneAmber
class node_movie,node_tvshow,node_people,node_images,node_video toneMint
class node_search_api,node_people_api,node_api_urls toneRose
class node_firebase toneIndigo
```

## Components

### App and navigation

- [App setup](https://github.com/skrishnan2001/primeflix/blob/master/src/index.tsx): `src/index.tsx`
- [Auth routing](https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/index.tsx): `src/navigation/index.tsx`
- [Sign-in routes](https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/authStack.tsx): `src/navigation/authStack.tsx`
- [User routes](https://github.com/skrishnan2001/primeflix/blob/master/src/navigation/userStack.tsx): `src/navigation/userStack.tsx`
- [Sign in](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Authentication/SignIn.jsx): `src/screens/Authentication/SignIn.jsx`
- [Sign up](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Authentication/SignUp.jsx): `src/screens/Authentication/SignUp.jsx`
- [Auth state](https://github.com/skrishnan2001/primeflix/blob/master/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`

### Discovery and browsing

- [Discover](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Discover/index.tsx): `src/screens/Discover/index.tsx`
- [Search](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Search/index.tsx): `src/screens/Search/index.tsx`
- [Trends](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Trend/index.tsx): `src/screens/Trend/index.tsx`
- [Genre browsing](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Genres/index.tsx): `src/screens/Genres/index.tsx`
- [Genre results](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Genre/index.tsx): `src/screens/Genre/index.tsx`
- [Collections](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Collection/index.tsx): `src/screens/Collection/index.tsx`

### Catalog details

- [Movie details](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Movie/index.tsx): `src/screens/Movie/index.tsx`
- [TV details](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/TvShow/index.tsx): `src/screens/TvShow/index.tsx`
- [People details](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/People/index.tsx): `src/screens/People/index.tsx`
- [Images](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Images/index.tsx): `src/screens/Images/index.tsx`
- [Video](https://github.com/skrishnan2001/primeflix/blob/master/src/screens/Video/index.tsx): `src/screens/Video/index.tsx`

### External services

- [Search API](https://github.com/skrishnan2001/primeflix/blob/master/src/api/search.ts): `src/api/search.ts`
- [People API](https://github.com/skrishnan2001/primeflix/blob/master/src/api/people.ts): `src/api/people.ts`
- [TMDb URL builder](https://github.com/skrishnan2001/primeflix/blob/master/src/api/api.ts): `src/api/api.ts`

### Other components

- **Viewer**
- **TMDb**
- **Firebase Auth**

## Connections

- Viewer → App setup: opens (evidence: `README.md`)
- App setup → Auth routing: renders (evidence: `src/index.tsx`)
- Auth routing → Auth state: reads state (evidence: `src/navigation/index.tsx`)
- Auth routing → Sign-in routes: routes signed-out (evidence: `src/navigation/index.tsx`)
- Auth routing → User routes: routes signed-in (evidence: `src/navigation/index.tsx`)
- Auth routing → User routes: shows loading (evidence: `src/navigation/index.tsx`)
- Sign-in routes → Sign in: registers screen (evidence: `src/navigation/authStack.tsx`)
- Sign-in routes → Sign up: registers screen (evidence: `src/navigation/authStack.tsx`)
- Sign in → Firebase Auth: signs in (evidence: `src/screens/Authentication/SignIn.jsx`)
- Sign up → Firebase Auth: creates account (evidence: `src/screens/Authentication/SignUp.jsx`)
- Auth state → Firebase Auth: observes session (evidence: `src/hooks/useAuth.ts`)
- Search → Search API: requests results
- Search API → TMDb URL builder: builds request URL (evidence: `src/api/search.ts`)
- TMDb URL builder → TMDb: queries
- People details → People API: loads profile data (evidence: `src/screens/People/index.tsx`)
- People API → TMDb URL builder: uses API base (evidence: `src/api/people.ts`)
- People API → TMDb: fetches catalog data
