# gituser-16/moctale-reborn architecture

> Architecture diagram of the GitHub repository gituser-16/moctale-reborn, 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/gituser-16/moctale-reborn
- Repository: https://github.com/gituser-16/moctale-reborn

## Overview

Moctale Reborn is a PHP movie-discovery and review site. Visitors browse or search the catalog, open a movie page, and—when signed in—save it or submit a review; movie pages show community verdict and vibe summaries. A separate importer fetches TMDB catalog and credit data into PostgreSQL for the site to serve. The README documents capabilities beyond the sampled implementation, so some feature links are documented rather than source-verified; the unsampled styling and informational pages are represented at their exact tree paths.

Main entry points: [`index.php`](https://github.com/gituser-16/moctale-reborn/blob/main/index.php) (Browse and search), [`login.php`](https://github.com/gituser-16/moctale-reborn/blob/main/login.php) (Login), [`content.php`](https://github.com/gituser-16/moctale-reborn/blob/main/content.php) (Movie details), [`includes/footer.php`](https://github.com/gituser-16/moctale-reborn/blob/main/includes/footer.php) (Shared footer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Movie discovery"]
  node_home["Browse and search<br/>[index.php]"]
  node_movie["Movie details<br/>[content.php]"]
  node_site_style["Site styling<br/>[style.css]"]
  node_footer["Shared footer<br/>[footer.php]"]
  node_about["About page<br/>[about.php]"]
  node_contact["Contact page<br/>[contact.php]"]
end

subgraph group_accounts["Accounts and lists"]
  node_signup["Sign up<br/>[signup.php]"]
  node_login["Login<br/>[login.php]"]
  node_logout["Logout<br/>[logout.php]"]
  node_auth_guard["Login guard<br/>[auth-check.php]"]
  node_watchlist["Personal watchlist<br/>[watchlist.php]"]
end

subgraph group_community["Reviews and community"]
  node_reviews["Verdicts and vibe chart<br/>[content.php]"]
end

subgraph group_catalog["Catalog data"]
  node_importer["TMDB catalog importer<br/>[fetch-tmdb.php]"]
  node_tmdb["TMDB API"]
  node_postgres[("PostgreSQL catalog")]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_home -->|"reads catalog"| node_postgres
node_home -->|"opens title"| node_movie
node_home -->|"opens list"| node_watchlist
node_movie -->|"reads and writes"| node_postgres
node_movie -->|"renders summaries"| node_reviews
node_visitor -->|"creates account"| node_signup
node_signup -->|"stores account"| node_postgres
node_signup -->|"redirects to"| node_login
node_visitor -->|"signs in"| node_login
node_login -->|"checks account"| node_postgres
node_login -->|"redirects to"| node_home
node_watchlist -->|"checks session"| node_auth_guard
node_auth_guard -->|"redirects unauthenticated"| node_login
node_watchlist -->|"reads saved titles"| node_postgres
node_visitor -->|"runs catalog import"| node_importer
node_importer -->|"fetches titles and credits"| node_tmdb
node_importer -->|"writes movie data"| node_postgres
node_home -->|"uses styles"| node_site_style
node_home -->|"includes footer"| node_footer
node_footer -->|"links to"| node_about
node_footer -->|"links to"| node_contact
node_movie -->|"prompts sign-in"| node_login

click node_home "https://github.com/gituser-16/moctale-reborn/blob/main/index.php"
click node_movie "https://github.com/gituser-16/moctale-reborn/blob/main/content.php"
click node_site_style "https://github.com/gituser-16/moctale-reborn/blob/main/assets/css/style.css"
click node_footer "https://github.com/gituser-16/moctale-reborn/blob/main/includes/footer.php"
click node_about "https://github.com/gituser-16/moctale-reborn/blob/main/about.php"
click node_contact "https://github.com/gituser-16/moctale-reborn/blob/main/contact.php"
click node_signup "https://github.com/gituser-16/moctale-reborn/blob/main/signup.php"
click node_login "https://github.com/gituser-16/moctale-reborn/blob/main/login.php"
click node_logout "https://github.com/gituser-16/moctale-reborn/blob/main/logout.php"
click node_auth_guard "https://github.com/gituser-16/moctale-reborn/blob/main/includes/auth-check.php"
click node_watchlist "https://github.com/gituser-16/moctale-reborn/blob/main/watchlist.php"
click node_reviews "https://github.com/gituser-16/moctale-reborn/blob/main/content.php"
click node_importer "https://github.com/gituser-16/moctale-reborn/blob/main/api/fetch-tmdb.php"

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_movie,node_site_style,node_footer,node_about,node_contact toneBlue
class node_signup,node_login,node_logout,node_auth_guard,node_watchlist toneAmber
class node_reviews toneMint
class node_importer,node_tmdb,node_postgres toneRose
class node_visitor toneIndigo
```

## Components

### Movie discovery

- [Browse and search](https://github.com/gituser-16/moctale-reborn/blob/main/index.php): `index.php`
- [Movie details](https://github.com/gituser-16/moctale-reborn/blob/main/content.php): `content.php`
- [Site styling](https://github.com/gituser-16/moctale-reborn/blob/main/assets/css/style.css): `assets/css/style.css`
- [Shared footer](https://github.com/gituser-16/moctale-reborn/blob/main/includes/footer.php): `includes/footer.php`
- [About page](https://github.com/gituser-16/moctale-reborn/blob/main/about.php): `about.php`
- [Contact page](https://github.com/gituser-16/moctale-reborn/blob/main/contact.php): `contact.php`

### Accounts and lists

- [Sign up](https://github.com/gituser-16/moctale-reborn/blob/main/signup.php): `signup.php`
- [Login](https://github.com/gituser-16/moctale-reborn/blob/main/login.php): `login.php`
- [Logout](https://github.com/gituser-16/moctale-reborn/blob/main/logout.php): `logout.php`
- [Login guard](https://github.com/gituser-16/moctale-reborn/blob/main/includes/auth-check.php): `includes/auth-check.php`
- [Personal watchlist](https://github.com/gituser-16/moctale-reborn/blob/main/watchlist.php): `watchlist.php`

### Reviews and community

- [Verdicts and vibe chart](https://github.com/gituser-16/moctale-reborn/blob/main/content.php): `content.php`

### Catalog data

- [TMDB catalog importer](https://github.com/gituser-16/moctale-reborn/blob/main/api/fetch-tmdb.php): `api/fetch-tmdb.php`
- **TMDB API**
- **PostgreSQL catalog**

### Other components

- **Visitor**

## Connections

- Visitor → Browse and search: browses (evidence: `README.md`)
- Browse and search → PostgreSQL catalog: reads catalog (evidence: `index.php`)
- Browse and search → Movie details: opens title (evidence: `index.php`)
- Browse and search → Personal watchlist: opens list (evidence: `index.php`)
- Movie details → PostgreSQL catalog: reads and writes (evidence: `content.php`)
- Movie details → Verdicts and vibe chart: renders summaries (evidence: `content.php`)
- Visitor → Sign up: creates account (evidence: `README.md`)
- Sign up → PostgreSQL catalog: stores account (evidence: `signup.php`)
- Sign up → Login: redirects to (evidence: `signup.php`)
- Visitor → Login: signs in (evidence: `README.md`)
- Login → PostgreSQL catalog: checks account (evidence: `login.php`)
- Login → Browse and search: redirects to (evidence: `login.php`)
- Personal watchlist → Login guard: checks session (evidence: `watchlist.php`)
- Login guard → Login: redirects unauthenticated (evidence: `includes/auth-check.php`)
- Personal watchlist → PostgreSQL catalog: reads saved titles (evidence: `watchlist.php`)
- Visitor → TMDB catalog importer: runs catalog import (evidence: `README.md`)
- TMDB catalog importer → TMDB API: fetches titles and credits (evidence: `api/fetch-tmdb.php`)
- TMDB catalog importer → PostgreSQL catalog: writes movie data (evidence: `api/fetch-tmdb.php`)
- Browse and search → Site styling: uses styles (evidence: `index.php`)
- Browse and search → Shared footer: includes footer (evidence: `index.php`)
- Shared footer → About page: links to (evidence: `includes/footer.php`)
- Shared footer → Contact page: links to (evidence: `includes/footer.php`)
- Movie details → Login: prompts sign-in (evidence: `README.md`)
