- 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
/functionsfor 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
| Route | Method | Auth | Purpose | Source |
|---|---|---|---|---|
/analytics | GET | Edge protection expected | Analytics UI | ihnyc-rc-landing/analytics.html |
/api/changelog | GET | Public | GitHub changelog aggregation | ihnyc-rc-landing/functions/api/changelog.ts |
/api/canva-image | GET | Public | Canva preview proxy | ihnyc-rc-landing/functions/api/canva-image.ts |
/api/stats | GET | Edge protection expected | Stats from R2 | ihnyc-rc-landing/functions/api/stats.ts |
/api/csv-upload | POST | Edge protection expected | Upload dataset | ihnyc-rc-landing/functions/api/csv-upload.ts |
/api/csv-list | GET | Edge protection expected | List datasets | ihnyc-rc-landing/functions/api/csv-list.ts |
/api/csv-data | GET | Edge protection expected | Fetch dataset | ihnyc-rc-landing/functions/api/csv-data.ts |
/api/dataset-types | GET | Edge protection expected | Dataset schema list | ihnyc-rc-landing/functions/api/dataset-types.ts |
/api/publish | POST | Edge protection expected | Publish to analytics-store | ihnyc-rc-landing/functions/api/publish.ts |
/stats | GET | Public | Redirects to /analytics | ihnyc-rc-landing/functions/redirects.ts |
ποΈ Data and Storage
| Storage | Binding | Purpose | Source |
|---|---|---|---|
| R2 (stats) | STATS_BUCKET | Stores stats.json for link analytics | ihnyc-rc-landing/wrangler.toml |
| R2 (datasets) | CSV_BUCKET | Stores uploads, metadata, publish records | ihnyc-rc-landing/wrangler.toml |
| Static Assets | β | JSON feeds and member photos | ihnyc-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 devSources: 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
| Name | Purpose | Required |
|---|---|---|
GITHUB_TOKEN | GitHub API token for changelog | Optional |
CHANGELOG_REPOS | Comma-separated repo list | Optional |
ANALYTICS_STORE_URL | Analytics store service URL | For /api/publish |
ANALYTICS_STORE_TOKEN | Bearer token for analytics-store | For /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