https://github.com/plyght/anchor
anchor is a volunteer coordinator for emergency mesh networks.
https://github.com/plyght/anchor
ai coordinator hackathon mesh mesh-networks ml
Last synced: 5 days ago
JSON representation
anchor is a volunteer coordinator for emergency mesh networks.
- Host: GitHub
- URL: https://github.com/plyght/anchor
- Owner: plyght
- Created: 2026-01-02T21:37:08.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2026-01-04T23:51:39.000Z (6 months ago)
- Last Synced: 2026-04-29T02:40:58.617Z (2 months ago)
- Topics: ai, coordinator, hackathon, mesh, mesh-networks, ml
- Language: TypeScript
- Homepage: https://anchor-flame.vercel.app
- Size: 12.4 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Anchor
Emergency volunteer coordination system using Bluetooth mesh networks for infrastructure-independent task dispatch during crisis events.
## Overview
Anchor coordinates emergency response volunteers through a token-gated task system that operates over Bluetooth LE mesh networks when traditional infrastructure fails. The system generates tasks from incident triggers, matches them to available volunteers based on skills and location, and dispatches assignments via BitChat mesh with unique acceptance codes for verification.
## Features
- **Infrastructure-Independent**: Operates over Bluetooth LE mesh when internet/cellular networks are unavailable
- **Token-Gated Tasks**: 4-character acceptance codes prevent unauthorized task claiming
- **Intelligent Matching**: Skills-based task assignment with availability and location awareness
- **AI-Powered Coordination**: Optional AI features for task generation, volunteer matching, and message routing
- **Real-Time Coordination**: Live dashboard updates via Convex reactive queries
- **Audit Trail**: Complete system history for compliance and post-incident analysis
- **Escalation System**: Automatic task reassignment when volunteers don't respond
- **Bridge Architecture**: HTTP polling bridge connects web app to mesh network
## AI Integration
Anchor includes optional AI-powered features using OpenAI for intelligent coordination:
- **🤖 Dynamic Task Generation**: AI creates contextually relevant tasks based on incident details (vs hardcoded templates)
- **🎯 Smart Volunteer Matching**: AI assists with difficult-to-match tasks when rule-based matching fails
- **📨 Emergency Message Routing**: Automatically analyze and route incoming mesh messages to appropriate volunteers
**Quick Start:**
```typescript
// Enable AI for task generation
const tasks = await generateForIncident({ incident_id, use_ai: true });
// Use AI for difficult matches
const result = await matchIncidentWithAI({ incident_id, use_ai_fallback: true });
// Process emergency message with AI
const analysis = await processEmergencyMessage({
message: "Medical emergency at Main St",
incident_id,
auto_assign: true
});
```
**Setup:** Set OpenAI API key in Convex environment:
```bash
bunx convex env set OPENAI_API_KEY "sk-..."
```
📖 **Full Documentation**: [docs/AI_INTEGRATION.md](docs/AI_INTEGRATION.md)
## Installation
### Prerequisites
- Bun 1.0+
- Convex account (sign up at https://convex.dev)
- BitChat iOS/Android app for volunteers
- Rust 1.85+ (for bridge component at ~/bitchat-terminal)
### Convex Setup
```bash
# From the project root, run Convex dev
bunx convex dev
# This will:
# 1. Login/create account (if first time)
# 2. Create/select a project
# 3. Generate types in convex/_generated/
# 4. Create .env.local with CONVEX_URL
```
After running `convex dev`, copy the `CONVEX_URL` from `.env.local` to `frontend/.env` as `VITE_CONVEX_URL`:
```bash
# Copy CONVEX_URL from .env.local to frontend/.env
echo "VITE_CONVEX_URL=$(grep CONVEX_URL .env.local | cut -d '=' -f2)" >> frontend/.env
```
### Backend Setup
```bash
cd backend
cp .env.example .env
# Edit .env with Convex deploy key if needed
bun install
bun run src/index.ts
```
Backend runs on http://localhost:8000
### Frontend Setup
```bash
cd frontend
cp .env.example .env
# Edit .env with your Convex URL (from convex dev output)
bun install
bun dev
```
Frontend runs on http://localhost:5173
### Bridge Setup (BitChat Integration)
```bash
cd ~/bitchat-terminal
# Create .env
cat > .env <