Turn neighborhood noise into coordinated action.
AI-assisted community coordination for mutual aid, safety, and resources β map-first reporting, trust-weighted matching, live local news, municipal-ready analytics, and a background integrity layer governments can trust.
**Built at YHack 2026 **
Neighborhoods run on goodwill and spreadsheets, not a shared operating picture.
- Fragmented signals β Food needs, safety concerns, and infrastructure issues live in group chats, 311 tickets, and org silos; no single prioritization layer.
- Late visibility β Critical issues surface only after escalation or harm; residents lack a common urgency language.
- Matching is manual β Connecting surplus food, volunteers, and needs depends on who knows whom, not transparent scoring.
- Weak accountability β Stakeholders canβt easily show what was decided, when, and why to funders or city partners.
βWe get twenty messages a day. I donβt know which block to prioritize first β or who already stepped up.β β Community organizer (illustrative)
Commune gives neighborhoods a single coordination stack:
Report on a map β Urgency + trust scoring β Smart matches β Health + integrity signals for residents and gov
- Report β Pin issues on an interactive map (Crown Heightsβstyle demo geography); optional live news ties to βreport related issue.β
- Score β Deterministic urgency rules plus structured reasoning objects (weights, explanations, hashes).
- Coordinate β Match engine connects needs, resources, and volunteers with transparent factor breakdowns.
- Trust & verify β Contribution history and trust scores; Solana devnet memos anchor high-value events in the background (no wallet UX). K2 Think V2 explains consequences and anchor context in plain language.
One demo neighborhood. One stack. Map + metrics + optional Hex analytics runtime.
- Full-view MapLibre map with teardrop pins, urgency styling, and pull-up urgent list.
- Server-Sent Events for live news ingestion; diamond markers and popups with AI-generated community impact (K2) where configured.
- Dedicated News split-screen: map + scrolling feed, filters, βReport related issueβ deep link.
- Report flow with fullscreen click-to-place location picker.
- Issue detail: category, urgency label, people affected, βif no action by tonightβ consequence copy from K2 Think V2.
- Status updates, verification, escalation, volunteer hooks via API.
- Weighted match scoring (proximity, urgency, availability, resource fit, completion probability).
- 3-layer reasoning β structured JSON, canonical hash, natural-language summary; visible in UI drawers.
- Trust scores from behavior: account age, completed actions, follow-through, org verification, recent activity.
- Rolling health metrics (issues resolved, response time, volunteers, food security index, safety score, trust network) with trends and evidence-style copy.
- Scheduled health snapshots with reasoning blobs for demos and gov narrative.
- Offers and requests; exchange proposals and alignment helpers.
- Optional resource chat endpoint for natural-language matching.
- H3 hex aggregation: issue density, urgency mix, category breakdown, timeline of platform events.
- Stat cards aligned to municipal pitch (open issues, people affected, match rate, etc.).
- Investigation workbooks β
POST /api/hex/investigationcreates a Hex project and programmatic CODE cells (pandas + matplotlib) from live SQLite issue data (mock mode without token). - Community Health Briefing Engine β
POST /api/hex/trigger-reportruns a published Hex app withinputParams(neighborhood,time_window, optionalmatch_id/issue_id). Auto-triggered on match confirmed/completed and issue escalate. - Gov UI β βTrigger briefing run,β βRun + poll,β links to latest run / published project when env is set.
See PLATFORM_DATA_CONTEXT.md Β§9bβ9c and backend/.env.example for env names.
- Tool-using agent: resources, metrics, issues, matches, alerts, submit_report,
show_on_map. show_on_mapresolves issue_id, alert_id (mapped to demo issues), or match_id β coordinates returned asmap_focusonPOST /api/chatso the map flies to the location (and navigates to Map when needed).
- No wallet UI β integrity is surfaced as IntegrityBadge + optional K2 explanation of anchor metadata.
- Devnet Memo-style anchoring with simulation fallback so demos never hard-fail.
βββββββββββββββββββββββ βββββββββββββββββββββββ
β Frontend (Vite) β HTTP β Backend (Express) β
β React 18 + TS β βββββββΊ β TypeScript β
β Port 5173 β /api β Port 3001 β
β MapLibre Β· Motion β β better-sqlite3 β
βββββββββββββββββββββββ ββββββββββββ¬βββββββββββ
β β
β SSE /api/news/stream β Schedulers: news poll, health snapshots
β β
βΌ βΌ
Optional VITE_API_URL SQLite (issues, matches, events,
β remote Railway API resources, anchors, news, metrics)
Integrations (optional, env-driven): K2 Think V2 Β· OpenAI Β· GNews Β· Hex API Β· Solana devnet.
| Technology | Purpose |
|---|---|
| React 18 | UI |
| TypeScript | Type safety |
| Vite 6 | Dev server & build |
| Tailwind CSS v4 | Styling (@tailwindcss/vite) |
| Motion | Animations |
| MapLibre GL | Interactive map |
| React Router 7 | Routing |
| Lucide React | Icons |
| Recharts | Charts (dashboard / health) |
| Radix UI + shadcn-style primitives | ui/src/app/components/ui/* |
| Sonner | Toasts |
| Technology | Purpose |
|---|---|
| Node.js 18+ | Runtime |
| Express | HTTP API |
| TypeScript | Type safety |
| better-sqlite3 | Embedded SQL |
| h3-js | Hexagonal spatial aggregation |
| dotenv | Configuration |
| cors | Cross-origin |
| tsx | Dev watch / seed scripts |
| OpenAI SDK | K2-compatible client + OpenAI models |
| @solana/web3.js | Devnet anchoring |
| Technology | Purpose |
|---|---|
| K2 Think V2 | Chat agent, consequence text, news impact, anchor explanations (MBZUAI-IFM/K2-Think-v2) |
| OpenAI | Fallback models (e.g. gpt-4o-mini) if K2 key absent |
| GNews | Live article polling + geocoding |
| Hex | Published project runs + optional notebook CRUD |
| Solana devnet | Background integrity memos |
Variable names only β see backend/.env.example and docs/TEAM_CREDENTIALS_DISCORD.md. Never commit real keys.
- Node.js 18+ and npm
- Git
git clone https://github.com/candpixie/yhack.git
cd yhack
# Backend
cd backend
npm install
cp .env.example .env
# Edit .env locally β do not commit secrets
npm run seed
npm run dev
# API: http://localhost:3001
# Frontend (new terminal)
cd ../ui
npm install
npm run dev
# UI: http://localhost:5173 (proxies /api β :3001)Run UI only with a shared deployed API:
cd ui
echo 'VITE_API_URL=https://YOUR-RAILWAY-OR-API-ORIGIN' > .env.local
npm run devDetails: docs/HACKATHON_TEAM_SETUP.md.
cd yhack
npm run build # installs ui + backend deps, builds both
npm run start # seed + node backend dist (serves ui/dist when built)Environment variables (optional, in backend/.env):
OPENAI_API_KEYβ enables the platform-wide AI chatbotNEWS_API_KEYβ enables live news feed from GNewsCOMMONS_SOLANA_PRIVATE_KEYβ base64-encoded key for real devnet transactionsCOMMONS_SOLANA_USE_SIMULATION=trueβ skip real transactions, use simulated hashes
yhack/
βββ backend/
β βββ src/
β β βββ index.ts # Express app, static ui/dist, route mount
β β βββ db.ts # SQLite schema
β β βββ seed.ts # Demo data
β β βββ routes/
β β β βββ issues.ts
β β β βββ matches.ts
β β β βββ community.ts
β β β βββ resources.ts
β β β βββ health.ts
β β β βββ anchor.ts
β β β βββ chat.ts
β β β βββ news.ts
β β β βββ dashboard.ts
β β β βββ hex.ts
β β βββ services/ # matching, trust, urgency, agent, solana, newsFetcher, etc.
β βββ .env.example
β βββ package.json
βββ ui/
β βββ src/
β β βββ app/
β β β βββ App.tsx
β β β βββ routes.tsx
β β β βββ components/ # MapView, NewsPage, DashboardPage, ChatPanel, β¦
β β β βββ context/ # MapFocusContext
β β β βββ lib/ # api.ts, mapStyle.ts
β β βββ styles/
β βββ vite.config.ts
β βββ package.json
βββ docs/
β βββ HACKATHON_TEAM_SETUP.md
β βββ TEAM_CREDENTIALS_DISCORD.md
βββ PLATFORM_DATA_CONTEXT.md # Data model & metrics reference
βββ package.json # Root build/start orchestration
βββ railway.toml
βββ vercel.json
βββ README.md
Base URL: {origin}/api (local: http://localhost:3001/api).
| Area | Example endpoints | Notes |
|---|---|---|
| Issues | GET/POST /issues, GET /issues/:id, PATCH .../status, POST .../verify, .../escalate, .../volunteer |
Reports & lifecycle |
| Matches | GET /matches, GET /matches/:id, GET /matches/for-issue/:issueId, PATCH /matches/:id/status |
Triggers Hex briefing on confirm/complete |
| Community | GET /community/alerts, GET /community/summary-metrics |
Alerts & summaries |
| Resources | GET/POST /resources, PATCH .../claim, POST .../exchange, GET .../exchanges, POST .../chat |
Offers, requests, barter |
| Health | GET /health, GET /health/snapshots |
Metrics & snapshots |
| Anchor | GET /anchor, GET /anchor/:id, GET /anchor/explain |
Integrity + K2 explanation |
| Chat | POST /chat |
{ messages } β reply, tool_results, optional map_focus |
| News | GET /news/recent, GET /news/stream (SSE) |
GNews + seed articles |
| Dashboard | GET /dashboard/hex, /stats, /timeline |
Gov analytics |
| Hex | POST /hex/investigation, POST /hex/trigger-report, GET /hex/briefing |
Notebooks + briefing runs |
| Events | GET /events |
Platform audit trail |
| System | GET /ping |
Health check |
Illustrative numbers from the bundled seed + metrics (see PLATFORM_DATA_CONTEXT.md Β§10):
| Metric | Demo value | Context |
|---|---|---|
| Issues (demo set) | 6+ reports | Food, safety, infrastructure, volunteer offers |
| People affected (rolled up) | 200+ in narrative | Pantry, school crossing, etc. |
| Critical open | 2 | Food pantry, unsafe crossing |
| Match success rate | 82% | Shown on Gov dashboard |
| Avg response time | 18h | Health metric storyline |
| Anchored records | 3 | Issues + match (devnet / sim) |
| Live news articles | 8 seed + API | Brooklyn-relevant when GNews enabled |
- Report an issue β Map β Report β pick category, pin location, submit β appears on map with urgency.
- Follow a match β Open match from map/issue flow β see score breakdown + integrity badge β update status (confirmed / completed triggers Hex briefing if configured).
- Gov / hex track β Gov tab β adjust H3 resolution β Hex investigation or Trigger briefing run β open Hex links from panel.
- Ask AI to show a case on the map β Chat: e.g. βShow alert a2 on the mapβ β model calls
show_on_mapβ response includesmap_focusβ map flies to linked issue (e.g. Dean St / PS 221 scenario). - Integrity β Issue or match detail β expand Integrity β optional K2 explanation of anchor + metadata.
From ui/src/styles/theme.css (light shell):
| Token | Role |
|---|---|
--commune-bg-primary |
#FAFAF8 β page background |
--commune-bg-secondary |
#F2F0EB β panels |
--commune-text-primary |
#1A1917 β primary text |
--commune-text-secondary |
#6B6860 β secondary |
--commune-blue |
#2563EB β links / accents |
--commune-red |
#DC2626 β critical urgency |
--commune-amber |
#D97706 β urgent |
--commune-green |
#16A34A β low / positive |
--commune-map-base |
#E8E0CC β map chrome |
Urgency labels drive pin colors and dashboard semantics (critical β urgent β moderate β low).
- railway.toml: Nixpacks installs root +
ui+backend, builds both, startscd backend && npm run seed && node dist/index.js. - Set
DB_PATHto a persistent path (e.g./data/commune.db) and mount a volume β otherwise SQLite resets on redeploy. - Inject secrets via Railway variables (same names as
.env.example).
- Root directory (important): In the Vercel project β Settings β General β Root Directory:
- Leave empty (repository root) β uses vercel.json at repo root (
cd ui && npm ci+ui/dist). - Or set to
uiβ uses ui/vercel.json (npm ciinui/, outputdist). Do not use the rootvercel.jsonpattern with Root Directory =ui(that would runcd uifrom insideui/and fail).
- Leave empty (repository root) β uses vercel.json at repo root (
- Set
VITE_API_URLto your Railway (or other) API origin (no trailing slash). - Optional:
VITE_CLERK_PUBLISHABLE_KEYfor Clerk; if unset, email/password demo login uses defaults from ui/.env.example.
| Doc | Purpose |
|---|---|
| PLATFORM_DATA_CONTEXT.md | Tables, metrics, scoring, gov pitch numbers |
| docs/HACKATHON_TEAM_SETUP.md | Teammates + VITE_API_URL |
| docs/TEAM_CREDENTIALS_DISCORD.md | Env variable reference (no secrets) |
- SDG 8 β Local coordination and micro-opportunities (volunteers, exchanges).
- SDG 9 β Resilient community infrastructure for information and trust.
- SDG 11 β Safer, more inclusive neighborhoods through shared visibility and response.
react Β· typescript Β· vite Β· tailwindcss Β· motion Β· maplibre-gl Β· react-router Β· recharts Β· lucide-react Β· sonner Β· express Β· better-sqlite3 Β· h3-js Β· openai Β· @solana/web3.js
Built at YHack 2026 β Commune team (add names / roles as you like).
No LICENSE file is present in this repository root yet. Add one (e.g. MIT, Apache-2.0, or hackathon-specific terms) before public distribution.
- YHack 2026 organizers, mentors, and sponsors.
- MBZUAI / IFM for K2 Think V2 access and documentation.
- Hex Technologies for the public API and hackathon track framing.
- OpenStreetMap / MapLibre contributors for map tiles and tooling.
- Crown Heights neighbors and mutual-aid groups who inspire coordination-first design.
Every unresolved need is a coordination failure. Commune turns neighborhood signal into shared action.
Questions or issues? Open a GitHub issue on candpixie/yhack. Also on yhackynot.study