# shigaepouyen/filmi architecture

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

- Interactive diagram: https://gitdiagram.com/shigaepouyen/filmi
- Repository: https://github.com/shigaepouyen/filmi

## Overview

Filmi is a shared family film notebook whose central workflow is capturing a movie idea, enriching it with TMDb data, and keeping it available for a later Saturday draw. The ritual continues through shortlist selection, a recorded screening, ratings and history; series progress and family vetoes are distinct session behaviors. The README also documents voting, suggestions, awards, profile-based access, and movie-page management. Wiring is shown only where the excerpts, SOURCE INDEX references, or README support it; unsampled endpoint internals are not assumed.

Main entry points: [`src/App.php`](https://github.com/shigaepouyen/filmi/blob/main/src/App.php) (Application container), [`src/Repositories/MovieRepository.php`](https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/MovieRepository.php) (Movie catalog), [`src/Services/AiSuggestionService.php`](https://github.com/shigaepouyen/filmi/blob/main/src/Services/AiSuggestionService.php) (AI suggestions), [`public/add.php`](https://github.com/shigaepouyen/filmi/blob/main/public/add.php) (Add ideas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Family experience"]
  node_add["Add ideas<br/>[add.php]"]
  node_lists["Shared lists<br/>[pool.php]"]
  node_moviepage["Movie details<br/>[movie.php]"]
  node_voting["Votes<br/>[vote.php]"]
end

subgraph group_catalog["Ideas and catalog"]
  node_catalog[("Movie catalog")]
  node_tmdb["TMDb metadata<br/>[TmdbService.php]"]
  node_sequel["Saga ordering<br/>[SequelService.php]"]
  node_suggestions["AI suggestions"]
  node_gemini["Gemini<br/>[GeminiService.php]"]
  node_suggestionstore[("Suggestion store")]
end

subgraph group_ritual["Draw and screening"]
  node_drawpage["Draw screen<br/>[draw.php]"]
  node_drawapi["Draw endpoint<br/>[draw.php]"]
  node_drawservice["Draw rules<br/>[DrawService.php]"]
  node_schedule["Turn schedule"]
  node_seance["Screening session<br/>[seance.php]"]
  node_series["Series progress<br/>[SeriesService.php]"]
end

subgraph group_history["History and insight"]
  node_ratings[("Session ratings")]
  node_historypage["Viewing history<br/>[history.php]"]
  node_awards["Awards<br/>[AwardsService.php]"]
end

subgraph group_platform["Application foundation"]
  node_profiles[("Profiles")]
  node_settings[("Settings")]
  node_app["Application container<br/>[App.php]"]
  node_database[("SQLite database<br/>[Database.php]")]
end

node_family(("Family"))

node_family -->|"records ideas"| node_add
node_add -.->|"looks up titles"| node_tmdb
node_add -->|"adds films"| node_catalog
node_family -->|"browses lists"| node_lists
node_family -->|"casts votes"| node_voting
node_family -->|"manages films"| node_moviepage
node_moviepage -->|"updates catalog"| node_catalog
node_drawpage -.->|"requests draw"| node_drawapi
node_drawapi -->|"runs rules"| node_drawservice
node_drawapi -->|"checks turn"| node_schedule
node_drawservice -.->|"selects candidates"| node_catalog
node_catalog -->|"filters sequels"| node_sequel
node_family -->|"chooses shortlist"| node_drawpage
node_family -->|"records screening"| node_seance
node_seance -->|"records ratings"| node_ratings
node_seance -.->|"advances episodes"| node_series
node_family -->|"reviews history"| node_historypage
node_historypage -.->|"shows sessions"| node_ratings
node_family -->|"views awards"| node_awards
node_suggestions -->|"generates ideas"| node_gemini
node_suggestions -->|"matches titles"| node_tmdb
node_suggestions -.->|"stores suggestions"| node_suggestionstore
node_app -->|"constructs repository"| node_catalog
node_app -->|"constructs repository"| node_profiles
node_app -->|"constructs repository"| node_settings
node_app -->|"configures service"| node_tmdb
node_app -->|"constructs service"| node_suggestions
node_app -->|"opens connection"| node_database

click node_add "https://github.com/shigaepouyen/filmi/blob/main/public/add.php"
click node_lists "https://github.com/shigaepouyen/filmi/blob/main/public/pool.php"
click node_moviepage "https://github.com/shigaepouyen/filmi/blob/main/public/movie.php"
click node_voting "https://github.com/shigaepouyen/filmi/blob/main/public/api/vote.php"
click node_catalog "https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/MovieRepository.php"
click node_tmdb "https://github.com/shigaepouyen/filmi/blob/main/src/Services/TmdbService.php"
click node_sequel "https://github.com/shigaepouyen/filmi/blob/main/src/Services/SequelService.php"
click node_drawpage "https://github.com/shigaepouyen/filmi/blob/main/public/draw.php"
click node_drawapi "https://github.com/shigaepouyen/filmi/blob/main/public/api/draw.php"
click node_drawservice "https://github.com/shigaepouyen/filmi/blob/main/src/Services/DrawService.php"
click node_schedule "https://github.com/shigaepouyen/filmi/blob/main/src/Services/ScheduleService.php"
click node_seance "https://github.com/shigaepouyen/filmi/blob/main/public/seance.php"
click node_series "https://github.com/shigaepouyen/filmi/blob/main/src/Services/SeriesService.php"
click node_ratings "https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/SeanceRepository.php"
click node_historypage "https://github.com/shigaepouyen/filmi/blob/main/public/history.php"
click node_awards "https://github.com/shigaepouyen/filmi/blob/main/src/Services/AwardsService.php"
click node_suggestions "https://github.com/shigaepouyen/filmi/blob/main/src/Services/AiSuggestionService.php"
click node_gemini "https://github.com/shigaepouyen/filmi/blob/main/src/Services/GeminiService.php"
click node_suggestionstore "https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/SuggestionRepository.php"
click node_profiles "https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/ProfileRepository.php"
click node_settings "https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/SettingRepository.php"
click node_app "https://github.com/shigaepouyen/filmi/blob/main/src/App.php"
click node_database "https://github.com/shigaepouyen/filmi/blob/main/src/Utils/Database.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_add,node_lists,node_moviepage,node_voting toneBlue
class node_catalog,node_tmdb,node_sequel,node_suggestions,node_gemini,node_suggestionstore toneAmber
class node_drawpage,node_drawapi,node_drawservice,node_schedule,node_seance,node_series toneMint
class node_ratings,node_historypage,node_awards toneRose
class node_profiles,node_settings,node_app,node_database,node_family toneIndigo
```

## Components

### Family experience

- [Add ideas](https://github.com/shigaepouyen/filmi/blob/main/public/add.php): `public/add.php`
- [Shared lists](https://github.com/shigaepouyen/filmi/blob/main/public/pool.php): `public/pool.php`
- [Movie details](https://github.com/shigaepouyen/filmi/blob/main/public/movie.php): `public/movie.php`
- [Votes](https://github.com/shigaepouyen/filmi/blob/main/public/api/vote.php): `public/api/vote.php`

### Ideas and catalog

- [Movie catalog](https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/MovieRepository.php): `src/Repositories/MovieRepository.php`
- [TMDb metadata](https://github.com/shigaepouyen/filmi/blob/main/src/Services/TmdbService.php): `src/Services/TmdbService.php`
- [Saga ordering](https://github.com/shigaepouyen/filmi/blob/main/src/Services/SequelService.php): `src/Services/SequelService.php`
- [AI suggestions](https://github.com/shigaepouyen/filmi/blob/main/src/Services/AiSuggestionService.php): `src/Services/AiSuggestionService.php`
- [Gemini](https://github.com/shigaepouyen/filmi/blob/main/src/Services/GeminiService.php): `src/Services/GeminiService.php`
- [Suggestion store](https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/SuggestionRepository.php): `src/Repositories/SuggestionRepository.php`

### Draw and screening

- [Draw screen](https://github.com/shigaepouyen/filmi/blob/main/public/draw.php): `public/draw.php`
- [Draw endpoint](https://github.com/shigaepouyen/filmi/blob/main/public/api/draw.php): `public/api/draw.php`
- [Draw rules](https://github.com/shigaepouyen/filmi/blob/main/src/Services/DrawService.php): `src/Services/DrawService.php`
- [Turn schedule](https://github.com/shigaepouyen/filmi/blob/main/src/Services/ScheduleService.php): `src/Services/ScheduleService.php`
- [Screening session](https://github.com/shigaepouyen/filmi/blob/main/public/seance.php): `public/seance.php`
- [Series progress](https://github.com/shigaepouyen/filmi/blob/main/src/Services/SeriesService.php): `src/Services/SeriesService.php`

### History and insight

- [Session ratings](https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/SeanceRepository.php): `src/Repositories/SeanceRepository.php`
- [Viewing history](https://github.com/shigaepouyen/filmi/blob/main/public/history.php): `public/history.php`
- [Awards](https://github.com/shigaepouyen/filmi/blob/main/src/Services/AwardsService.php): `src/Services/AwardsService.php`

### Application foundation

- [Profiles](https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/ProfileRepository.php): `src/Repositories/ProfileRepository.php`
- [Settings](https://github.com/shigaepouyen/filmi/blob/main/src/Repositories/SettingRepository.php): `src/Repositories/SettingRepository.php`
- [Application container](https://github.com/shigaepouyen/filmi/blob/main/src/App.php): `src/App.php`
- [SQLite database](https://github.com/shigaepouyen/filmi/blob/main/src/Utils/Database.php): `src/Utils/Database.php`

### Other components

- **Family**

## Connections

- Family → Add ideas: records ideas
- Add ideas → TMDb metadata: looks up titles
- Add ideas → Movie catalog: adds films
- Family → Shared lists: browses lists
- Family → Votes: casts votes
- Family → Movie details: manages films
- Movie details → Movie catalog: updates catalog
- Draw screen → Draw endpoint: requests draw
- Draw endpoint → Draw rules: runs rules (evidence: `public/api/draw.php`)
- Draw endpoint → Turn schedule: checks turn (evidence: `public/api/draw.php`)
- Draw rules → Movie catalog: selects candidates
- Movie catalog → Saga ordering: filters sequels (evidence: `src/Repositories/MovieRepository.php`)
- Family → Draw screen: chooses shortlist
- Family → Screening session: records screening
- Screening session → Session ratings: records ratings
- Screening session → Series progress: advances episodes
- Family → Viewing history: reviews history
- Viewing history → Session ratings: shows sessions
- Family → Awards: views awards
- AI suggestions → Gemini: generates ideas (evidence: `src/Services/AiSuggestionService.php`)
- AI suggestions → TMDb metadata: matches titles (evidence: `src/Services/AiSuggestionService.php`)
- AI suggestions → Suggestion store: stores suggestions (evidence: `src/Services/AiSuggestionService.php`)
- Application container → Movie catalog: constructs repository (evidence: `src/App.php`)
- Application container → Profiles: constructs repository (evidence: `src/App.php`)
- Application container → Settings: constructs repository (evidence: `src/App.php`)
- Application container → TMDb metadata: configures service (evidence: `src/App.php`)
- Application container → AI suggestions: constructs service (evidence: `src/App.php`)
- Application container → SQLite database: opens connection (evidence: `src/App.php`)
