• Service Name: ihnyc-rc-landing
  • Live Site: https://ihnyc-rc.org
  • Repository: https://github.com/dghauri0/ihnyc-rc-landing.git

🧭 Overview

  • Cloudflare Pages site with Pages Functions under /functions for API endpoints
  • Public pages plus APIs for changelog, Canva previews, stats, and CSV datasets
  • R2-backed stats and CSV storage with analytics-store publishing
  • Static JSON feeds for updates and members roster

Sources: ihnyc-rc-landing/wrangler.toml, ihnyc-rc-landing/functions/redirects.ts, ihnyc-rc-landing/README.md


πŸ‘₯ Key User Flows

Residents

  • Read updates and members from static JSON feeds
  • Browse public pages (home, members, updates, support hub)

Admins

  • View analytics dashboard at /analytics
  • Manage CSV datasets via /api/csv-*
  • Fetch link analytics from R2

Developers

  • Access changelog from GitHub commits/releases
  • Preview Canva designs via proxy API

Sources: ihnyc-rc-landing/README.md, ihnyc-rc-landing/updates-data.json, ihnyc-rc-landing/members-data.json, ihnyc-rc-landing/functions/api/stats.ts


πŸ”— Key Routes and Endpoints

RouteMethodAuthPurposeSource
/analyticsGETEdge protection expectedAnalytics UIihnyc-rc-landing/analytics.html
/api/changelogGETPublicGitHub changelog aggregationihnyc-rc-landing/functions/api/changelog.ts
/api/canva-imageGETPublicCanva preview proxyihnyc-rc-landing/functions/api/canva-image.ts
/api/statsGETEdge protection expectedStats from R2ihnyc-rc-landing/functions/api/stats.ts
/api/csv-uploadPOSTEdge protection expectedUpload datasetihnyc-rc-landing/functions/api/csv-upload.ts
/api/csv-listGETEdge protection expectedList datasetsihnyc-rc-landing/functions/api/csv-list.ts
/api/csv-dataGETEdge protection expectedFetch datasetihnyc-rc-landing/functions/api/csv-data.ts
/api/dataset-typesGETEdge protection expectedDataset schema listihnyc-rc-landing/functions/api/dataset-types.ts
/api/publishPOSTEdge protection expectedPublish to analytics-storeihnyc-rc-landing/functions/api/publish.ts
/statsGETPublicRedirects to /analyticsihnyc-rc-landing/functions/redirects.ts

πŸ—„οΈ Data and Storage

StorageBindingPurposeSource
R2 (stats)STATS_BUCKETStores stats.json for link analyticsihnyc-rc-landing/wrangler.toml
R2 (datasets)CSV_BUCKETStores uploads, metadata, publish recordsihnyc-rc-landing/wrangler.toml
Static Assetsβ€”JSON feeds and member photosihnyc-rc-landing/updates-data.json

Sources: ihnyc-rc-landing/wrangler.toml, ihnyc-rc-landing/functions/api/stats.ts, ihnyc-rc-landing/functions/api/csv-upload.ts


Data Flow Diagram (Mermaid)

flowchart LR
  subgraph Users
    U_RES["USER: Resident"]
    U_ADMIN["USER: Admin"]
  end

  subgraph Services
    S_LANDING["SVC: ihnyc-rc-landing"]
  end

  subgraph Storage
    STORE_STATS["STORE: R2 (STATS_BUCKET)"]
    STORE_CSV["STORE: R2 (CSV_BUCKET)"]
    STORE_ASSETS["STORE: Static JSON Assets"]
  end

  subgraph External_Systems
    EXT_N8N["EXT: n8n"]
  end

  U_RES -->|browse| S_LANDING
  U_ADMIN -->|manage datasets| S_LANDING

  S_LANDING -->|read/write stats| STORE_STATS
  S_LANDING -->|upload/list/fetch datasets| STORE_CSV
  S_LANDING -->|serve| STORE_ASSETS
  EXT_N8N -->|write JSON feeds| STORE_ASSETS

