Architecture Overview
ChatKcal is an "Intelligence First" calorie tracker. Instead of maintaining a food database, it leverages the user's existing AI (ChatGPT, Claude, Gemini) to analyze food and structured data.
1. Product Philosophy
- The Anti-Database: We don't want a search bar; we want a conversation.
- The Sidecar Model: ChatKcal acts as the "Long-Term Memory" for ephemeral AI chats.
- Zero Friction: The transition from "Chat" to "Log" must be instantaneous via Deep Links.
- Minimalist UI: The app ingests structured data and visualizes daily progress.
2. User Experience (UX) Flow
- Setup: User installs a "System Prompt" into their AI's custom instructions.
- Conversation: User sends a photo of food to their AI.
- Link Generation: The AI analyzes the food and generates a deep link (e.g.,
chatkcal.app/log?meal_json=...). - Ingestion: User clicks the link. ChatKcal parses the JSON, logs it to DynamoDB, and updates the dashboard.
3. Technical Stack
- Frontend: React + Vite + Tailwind CSS (hosted on AWS Amplify).
- Auth: AWS Cognito User Pools.
- Backend: AWS AppSync (GraphQL) with JavaScript Resolvers.
- Database: AWS DynamoDB (Single Table Design).
- Infrastructure: AWS SAM (Serverless Application Model).
4. Documentation Map
- Frontend & Offline: How we handle PWA, Caching, and React Query.
- Data Model & Aggregation: The DynamoDB Single-Table Design and Aggregation strategy.
- Auth & Security: Cognito setup and Social Sign-in flow.
- Integrations: The "Magic Link" protocol and MCP support.