MindMama is a meal-planning and AI-powered recipe assistant designed for busy Muslim mums. The app allows users to plan meals, generate recipes via AI, and build shopping lists automatically.
This repo contains three services:
frontend/— React Native + Expo mobile appbackend/— Node.js API + Firestoreai/— FastAPI AI Orchestrator (LLM recipes & extraction)
MindMama/
├── .env.example # Example environment variables for root services
├── .gitignore
├── API_GUIDE.md # API usage and integration guide
├── README.md # Project documentation (this file)
├── requirements.txt # Python dependencies for AI service
├── package.json # Root dependencies / scripts (monorepo helper)
├── package-lock.json
├── ai/ # AI microservice (Python)
│ ├── Data/ # AI data assets
│ │ ├── DummyIngredientData.csv
│ │ ├── IngredientCanonicalMap.json
│ │ └── UnitNormalizationMap.json
│ ├── __init__.py
│ ├── app/
│ │ ├── __init__.py
│ │ ├── config.py # Config for AI app (env, constants)
│ │ ├── main.py # Entry point (API server)
│ │ ├── models.py # Data models / schemas
│ │ └── prompts.py # LLM prompt templates
│ ├── services/
│ │ ├── __init__.py
│ │ ├── llm_client.py # Wrapper around LLM provider
│ │ └── utils.py # Helpers for parsing, normalization, etc.
│ └── tests/
│ ├── test_api.py # API contract tests
│ └── test_connection.py# Connectivity / health tests
├── backend/ # Orchestrator & REST API (Node.js)
│ ├── .env.example # Example backend environment variables
│ ├── package.json
│ └── src/
│ ├── app.js # Express app setup
│ ├── index.js # Backend entry point
│ ├── api/
│ │ ├── controllers/ # Route controllers (business logic endpoints)
│ │ │ ├── plans.controller.js
│ │ │ ├── recipes.controller.js
│ │ │ ├── shopping-list.controller.js
│ │ │ └── today.controller.js
│ │ ├── middlewares/
│ │ │ └── error.middleware.js
│ │ └── routes/ # Route definitions / HTTP wiring
│ │ ├── plans.routes.js
│ │ ├── recipes.routes.js
│ │ ├── shopping-list.routes.js
│ │ └── today.routes.js
│ ├── config/
│ │ ├── env.js # Env loader
│ │ ├── firebase.js # Firebase config / client
│ │ └── orchestrator.js# AI orchestrator & prompt builder
│ ├── db/
│ │ ├── plans.db.js # Plans persistence layer
│ │ └── recipes.db.js # Recipes persistence layer
│ └── services/ # Domain services used by controllers
│ ├── meal-planner.service.js
│ ├── recipe.service.js
│ ├── shopping-list.service.js
│ └── today.service.js
├── frontend/ # Mobile app (React Native / Expo)
│ ├── .gitignore
│ ├── App.tsx # Root app component
│ ├── app.json # Expo app configuration
│ ├── babel.config.js
│ ├── components.json
│ ├── global.css # Global styles
│ ├── index.ts # Entry point / root registration
│ ├── nativewind-env.d.ts
│ ├── package.json
│ ├── package-lock.json
│ ├── tailwind.config.js # Tailwind / NativeWind config
│ ├── tsconfig.json
│ ├── assets/ # Static assets (icons, logo, splash)
│ │ ├── adaptive-icon.png
│ │ ├── favicon.png
│ │ ├── icon.png
│ │ ├── logo.png
│ │ └── splash-icon.png
│ ├── components/ # Reusable UI components
│ │ ├── MealCard.tsx
│ │ ├── PillButton.tsx
│ │ ├── RecipeCard.tsx
│ │ ├── index.ts
│ │ └── shared/
│ │ └── CustomTabBar.tsx
│ ├── lib/ # Client-side utilities & API layer
│ │ ├── api.ts # HTTP client & API wrappers
│ │ └── utils.ts # Helpers (formatters, mappers, etc.)
│ ├── navigation/ # Navigation configuration
│ │ └── index.tsx
│ ├── screens/ # App screens / routes
│ │ ├── AIGenerateScreen.tsx
│ │ ├── AISuggestionScreen.tsx
│ │ ├── CreatePlanScreen.tsx
│ │ ├── CreateRecipeScreen.tsx
│ │ ├── HomeScreen.tsx
│ │ ├── LaunchScreen.tsx
│ │ ├── MealPlanScreen.tsx
│ │ ├── RecipesLibraryScreen.tsx
│ │ ├── ShoppingListScreen.tsx.tsx # (typo in filename; consider renaming)
│ │ └── ViewRecipeScreen.tsx
│ ├── theme/
│ │ └── colors.ts # Centralized color palette
│ └── types/
│ └── navigation.ts # Typed navigation definitions
├── data/ # Shared data assets (non-AI specific)
│ ├── IngredientCanonicalMap.json
│ └── UnitNormalizationMap.json
└── docs/ # Additional documentation
└── api.md # Detailed API documentation
git clone <repo-url>
cd MindMama
cd frontend
npm install
npm run start # or: npx expo start
cd ai
python -m venv .venv
.venv/Scripts/activate # Windows
pip install -r requirements.txt
uvicorn ai.app.main:app --reload --port 8000
AI service runs at:
http://localhost:8000
cd backend
npm install
npm start
Backend runs at:
http://localhost:4000
For detailed request/response examples and how the frontend should call the backend, see:
frontend/API_GUIDE.md
Backend:
GET http://localhost:4000/recipes
AI:
POST http://localhost:8000/ai/suggest-meal
We never commit .env files.
Templates are provided below.
To generate Firebase admin credentials: Go to Firebase Console → Project settings → Service accounts → Generate private key.
Create a file:
PORT=4000
AI_URL=http://localhost:8000
FIREBASE_SERVICE_ACCOUNT={
"type": "service_account",
"project_id": "YOUR_PROJECT_ID",
"private_key_id": "YOUR_KEY_ID",
"private_key": "-----BEGIN PRIVATE KEY-----\\nxxx\\n-----END PRIVATE KEY-----\\n",
"client_email": "firebase-adminsdk@YOUR_PROJECT_ID.iam.gserviceaccount.com",
"client_id": "000000",
"token_uri": "https://oauth2.googleapis.com/token",
"universe_domain": "googleapis.com"
}
Also see backend/.env.example for the template.
-
Go to https://console.groq.com/ and create an account.
-
Open API Keys in the Groq console.
-
Create a new API key and copy it.
-
In the
ai/folder, copy.env.example→.envand set:GROQ_API_KEY=gsk_your_key_here # Optionally comment out OPENAI_API_KEY if you're not using it
No .env required yet.
API endpoint is set in:
frontend/lib/api.ts
The frontend communicates only with the Node backend.
The backend communicates with:
- Firestore (plans & recipes)
- FastAPI AI Orchestrator (meal suggestions)
POST /plans
Request:
{
"startDate": "2025-02-01",
"days": [
{
"date": "2025-02-01",
"meals": ["Lunch", "Dinner"]
}
]
}
Response:
{
"id": "m6BbpThWtpQx5kkWvLDi",
"startDate": "2025-02-01",
"days": [
{
"date": "2025-02-01",
"meals": ["Lunch", "Dinner"]
}
]
}
GET /plans/:id
Response:
{
"id": "m6BbpThWtpQx5kkWvLDi",
"startDate": "2025-02-01",
"days": [
{
"date": "2025-02-01",
"meals": [
{ "label": "Lunch", "recipeId": "xyz123" }
]
}
]
}
POST /plans/:id/meals/saved
Request:
{
"date": "2025-02-01",
"label": "Dinner",
"recipeId": "existingRecipeId"
}
POST /plans/:id/meals/ai
Request:
{
"date": "2025-02-01",
"label": "Dinner",
"preferences": {
"num_people": 2,
"time_available": 45,
"dietary_restrictions": [],
"preferences_text": "Moroccan"
}
}
-
Sends request to FastAPI: POST http://localhost:8000/ai/suggest-meal
-
AI returns:
{
"title": "Moroccan Beef Stew",
"ingredients": ["1 onion", "2 tomatoes"],
"steps": ["Fry onions", "Add beef"],
"prep_time": 15,
"cook_time": 30
}
- Backend saves the recipe.
- Backend attaches the recipe to plan on the date provided.
Frontend does NOT talk to AI directly.
GET /recipes
POST /recipes
Body:
{
"title": "Chicken Pie",
"ingredients": ["2 chicken breasts", "1 onion"],
"steps": ["Chop onion", "Fry chicken"]
}
POST /shopping-list/:planId
Response:
{
"planId": "PLAN_ID",
"items": [
{
"name": "tomatoes",
"lines": [
"2 tomatoes",
"200g chopped tomatoes"
]
},
{
"name": "onion",
"lines": [
"1 onion"
]
}
]
}
{
"startDate": "2025-02-01",
"days": [
{
"date": "2025-02-01",
"meals": [
{ "label": "Lunch", "recipeId": "xyz123" }
]
}
]
}
{
"title": "Moroccan Beef Stew",
"ingredients": [],
"steps": [],
"prep_time": 10,
"cook_time": 30,
"source": "ai"
}
POST /plans
GET /plans/:id
POST /plans/:id/meals/ai
POST /plans/:id/meals/saved
GET /recipes
POST /shopping-list/:planId
No AI endpoint is called by the frontend.
We follow clean separation:
controllers→ HTTP I/Oservices→ business logicdb→ Firestore layerai/→ AI recipes + parsing
The diagrams below show how the MindMama system is structured and how meals flow through the app:
Below is an overview of the flow:
npm start
uvicorn ai.app.main:app --reload --port 8000
npm run start
- AI runs on
http://localhost:8000 - Backend runs on
http://localhost:4000 - Frontend calls the backend via
frontend/lib/api.ts
- Node 18+
- Python 3.10+
- Firebase service account
- Groq account
.envfiles are ignored and never committed- AI + backend integration runs locally
- Frontend calls REST API through
frontend/lib/api.ts
- User authentication
- Cloud deployment