The Healthy Meal Copilot API is a prototype backend designed to generate AI-powered meal plans.
It balances API-first development, type safety, AI integration, and testing best practices.
This project serves as a production-ready prototype stack combining:
- FastAPI for high-performance APIs
- Pydantic for strict data modeling
- Ruff for lightning-fast linting
- mypy for static type checking
- pytest for robust testing
- LLM integrations with OpenAI, Gemini, and Claude
- MongoDB for structured data storage
- Qdrant for vector embeddings & retrieval
- 🍽️ AI-driven meal plan generation
- 🔑 Authentication system with multiple modes (
internal
,partner
,both
) - ⚡ RESTful API endpoints with FastAPI
- 📊 MongoDB persistence for structured data
- 🔍 Qdrant integration for semantic retrieval
- 🤖 Multiple LLMs supported: OpenAI, Gemini, Claude
- 🧪 Test-oriented stack with
pytest
- 🔒 Static analysis & formatting via
ruff
+mypy
- Language: Python
3.12
- Framework: FastAPI
- ORM / Models: Pydantic
- Testing: pytest
- Static typing: mypy
- Linting & Formatting: Ruff
- Database: MongoDB
- Vector DB: Qdrant
- LLM Providers: OpenAI, Gemini, Claude
git clone https://github.com/your-org/healthymeal-copilot-api.git
cd healthymeal-copilot-api
python -m venv venv
source venv/bin/activate # Linux / macOS
venv\Scripts\activate # Windows
pip install -r requirements.txt
cp .env.example .env
Edit .env
with your keys, database URLs, and config.
(See example configuration above).
python -m app.main
or
uvicorn app.main:app --reload
By default, the app runs at:
👉 http://localhost:8000
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
This project uses a test-first, type-safe workflow.
pytest
With coverage:
pytest --cov=app --cov-report=term-missing
mypy app test
ruff check app test
ruff format app test
✅ Recommendation: Add
pre-commit
hooks to runmypy
+ruff
automatically.
app/
├── api/ # API route handlers
├── core/ # Core settings & config
├── db/ # DB clients (Mongo, Qdrant)
├── models/ # Pydantic data models
├── prompts/ # LLM prompt templates
├── schemas/ # Request/response validation
├── services/ # Domain logic (meal planning, LLM, etc.)
├── utils/ # Helper functions
└── main.py # FastAPI entrypoint
docs/ # Additional documentation
tests/ # Pytest test suite
- Modes:
internal
,partner
,both
- Authentication via API Keys + JWT tokens
- Super Admin API key for privileged routes
See docs/authentication.md for full details.
- ✅ Core FastAPI + MongoDB + Qdrant integration
- ✅ Multi-LLM integration (OpenAI, Gemini, Claude)
- ✅ Testing + linting + typing pipeline
- 🔄 CI/CD integration with GitHub Actions (test, lint, type-check)
- 🔜 Deployment to containerized environments
- Fork repo & create feature branch
- Ensure
pytest
,mypy
, andruff
pass cleanly - Submit PR 🚀
MIT License – free to use, modify, and distribute.