# 4lwayz/portwatch-vi architecture

> Architecture diagram of the GitHub repository 4lwayz/portwatch-vi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/4lwayz/portwatch-vi
- Repository: https://github.com/4lwayz/portwatch-vi

## Overview

PortWatch VI is a static tracker site backed by a scheduled scout that refreshes community-project data and optionally reviews projects and writes news. Visitors follow a leaderboard, countdown, watchlist, toolkit, candidate inbox and safety warnings; maintainers can edit pinned messaging and use a private dashboard. The scout’s documented discovery, filtering, scoring and reporting stages are shown alongside the site and admin surfaces. Some frontend and pipeline internals were not sampled, so their links rely on README statements or are omitted where unsupported.

Main entry points: [`assets/js/app.js`](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/app.js) (Tracker interface), [`scripts/scout.mjs`](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/scout.mjs) (Scout runner), [`scripts/lib/pipeline.mjs`](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/pipeline.mjs) (Discovery and curation), [`scripts/lib/core.mjs`](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/core.mjs) (Source adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Public tracker site"]
  node_homepage["Tracker interface<br/>[app.js]"]
  node_scoring["Effort scoring<br/>[scoring.js]"]
  node_translations["Translations<br/>[i18n.js]"]
  node_theme["Theme controls<br/>[theme.js]"]
  node_pinned["Pinned message<br/>[pinned.js]"]
  node_site_builder["News and SEO pages<br/>[site-build.mjs]"]
end

subgraph group_scout["Scout and editorial"]
  node_scout_entry["Scout runner<br/>[scout.mjs]"]
  node_pipeline["Discovery and curation<br/>[pipeline.mjs]"]
  node_adapters["Source adapters<br/>[core.mjs]"]
  node_assessment["Candidate assessment<br/>[assess.mjs]"]
  node_newsdesk["News desk<br/>[news.mjs]"]
end

subgraph group_admin["Maintainer tools"]
  node_private_dashboard["Private dashboard<br/>[dashboard.js]"]
  node_pin_editor["Pinned editor<br/>[pinned-editor.js]"]
end

subgraph group_services["Data and integrations"]
  node_site_data["Tracker dataset<br/>[tracker.json]"]
  node_pinned_data["Pinned message data<br/>[pinned.json]"]
  node_live_api["Live visitor API<br/>[live.js]"]
  node_backend["Site analytics client<br/>[backend.js]"]
  node_supabase[("Supabase services<br/>[schema.sql]")]
end

node_visitor(("Site visitor"))
node_github["GitHub and GitLab"]
node_social_sources["Social and news sources"]
node_anthropic["Anthropic Claude"]
node_github_api["GitHub API"]

node_visitor -->|"views"| node_homepage
node_homepage -->|"uses scoring"| node_scoring
node_homepage -.-> node_translations
node_homepage -.-> node_theme
node_homepage -.-> node_pinned
node_site_data -->|"drives tracker"| node_homepage
node_site_data -->|"builds news pages"| node_site_builder
node_scout_entry -->|"reads and writes"| node_site_data
node_scout_entry -->|"runs"| node_pipeline
node_pipeline -->|"uses adapters"| node_adapters
node_pipeline -.->|"reviews candidates"| node_assessment
node_scout_entry -->|"creates assessor"| node_assessment
node_scout_entry -->|"writes news"| node_newsdesk
node_adapters -->|"searches repos"| node_github
node_adapters -->|"searches posts and headlines"| node_social_sources
node_assessment -->|"requests review"| node_anthropic
node_newsdesk -->|"requests articles"| node_anthropic
node_pin_editor -->|"publishes file"| node_pinned_data
node_pin_editor -->|"commits via API"| node_github_api
node_private_dashboard -->|"queries admin data"| node_supabase
node_homepage -.->|"requests live count"| node_live_api
node_live_api -->|"requests viewer count"| node_supabase
node_site_builder -->|"adds view tracking"| node_backend

click node_homepage "https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/app.js"
click node_scoring "https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/scoring.js"
click node_translations "https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/i18n.js"
click node_theme "https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/theme.js"
click node_pinned "https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/pinned.js"
click node_site_data "https://github.com/4lwayz/portwatch-vi/blob/main/data/tracker.json"
click node_pinned_data "https://github.com/4lwayz/portwatch-vi/blob/main/data/pinned.json"
click node_scout_entry "https://github.com/4lwayz/portwatch-vi/blob/main/scripts/scout.mjs"
click node_pipeline "https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/pipeline.mjs"
click node_adapters "https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/core.mjs"
click node_assessment "https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/assess.mjs"
click node_newsdesk "https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/news.mjs"
click node_site_builder "https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/site-build.mjs"
click node_live_api "https://github.com/4lwayz/portwatch-vi/blob/main/functions/api/live.js"
click node_backend "https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/backend.js"
click node_private_dashboard "https://github.com/4lwayz/portwatch-vi/blob/main/dashboard/dashboard.js"
click node_pin_editor "https://github.com/4lwayz/portwatch-vi/blob/main/dashboard/pinned-editor.js"
click node_supabase "https://github.com/4lwayz/portwatch-vi/blob/main/supabase/schema.sql"

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_homepage,node_scoring,node_translations,node_theme,node_pinned,node_site_builder toneBlue
class node_scout_entry,node_pipeline,node_adapters,node_assessment,node_newsdesk toneAmber
class node_private_dashboard,node_pin_editor,node_github_api toneMint
class node_site_data,node_pinned_data,node_live_api,node_backend,node_supabase toneRose
class node_visitor,node_github,node_social_sources,node_anthropic toneIndigo
```

## Components

### Public tracker site

- [Tracker interface](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/app.js): `assets/js/app.js`
- [Effort scoring](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/scoring.js): `assets/js/scoring.js`
- [Translations](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/i18n.js): `assets/js/i18n.js`
- [Theme controls](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/theme.js): `assets/js/theme.js`
- [Pinned message](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/pinned.js): `assets/js/pinned.js`
- [News and SEO pages](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/site-build.mjs): `scripts/lib/site-build.mjs`

### Scout and editorial

- [Scout runner](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/scout.mjs): `scripts/scout.mjs`
- [Discovery and curation](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/pipeline.mjs): `scripts/lib/pipeline.mjs`
- [Source adapters](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/core.mjs): `scripts/lib/core.mjs`
- [Candidate assessment](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/assess.mjs): `scripts/lib/assess.mjs`
- [News desk](https://github.com/4lwayz/portwatch-vi/blob/main/scripts/lib/news.mjs): `scripts/lib/news.mjs`

### Maintainer tools

- [Private dashboard](https://github.com/4lwayz/portwatch-vi/blob/main/dashboard/dashboard.js): `dashboard/dashboard.js`
- [Pinned editor](https://github.com/4lwayz/portwatch-vi/blob/main/dashboard/pinned-editor.js): `dashboard/pinned-editor.js`

### Data and integrations

- [Tracker dataset](https://github.com/4lwayz/portwatch-vi/blob/main/data/tracker.json): `data/tracker.json`
- [Pinned message data](https://github.com/4lwayz/portwatch-vi/blob/main/data/pinned.json): `data/pinned.json`
- [Live visitor API](https://github.com/4lwayz/portwatch-vi/blob/main/functions/api/live.js): `functions/api/live.js`
- [Site analytics client](https://github.com/4lwayz/portwatch-vi/blob/main/assets/js/backend.js): `assets/js/backend.js`
- [Supabase services](https://github.com/4lwayz/portwatch-vi/blob/main/supabase/schema.sql): `supabase/schema.sql`

### Other components

- **Site visitor**
- **GitHub and GitLab**
- **Social and news sources**
- **Anthropic Claude**
- **GitHub API**

## Connections

- Site visitor → Tracker interface: views (evidence: `README.md`)
- Tracker interface → Effort scoring: uses scoring (evidence: `README.md`)
- Tracker interface → Translations
- Tracker interface → Theme controls
- Tracker interface → Pinned message
- Tracker dataset → Tracker interface: drives tracker (evidence: `README.md`)
- Tracker dataset → News and SEO pages: builds news pages (evidence: `README.md`)
- Scout runner → Tracker dataset: reads and writes (evidence: `scripts/scout.mjs`)
- Scout runner → Discovery and curation: runs (evidence: `scripts/scout.mjs`)
- Discovery and curation → Source adapters: uses adapters (evidence: `scripts/lib/pipeline.mjs`)
- Discovery and curation → Candidate assessment: reviews candidates
- Scout runner → Candidate assessment: creates assessor (evidence: `scripts/scout.mjs`)
- Scout runner → News desk: writes news (evidence: `scripts/scout.mjs`)
- Source adapters → GitHub and GitLab: searches repos (evidence: `README.md`)
- Source adapters → Social and news sources: searches posts and headlines (evidence: `README.md`)
- Candidate assessment → Anthropic Claude: requests review (evidence: `scripts/lib/assess.mjs`)
- News desk → Anthropic Claude: requests articles (evidence: `scripts/lib/news.mjs`)
- Pinned editor → Pinned message data: publishes file (evidence: `dashboard/pinned-editor.js`)
- Pinned editor → GitHub API: commits via API (evidence: `dashboard/pinned-editor.js`)
- Private dashboard → Supabase services: queries admin data (evidence: `dashboard/dashboard.js`)
- Tracker interface → Live visitor API: requests live count
- Live visitor API → Supabase services: requests viewer count (evidence: `functions/api/live.js`)
- News and SEO pages → Site analytics client: adds view tracking (evidence: `scripts/lib/site-build.mjs`)
