# arthurcn96/filmes-do-mes architecture

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

- Interactive diagram: https://gitdiagram.com/arthurcn96/filmes-do-mes
- Repository: https://github.com/arthurcn96/filmes-do-mes

## Overview

Filmes do Mês is a static movie-listing site backed by a JSON cache. Visitors view the monthly top-film lists; a Python populating script validates its TMDb key, fetches and ranks movie data, and updates the cache. A scheduled GitHub Actions workflow runs that update. The README describes the site and automation; the page source was not sampled, so its cache-reading details are based on that documentation.

Main entry points: [`populate.py`](https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py) (Cache populator), [`.github/workflows/update-cache.yml`](https://github.com/arthurcn96/filmes-do-mes/blob/main/.github/workflows/update-cache.yml) (Update workflow), [`index.html`](https://github.com/arthurcn96/filmes-do-mes/blob/main/index.html) (Movie listings), [`cache.json`](https://github.com/arthurcn96/filmes-do-mes/blob/main/cache.json) (Movie cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Static site"]
  node_page["Movie listings<br/>[index.html]"]
  node_cache[("Movie cache<br/>[cache.json]")]
end

subgraph group_refresh["Cache refresh"]
  node_populator["Cache populator<br/>[populate.py]"]
  node_keycheck["API key validation<br/>[populate.py]"]
  node_cachepolicy["Refresh selection<br/>[populate.py]"]
  node_moviefetch["Movie discovery<br/>[populate.py]"]
  node_moviefilter["Filter and rank<br/>[populate.py]"]
end

subgraph group_automation["Scheduled updates"]
  node_workflow["Update workflow<br/>[update-cache.yml]"]
end

node_visitor(("Visitor"))
node_tmdb["TMDb API"]
node_github["GitHub repository"]

node_visitor -->|"views"| node_page
node_page -->|"reads listings"| node_cache
node_workflow -->|"runs"| node_populator
node_populator -->|"validates key"| node_keycheck
node_keycheck -->|"checks credentials"| node_tmdb
node_populator -->|"loads and saves"| node_cache
node_populator -->|"selects updates"| node_cachepolicy
node_populator -->|"submits searches"| node_moviefetch
node_moviefetch -->|"requests films"| node_tmdb
node_moviefetch -->|"returns results"| node_moviefilter
node_populator -->|"ranks results"| node_moviefilter
node_workflow -->|"commits updates"| node_github

click node_page "https://github.com/arthurcn96/filmes-do-mes/blob/main/index.html"
click node_cache "https://github.com/arthurcn96/filmes-do-mes/blob/main/cache.json"
click node_workflow "https://github.com/arthurcn96/filmes-do-mes/blob/main/.github/workflows/update-cache.yml"
click node_populator "https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py"
click node_keycheck "https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py"
click node_cachepolicy "https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py"
click node_moviefetch "https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py"
click node_moviefilter "https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py"

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_page,node_cache toneBlue
class node_populator,node_keycheck,node_cachepolicy,node_moviefetch,node_moviefilter toneAmber
class node_workflow,node_tmdb toneMint
class node_visitor,node_github toneIndigo
```

## Components

### Static site

- [Movie listings](https://github.com/arthurcn96/filmes-do-mes/blob/main/index.html): `index.html`
- [Movie cache](https://github.com/arthurcn96/filmes-do-mes/blob/main/cache.json): `cache.json`

### Cache refresh

- [Cache populator](https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py): `populate.py`
- [API key validation](https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py): `populate.py`
- [Refresh selection](https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py): `populate.py`
- [Movie discovery](https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py): `populate.py`
- [Filter and rank](https://github.com/arthurcn96/filmes-do-mes/blob/main/populate.py): `populate.py`

### Scheduled updates

- [Update workflow](https://github.com/arthurcn96/filmes-do-mes/blob/main/.github/workflows/update-cache.yml): `.github/workflows/update-cache.yml`

### Other components

- **Visitor**
- **TMDb API**
- **GitHub repository**

## Connections

- Visitor → Movie listings: views
- Movie listings → Movie cache: reads listings
- Update workflow → Cache populator: runs
- Cache populator → API key validation: validates key
- API key validation → TMDb API: checks credentials
- Cache populator → Movie cache: loads and saves
- Cache populator → Refresh selection: selects updates
- Cache populator → Movie discovery: submits searches
- Movie discovery → TMDb API: requests films
- Movie discovery → Filter and rank: returns results
- Cache populator → Filter and rank: ranks results
- Update workflow → GitHub repository: commits updates
