How sachith34129-coder/macrosnap works
MacroSnap is a Streamlit nutrition assistant: a user provides a name and WhatsApp number, then chats about meals by text or photo; Gemini estimates nutrition, and the user can request a conversation summary sent through WhatsApp. The workflow and integrations are implemented in app.py, with behavioral and message templates in prompts.py. The repository is small, so the stages below are conceptual responsibilities within that single application file, not separate modules.
Main entry points: app.py Summary request · prompts.py Prompt templates
Components 9
User experience
- Onboarding
app.py - Meal chat
app.py - Chat session
app.py
Nutrition AI
- Prompt templates
prompts.py - Gemini API
WhatsApp delivery
- Summary request
app.py - WhatsApp messaging
app.py - Twilio API
Other components
- User
Connections 16
- User → Onboarding: provides details
- Onboarding → Prompt templates: loads instructions
- Onboarding → Gemini API: creates chat
- Onboarding → Chat session: stores profile and chat
- User → Meal chat: sends text or photo
- Meal chat → Chat session: updates messages
- Meal chat → Gemini API: sends meal input
- Meal chat → Prompt templates: uses welcome text
- Gemini API → Meal chat: returns estimate
- User → Summary request: requests summary
- Summary request → Chat session: reads conversation
- Summary request → Prompt templates: loads summary prompt
- Summary request → Gemini API: requests summary
- Summary request → WhatsApp messaging: passes summary
- WhatsApp messaging → Twilio API: sends message
- Twilio API → WhatsApp messaging: returns delivery result