How pedrosarni/hackfood-2026 works
Hackathon repository implementing a WhatsApp grocery-ordering bot integrated with iFood, plus an operational analytics dashboard. The main workflow receives a WhatsApp message, buffers it, and runs the conversation flow: interpretation and order handling lead to iFood actions and replies; background paths support follow-ups and order tracking. A separate panel records conversation and integration events and provides dashboard analytics and AI-generated insights. Some dashboard-to-backend wiring and unsampled subsystem behavior are not shown, so those links are omitted.
Main entry points: contexto.py Bot context · app.jsx Dashboard app · app.py Webhook and jobs · fluxo.py Order conversation
Components 24
Conversation runtime
- Webhook and jobs
src/app.py - Message buffer
src/shared/buffer.py - Bot context
src/bot/contexto.py - Order conversation
src/bot/fluxo.py - Message interpretation
src/bot/interpretar.py - Order features
src/bot - Agent routing
src/agentes/__init__.py
External services
- WhatsApp API
src/shared/whatsapp.py - iFood MCP and OAuth
src/shared/ifood_mcp.py - LLM services
src/shared/llm.py - Meta Cloud API
- iFood services
- Gemini and fallback
Operations and insights
- Panel server
src/painel/servidor.py - Event diary and spies
src/shared/painel.py - Page insights
src/painel/analista.py - Analyst agent profile
src/agentes/analista.py
Analytics dashboard
- Dashboard app
Frontend/Rascunho_Dash/app.jsx - Dashboard metrics
Frontend/Rascunho_Dash/data.js - Team and agent views
Frontend/Rascunho_Dash/equipe.jsx - Insights view
Frontend/Rascunho_Dash/insights.jsx - PDF reporting
Frontend/Rascunho_Dash/pdf-report.js
Other components
- WhatsApp customer
- Dashboard operator
Connections 23
- WhatsApp customer → Meta Cloud API: sends message
- Meta Cloud API → Webhook and jobs: posts webhook
- Webhook and jobs → Message buffer: queues messages
src/app.py - Webhook and jobs → Order conversation: runs conversation
src/app.py - Order conversation → Bot context: uses services
- Order conversation → Message interpretation: interprets input
src/bot/fluxo.py - Order conversation → Order features: dispatches actions
src/bot/fluxo.py - Bot context → Agent routing: routes model calls
src/bot/contexto.py - Bot context → iFood MCP and OAuth: calls tools
src/bot/contexto.py - Bot context → LLM services: generates JSON
src/bot/contexto.py - Bot context → WhatsApp API: sends and fetches
src/bot/contexto.py - WhatsApp API → Meta Cloud API: calls Graph API
src/shared/whatsapp.py - iFood MCP and OAuth → iFood services: calls MCP
src/shared/ifood_mcp.py - LLM services → Gemini and fallback: requests generation
src/shared/llm.py - Webhook and jobs → Event diary and spies: records activity
src/shared/painel.py - Panel server → Event diary and spies: reads panel data
src/painel/servidor.py - Panel server → Page insights: requests insights
src/painel/servidor.py - Page insights → Analyst agent profile: uses profile
src/painel/analista.py - Dashboard operator → Dashboard app: views analytics
- Dashboard app → Dashboard metrics: uses metrics
Frontend/Rascunho_Dash/app.jsx - Dashboard app → Team and agent views: renders sections
Frontend/Rascunho_Dash/app.jsx - Dashboard app → Insights view: renders insights
Frontend/Rascunho_Dash/app.jsx - Dashboard app → PDF reporting: downloads report
Frontend/Rascunho_Dash/app.jsx