# dilharajay/pulse architecture

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

- Interactive diagram: https://gitdiagram.com/dilharajay/pulse
- Repository: https://github.com/dilharajay/pulse

## Overview

PULSE collects Letterboxd film and review data, analyzes review sentences through cleaning, language filtering, sentiment and emotion classification, and aggregates results into film-level metrics for interactive exploration. The Dagster assets define the orchestrated analysis; notebooks provide a documented sequential research alternative. Both FastAPI and Streamlit dashboards expose the processed summary. The analysis links follow the README’s documented flow where implementation details were not sampled; scraper/database and browser/API links are supported by excerpts.

Main entry points: [`src/letterboxed_absa/assets.py`](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py) (Processed film summary), [`data/raw/letterboxd.db`](https://github.com/dilharajay/pulse/blob/main/data/raw/letterboxd.db) (Film and review database), [`server.py`](https://github.com/dilharajay/pulse/blob/main/server.py) (FastAPI dashboard API), [`src/scraper/scraper.py`](https://github.com/dilharajay/pulse/blob/main/src/scraper/scraper.py) (Film and review scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Data collection"]
  node_scraper["Film and review scraper<br/>[scraper.py]"]
  node_sqlite[("Film and review database<br/>[letterboxd.db]")]
  node_dbops["Database schema and upserts<br/>[db.py]"]
end

subgraph group_analysis["Review analysis"]
  node_cleaning["Text cleaning and sentences<br/>[assets.py]"]
  node_language["Language classification<br/>[assets.py]"]
  node_language_filter["Supported-language filter<br/>[assets.py]"]
  node_sentiment["Sentence sentiment<br/>[assets.py]"]
  node_emotion["Sentence emotion<br/>[assets.py]"]
  node_aggregation["Film metrics and emotions<br/>[assets.py]"]
  node_summary[("Processed film summary<br/>[assets.py]")]
end

subgraph group_serving["Dashboards"]
  node_fastapi["FastAPI dashboard API<br/>[server.py]"]
  node_web_ui["Interactive web dashboard<br/>[app.js]"]
  node_streamlit["Streamlit dashboard<br/>[app.py]"]
  node_metadata["Poster and synopsis providers"]
end

subgraph group_orchestration["Pipeline runtime"]
  node_dagster_assets["Dagster analysis assets<br/>[assets.py]"]
  node_dagster_defs["Dagster definitions<br/>[definitions.py]"]
  node_research["Sequential research notebooks"]
end

node_analyst(("Movie explorer"))
node_letterboxd(("Letterboxd"))

node_analyst -->|"explores films"| node_web_ui
node_analyst -->|"filters and views"| node_streamlit
node_scraper -->|"fetches pages"| node_letterboxd
node_scraper -->|"saves film data"| node_dbops
node_dbops -->|"writes records"| node_sqlite
node_sqlite -->|"supplies reviews"| node_cleaning
node_cleaning -->|"classifies sentences"| node_language
node_language -->|"filters languages"| node_language_filter
node_language_filter -->|"scores sentences"| node_sentiment
node_sentiment -->|"profiles emotions"| node_emotion
node_emotion -->|"aggregates by film"| node_aggregation
node_aggregation -->|"writes summary"| node_summary
node_dagster_defs -->|"loads assets"| node_dagster_assets
node_dagster_assets -->|"reads reviews"| node_sqlite
node_dagster_assets -->|"materializes summary"| node_summary
node_research -->|"analyzes data"| node_sqlite
node_research -->|"exports results"| node_summary
node_fastapi -->|"loads summary"| node_summary
node_streamlit -->|"reads summary"| node_summary
node_web_ui -->|"requests movie data"| node_fastapi
node_fastapi -->|"fetches film info"| node_metadata

click node_scraper "https://github.com/dilharajay/pulse/blob/main/src/scraper/scraper.py"
click node_sqlite "https://github.com/dilharajay/pulse/blob/main/data/raw/letterboxd.db"
click node_dbops "https://github.com/dilharajay/pulse/blob/main/src/database/db.py"
click node_cleaning "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_language "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_language_filter "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_sentiment "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_emotion "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_aggregation "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_summary "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_dagster_assets "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py"
click node_dagster_defs "https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/definitions.py"
click node_research "https://github.com/dilharajay/pulse/tree/main/notebooks"
click node_fastapi "https://github.com/dilharajay/pulse/blob/main/server.py"
click node_web_ui "https://github.com/dilharajay/pulse/blob/main/static/app.js"
click node_streamlit "https://github.com/dilharajay/pulse/blob/main/app.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_scraper,node_sqlite,node_dbops toneBlue
class node_cleaning,node_language,node_language_filter,node_sentiment,node_emotion,node_aggregation,node_summary toneAmber
class node_fastapi,node_web_ui,node_streamlit,node_metadata toneMint
class node_dagster_assets,node_dagster_defs,node_research toneRose
class node_analyst,node_letterboxd toneIndigo
```

## Components

### Data collection

- [Film and review scraper](https://github.com/dilharajay/pulse/blob/main/src/scraper/scraper.py): `src/scraper/scraper.py`
- [Film and review database](https://github.com/dilharajay/pulse/blob/main/data/raw/letterboxd.db): `data/raw/letterboxd.db`
- [Database schema and upserts](https://github.com/dilharajay/pulse/blob/main/src/database/db.py): `src/database/db.py`

### Review analysis

- [Text cleaning and sentences](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Language classification](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Supported-language filter](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Sentence sentiment](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Sentence emotion](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Film metrics and emotions](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Processed film summary](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`

### Dashboards

- [FastAPI dashboard API](https://github.com/dilharajay/pulse/blob/main/server.py): `server.py`
- [Interactive web dashboard](https://github.com/dilharajay/pulse/blob/main/static/app.js): `static/app.js`
- [Streamlit dashboard](https://github.com/dilharajay/pulse/blob/main/app.py): `app.py`
- **Poster and synopsis providers**

### Pipeline runtime

- [Dagster analysis assets](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/assets.py): `src/letterboxed_absa/assets.py`
- [Dagster definitions](https://github.com/dilharajay/pulse/blob/main/src/letterboxed_absa/definitions.py): `src/letterboxed_absa/definitions.py`
- [Sequential research notebooks](https://github.com/dilharajay/pulse/tree/main/notebooks): `notebooks`

### Other components

- **Movie explorer**
- **Letterboxd**

## Connections

- Movie explorer → Interactive web dashboard: explores films (evidence: `README.md`)
- Movie explorer → Streamlit dashboard: filters and views (evidence: `README.md`)
- Film and review scraper → Letterboxd: fetches pages (evidence: `README.md`)
- Film and review scraper → Database schema and upserts: saves film data (evidence: `src/scraper/scraper.py`)
- Database schema and upserts → Film and review database: writes records (evidence: `src/database/db.py`)
- Film and review database → Text cleaning and sentences: supplies reviews (evidence: `README.md`)
- Text cleaning and sentences → Language classification: classifies sentences (evidence: `README.md`)
- Language classification → Supported-language filter: filters languages (evidence: `README.md`)
- Supported-language filter → Sentence sentiment: scores sentences (evidence: `README.md`)
- Sentence sentiment → Sentence emotion: profiles emotions (evidence: `README.md`)
- Sentence emotion → Film metrics and emotions: aggregates by film (evidence: `README.md`)
- Film metrics and emotions → Processed film summary: writes summary (evidence: `README.md`)
- Dagster definitions → Dagster analysis assets: loads assets (evidence: `src/letterboxed_absa/definitions.py`)
- Dagster analysis assets → Film and review database: reads reviews (evidence: `README.md`)
- Dagster analysis assets → Processed film summary: materializes summary (evidence: `README.md`)
- Sequential research notebooks → Film and review database: analyzes data (evidence: `README.md`)
- Sequential research notebooks → Processed film summary: exports results (evidence: `README.md`)
- FastAPI dashboard API → Processed film summary: loads summary (evidence: `README.md`)
- Streamlit dashboard → Processed film summary: reads summary (evidence: `app.py`)
- Interactive web dashboard → FastAPI dashboard API: requests movie data (evidence: `static/app.js`)
- FastAPI dashboard API → Poster and synopsis providers: fetches film info (evidence: `server.py`)
