Create the data model and API routes for a real-time needs/offers board. Community members post what they need (shelter, water, medical, transport, labor) or what they can offer.
Data model:
- Post: { id, type: 'need'|'offer', category, description, location: {lat, lng, address}, contact, status: 'active'|'matched'|'resolved', urgency: 'critical'|'high'|'medium'|'low', createdAt, expiresAt }
- Match: { id, needId, offerId, status: 'proposed'|'confirmed'|'completed', createdAt }
API routes:
- POST /api/posts.create a need or offer (no auth required.disaster context)
- GET /api/posts?type=need&category=shelter&lat=X&lng=Y&radiusKm=Z.filter and search
- PATCH /api/posts/:id.update status
- POST /api/matches.propose a match between a need and offer
Validate all inputs with zod. Include geospatial filtering (Haversine distance). No authentication required.speed over security in crisis contexts.