This is the backend service for CalorieLens — an API built with FastAPI to process meal data, ingredient recognition, and nutrition estimation.
- Language: Python 3.10+
- Framework: FastAPI (recommended for async APIs)
- Server: Uvicorn
- Database: Not specified; can be configured.
CalorieLensBackend/app/
├── app/
│ ├── main.py # Entry point
│ ├── routers/ # API routes/endpoints
│ ├── models/ # Database models (if any)
│ └── utils/ # Helper scripts
├── requirements.txt
├── .env # Environment configuration
└── README.md
git clone https://github.com/<your-org-or-username>/CalorieLensBackend.git
cd CalorieLensBackendpython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -r requirements.txtuvicorn app.main:app --reload --host 0.0.0.0 --port 8000Visit: http://127.0.0.1:8000/docs for interactive Swagger UI.
Create a .env file at the project root. Common variables:
APP_ENV=development
PORT=8000
LOG_LEVEL=info
# Backend config
DB_URL=sqlite:///./calorielens.db
API_KEY=your_api_key_here
ALLOWED_ORIGINS=http://localhost:5173| Method | Endpoint | Description |
|---|---|---|
POST |
/api/recognize |
Upload an image and analyze nutritional content |
GET |
/api/meals |
Retrieve logged meals |
GET |
/health |
Health check endpoint |
This project is licensed under the MIT License.