# aarnavp25-sys/brand-deal-macher architecture

> Architecture diagram of the GitHub repository aarnavp25-sys/brand-deal-macher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aarnavp25-sys/brand-deal-macher
- Repository: https://github.com/aarnavp25-sys/brand-deal-macher

## Overview

Brand Deal Matcher collects and enriches Instagram creator data, then stores it for admin management and brand-facing creator matching. Its distinct stages include capped Apify collection, eligibility filtering and metric enrichment, keyword taxonomy classification, optional LLM labeling, and product-fit matching. The sampled code shows pipeline writes and admin proxy calls to Supabase; the demo and Edge Function implementation were not sampled, so their connection is shown as unverified.

Main entry points: [`pipeline/schema.sql`](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/schema.sql) (Supabase data), [`pipeline/llm_classify.py`](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/llm_classify.py) (LLM labeling), [`pipeline/process.py`](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py) (Metrics enrichment), [`supabase/functions/api/index.ts`](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/supabase/functions/api/index.ts) (Match API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Creator collection"]
  node_runner["Apify runner<br/>[apify_run.py]"]
end

subgraph group_pipeline["Processing and labeling"]
  node_filter["Profile filtering<br/>[process.py]"]
  node_enrichment["Metrics enrichment<br/>[process.py]"]
  node_keyword["Keyword labels<br/>[process.py]"]
  node_taxonomy["Shared taxonomy<br/>[taxonomy.py]"]
  node_llm["LLM labeling<br/>[llm_classify.py]"]
end

subgraph group_matching["Matching experience"]
  node_demo["Brand demo<br/>[server.py]"]
  node_matcher["Match API<br/>[index.ts]"]
  node_demo_ui["Demo website<br/>[index.html]"]
end

subgraph group_operations["Data and administration"]
  node_admin["Admin dashboard<br/>[server.py]"]
  node_admin_ui["Admin interface<br/>[index.html]"]
  node_db[("Supabase data<br/>[schema.sql]")]
  node_taxonomy_export["Taxonomy export<br/>[export_taxonomy.py]"]
end

node_brand(("Brand user"))
node_adminuser(("Admin user"))
node_apify["Apify"]
node_bedrock["Amazon Bedrock"]

node_runner -->|"runs actor"| node_apify
node_apify -->|"returns dataset"| node_runner
node_apify -.->|"supplies profiles"| node_filter
node_filter -->|"keeps profiles"| node_enrichment
node_enrichment -->|"classifies creators"| node_keyword
node_keyword -->|"uses labels"| node_taxonomy
node_llm -->|"uses labels"| node_taxonomy
node_llm -->|"classifies with"| node_bedrock
node_llm -->|"writes labels"| node_db
node_enrichment -->|"loads records"| node_db
node_brand -.->|"describes product"| node_demo_ui
node_demo_ui -.->|"uses website"| node_demo
node_demo -.->|"requests matches"| node_matcher
node_matcher -.->|"reads creators"| node_db
node_adminuser -.->|"manages data"| node_admin_ui
node_admin_ui -.->|"uses dashboard"| node_admin
node_admin -->|"proxies requests"| node_db
node_taxonomy_export -->|"exports lists"| node_taxonomy
node_taxonomy_export -.->|"generates taxonomy"| node_matcher

click node_runner "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/apify_run.py"
click node_filter "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py"
click node_enrichment "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py"
click node_keyword "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py"
click node_taxonomy "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/taxonomy.py"
click node_llm "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/llm_classify.py"
click node_demo "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/demo/server.py"
click node_matcher "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/supabase/functions/api/index.ts"
click node_demo_ui "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/demo/index.html"
click node_admin "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/admin/server.py"
click node_admin_ui "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/admin/index.html"
click node_db "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/schema.sql"
click node_taxonomy_export "https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/export_taxonomy.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_runner,node_brand,node_adminuser toneBlue
class node_filter,node_enrichment,node_keyword,node_taxonomy,node_llm toneAmber
class node_demo,node_matcher,node_demo_ui,node_apify toneMint
class node_admin,node_admin_ui,node_db,node_taxonomy_export toneRose
class node_bedrock toneIndigo
```

## Components

### Creator collection

- [Apify runner](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/apify_run.py): `pipeline/apify_run.py`

### Processing and labeling

- [Profile filtering](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py): `pipeline/process.py`
- [Metrics enrichment](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py): `pipeline/process.py`
- [Keyword labels](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/process.py): `pipeline/process.py`
- [Shared taxonomy](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/taxonomy.py): `pipeline/taxonomy.py`
- [LLM labeling](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/llm_classify.py): `pipeline/llm_classify.py`

### Matching experience

- [Brand demo](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/demo/server.py): `demo/server.py`
- [Match API](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/supabase/functions/api/index.ts): `supabase/functions/api/index.ts`
- [Demo website](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/demo/index.html): `demo/index.html`

### Data and administration

- [Admin dashboard](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/admin/server.py): `admin/server.py`
- [Admin interface](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/admin/index.html): `admin/index.html`
- [Supabase data](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/schema.sql): `pipeline/schema.sql`
- [Taxonomy export](https://github.com/aarnavp25-sys/brand-deal-macher/blob/main/pipeline/export_taxonomy.py): `pipeline/export_taxonomy.py`

### Other components

- **Brand user**
- **Admin user**
- **Apify**
- **Amazon Bedrock**

## Connections

- Apify runner → Apify: runs actor (evidence: `pipeline/apify_run.py`)
- Apify → Apify runner: returns dataset (evidence: `pipeline/apify_run.py`)
- Apify → Profile filtering: supplies profiles (evidence: `README.md`)
- Profile filtering → Metrics enrichment: keeps profiles (evidence: `pipeline/process.py`)
- Metrics enrichment → Keyword labels: classifies creators (evidence: `pipeline/process.py`)
- Keyword labels → Shared taxonomy: uses labels (evidence: `pipeline/process.py`)
- LLM labeling → Shared taxonomy: uses labels (evidence: `pipeline/llm_classify.py`)
- LLM labeling → Amazon Bedrock: classifies with (evidence: `pipeline/llm_classify.py`)
- LLM labeling → Supabase data: writes labels (evidence: `pipeline/llm_classify.py`)
- Metrics enrichment → Supabase data: loads records (evidence: `pipeline/process.py`)
- Brand user → Demo website: describes product (evidence: `README.md`)
- Demo website → Brand demo: uses website (evidence: `README.md`)
- Brand demo → Match API: requests matches
- Match API → Supabase data: reads creators
- Admin user → Admin interface: manages data (evidence: `README.md`)
- Admin interface → Admin dashboard: uses dashboard (evidence: `README.md`)
- Admin dashboard → Supabase data: proxies requests (evidence: `admin/server.py`)
- Taxonomy export → Shared taxonomy: exports lists (evidence: `pipeline/export_taxonomy.py`)
- Taxonomy export → Match API: generates taxonomy (evidence: `pipeline/export_taxonomy.py`)
