How ashish-netam011/famsecure works
FarmRescue is an agricultural emergency early-warning and response platform. Farmers report a problem or supply field observations; the system assembles evidence, assesses risk with deterministic rules, validates a stored action plan, and presents response guidance. Field workers can verify conditions, while reassessment and outcome reporting preserve an incident history. Weather, AI explanations, and MongoDB persistence are supporting capabilities. The README documents the overall flow; sampled sources confirm key API, store, evidence, and persistence links, but several page and integration connections are documented rather than source-verified.
Main entry points: index.ts Incident and farm store · route.ts Field incident route · page.tsx Incident response · fieldBundle.ts Weather bundle
Components 22
Farmer and worker experience
- Farm dashboard
src/app/page.tsx - Incident wizard
src/app/incidents/new/page.tsx - Incident response
src/app/incidents/[id]/page.tsx - Inspection queue
src/app/field-worker/page.tsx - Audit history
src/app/history/page.tsx - Simulation drawer
src/components/SimulationDrawer.tsx
API and field evidence
- Incident routes
src/app/api/incidents/route.ts - Field incident route
src/app/api/fields/[id]/incidents/route.ts - Evidence context
src/domain/field/context.ts - Weather bundle
src/domain/weather/fieldBundle.ts - Soil adapter
src/domain/soil/adapter.ts
Assessment and response
- Risk rules
src/domain/risk/rules.ts - Safety gate
src/domain/safety/safetyGate.ts - Stored action plans
src/domain/actions/recommendations.ts - AI explanation adapter
src/domain/ai/adapter.ts
History and persistence
- Incident and farm store
src/domain/store/index.ts - Mongo persistence
src/lib/persistence/mongo.ts
Other components
- Farmer
- Field worker
- Open-Meteo
- Gemini
- MongoDB
Connections 25
- Farmer → Farm dashboard: views
README.md - Farmer → Incident wizard: reports incident
README.md - Incident wizard → Incident routes: submits report
README.md - Incident routes → Incident and farm store: creates incident
src/app/api/incidents/route.ts - Incident and farm store → Risk rules: evaluates risk
src/domain/store/index.ts - Incident and farm store → Safety gate: validates actions
src/domain/store/index.ts - Safety gate → Stored action plans: validates plan
README.md - Incident and farm store → Mongo persistence: persists mutations
src/domain/store/index.ts - Mongo persistence → MongoDB: writes and hydrates
README.md - Incident and farm store → Incident response: serves assessment
- Incident response → AI explanation adapter: requests explanation
README.md - AI explanation adapter → Gemini: optionally explains
README.md - Farmer → Field incident route: reports from field
README.md - Field incident route → Incident and farm store: reads and creates
src/app/api/fields/[id]/incidents/route.ts - Field incident route → Weather bundle: fetches conditions
src/app/api/fields/[id]/incidents/route.ts - Field incident route → Soil adapter: fetches regional soil
src/app/api/fields/[id]/incidents/route.ts - Field incident route → Evidence context: builds evidence
src/app/api/fields/[id]/incidents/route.ts - Evidence context → Risk rules: supplies evidence
- Weather bundle → Open-Meteo: fetches weather
README.md - Field worker → Inspection queue: reviews queue
README.md - Inspection queue → Incident and farm store: verifies incident
- Incident response → Incident and farm store: adds evidence and outcomes
- Incident response → Audit history: records assessment timeline
README.md - Simulation drawer → Incident and farm store: requests reassessment
- Farm dashboard → Weather bundle: shows conditions
README.md