How retsu28/cookmate-recipe works
CookMate is a recipe and meal-planning product with web and mobile clients, an Express/PostgreSQL API, and an optional ML analytics service for the admin panel. The user-facing flow is browsing recipes and planning meals through a client, with the API handling domain requests and persistent data; authentication also exchanges Firebase identity with the backend. The graph preserves major documented capabilities, including camera/AI features, offline support, notifications, and analytics. Several links are dashed where the supplied excerpts do not show the runtime wiring directly.
Main entry points: App.tsx Web application · server.js HTTP API · ml_router.py Analytics routes · main.py Analytics service
Components 23
User clients
- Web application
src/App.tsx - Mobile application
mobile/App.js - Recipe discovery
src/pages/Search.tsx - AI camera
src/pages/AICamera.tsx - Meal planning UI
src/pages/MealPlanner.tsx - Offline support
src/offline/cacheService.ts - Admin analytics
src/admin/pages/MLAnalytics.tsx
Product API
- HTTP API
api/src/server.js - Authentication
api/src/controllers/authController.js - Recipe management
api/src/controllers/recipeController.js - Meal planning
api/src/controllers/mealPlannerController.js - Planner reminders
api/src/services/plannerReminderService.js - AI chat
api/src/services/chatService.js - ML integration
api/src/controllers/mlController.js
ML analytics
- Analytics service
ml_service/main.py - Analytics routes
ml_service/routers/ml_router.py - Forecast models
ml_service/models/trend.py - Churn model
ml_service/models/churn.py - Ingredient gaps
ml_service/models/gaps.py - Traffic model
ml_service/models/traffic.py
Data and identity
- PostgreSQL
api/src/config/db.js - Firebase Auth
Other components
- CookMate user
Connections 25
- CookMate user → Web application: uses
README.md - CookMate user → Mobile application: uses
README.md - Web application → Recipe discovery: routes to
src/App.tsx - Recipe discovery → Web application: requests data
src/pages/Search.tsx - Web application → HTTP API: calls
- Mobile application → HTTP API: calls
- HTTP API → Recipe management: routes to
api/src/server.js - HTTP API → PostgreSQL: checks connection
api/src/server.js - Recipe management → PostgreSQL: queries
api/src/controllers/recipeController.js - Meal planning → PostgreSQL: queries
api/src/controllers/mealPlannerController.js - Authentication → PostgreSQL: queries
api/src/controllers/authController.js - Web application → Firebase Auth: authenticates with
- Web application → HTTP API: exchanges identity
- Meal planning → Planner reminders: schedules reminders
api/src/controllers/mealPlannerController.js - AI camera → HTTP API: submits analysis
- Web application → Offline support: uses cache
- HTTP API → ML integration: routes ML requests
- ML integration → Analytics service: requests analytics
- Admin analytics → Analytics service: uses analytics
README.md - Analytics service → Analytics routes: mounts routes
ml_service/main.py - Analytics service → Forecast models: trains models
ml_service/main.py - Analytics routes → Forecast models: calls predictions
ml_service/routers/ml_router.py - Analytics routes → Churn model: calls predictions
ml_service/routers/ml_router.py - Analytics routes → Ingredient gaps: calls predictions
ml_service/routers/ml_router.py - Analytics routes → Traffic model: calls predictions
ml_service/routers/ml_router.py