A lightweight, self-hosted calorie & macro tracker with a clean mobile-friendly UI.
- Daily tracking — Log meals (breakfast, lunch, dinner, snacks) with calories & macros
- Macro targets — Configurable protein/carb/fat split with TDEE calculation
- History view — Browse past days, see trends, track streaks
- Settings — Weight, height, age, activity level, deficit goal
- Dark mode — Easy on the eyes
- Mobile-first — Responsive design, works great on phones
- Zero dependencies frontend — Pure vanilla JS, no frameworks
# Clone
git clone https://github.com/Youplala/caltrack.git
cd caltrack
# Run
python3 server.pyOpen http://localhost:8888/index.html in your browser.
The Python server exposes a simple REST API:
| Method | Endpoint | Description |
|---|---|---|
GET |
/calories/index.html |
Serves the web app |
GET |
/api/profile |
Get user profile/settings |
PUT |
/api/profile |
Update profile |
GET |
/api/meals?date=YYYY-MM-DD |
Get meals for a date |
POST |
/api/meals |
Add a meal |
DELETE |
/api/meals/:id |
Delete a meal |
- Backend: Python 3 + SQLite (single file, no dependencies)
- Frontend: Vanilla HTML/CSS/JS with localStorage for settings
- Database: SQLite (
calories.db, auto-created)
MIT