Sources: ihnyc-rc-landing/wrangler.toml, ihnyc-rc-landing/N8N_HOUSE_UPDATES.md, ihnyc-rc-landing/N8N_WORKFLOW_COMPLETE.md


πŸ”„ Automations and Integrations

n8n Pipelines

  • Notion β†’ updates-data.json: House updates feed
  • Notion β†’ members-data.json: Council members roster
  • Notion β†’ /members images: Member headshots

Sources: ihnyc-rc-landing/N8N_HOUSE_UPDATES.md, ihnyc-rc-landing/N8N_WORKFLOW_COMPLETE.md

External APIs

  • GitHub API: Changelog aggregation
  • Canva: Preview extraction
  • screenshot.website: Fallback for Canva images
  • analytics-store: Companion service for curated publishes

Sources: ihnyc-rc-landing/functions/api/changelog.ts, ihnyc-rc-landing/functions/api/canva-image.ts, ihnyc-rc-landing/functions/api/publish.ts

πŸ“š Detailed Guides

  • n8n: Members + updates workflows, image handling, and outputs
  • canva: Canva preview pipeline and screenshot service setup
  • ops: Pages Functions troubleshooting and deploy fixes
  • design: Design tokens, QA checklist, and asset requirements
  • changelog-ai: Optional AI enrichment pipeline for changelog

πŸ—ΊοΈ Service Flow Diagram

Landing service architecture and integrations

flowchart LR
  subgraph Users
    U_RES["USER: Resident"]
    U_ADMIN["USER: Admin"]
  end

  subgraph Services
    S_LANDING["SVC: ihnyc-rc-landing"]
  end

  subgraph External_Systems
    EXT_GITHUB["EXT: GitHub API"]
    EXT_CANVA["EXT: Canva"]
    EXT_SCREENSHOT["EXT: screenshot.website"]
    EXT_N8N["EXT: n8n"]
  end

  subgraph Storage
    STORE_R2["STORE: R2"]
    STORE_ASSETS["STORE: Static Assets"]
  end

  U_RES -->|browse| S_LANDING
  U_ADMIN -->|admin| S_LANDING

  S_LANDING -->|serve| STORE_ASSETS
  S_LANDING -->|stats & CSV| STORE_R2

  S_LANDING -->|changelog| EXT_GITHUB
  S_LANDING -->|previews| EXT_CANVA
  S_LANDING -->|fallback| EXT_SCREENSHOT
  EXT_N8N -->|write JSON| S_LANDING

Sources: ihnyc-rc-landing/functions/api/changelog.ts, ihnyc-rc-landing/functions/api/canva-image.ts, ihnyc-rc-landing/N8N_HOUSE_UPDATES.md, ihnyc-rc-landing/N8N_WORKFLOW_COMPLETE.md, ihnyc-rc-landing/wrangler.toml


πŸ› οΈ Common Ops

Local Development

# Full local dev (recommended)
npx wrangler pages dev . --port 8788
 
# Static-only preview
python -m http.server 8000
 
# Analytics store companion service
cd services/analytics-store
npm install
ANALYTICS_STORE_TOKEN="dev-token" ANALYTICS_DUCKDB_PATH="./analytics.duckdb" npm run dev

Sources: ihnyc-rc-landing/README.md

Deployment

  • Framework: None (static + Functions)
  • Build command: node generate-last-updated.js (optional)
  • Output directory: .
  • Auto-deploys: On push to GitHub

Sources: ihnyc-rc-landing/wrangler.toml, ihnyc-rc-landing/README.md


πŸ” Environment Variables

NamePurposeRequired
GITHUB_TOKENGitHub API token for changelogOptional
CHANGELOG_REPOSComma-separated repo listOptional
ANALYTICS_STORE_URLAnalytics store service URLFor /api/publish
ANALYTICS_STORE_TOKENBearer token for analytics-storeFor /api/publish

Sources: ihnyc-rc-landing/functions/api/changelog.ts, ihnyc-rc-landing/functions/api/publish.ts


❓ Open Questions

Production Configuration

  • Which landing routes are protected by Cloudflare Access in production?

Sources: ihnyc-rc-landing/README.md