Small mobile-first web app to track:
- when you feel hungry (or want to eat)
- what you ate
- when each event happened
Stack:
- FastAPI + SQLite
- Next.js (App Router + Tailwind)
- Single Docker container (nginx + supervisord)
backend/— FastAPI API and SQLite modelsfrontend/— Next.js mobile-first UIDockerfile— mono-container build (frontend + backend + nginx)
- Log hunger events with a free-text feeling
- Log meal events (food name, quantity, note)
- Chronological timeline of all events
No configuration required. Mount a volume to persist data.
docker build -t hunger-tracker .
docker run -d --name hunger-tracker \
-p 80:80 \
-v hunger_data:/app/data \
--restart unless-stopped \
hunger-trackerOpen: http://localhost
| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
sqlite:////app/data/hunger_tracker.db |
SQLite path inside container |
FRONTEND_ORIGIN |
* |
Restrict CORS to a specific origin, e.g. https://tracker.example.com |
LOG_LEVEL |
INFO |
DEBUG, INFO, WARNING, or ERROR |
Pass with docker run -e FRONTEND_ORIGIN=https://tracker.example.com ...
task install # install all dependencies
task dev # start backend (port 8000) and frontend (port 3000) in parallelBackend
cd backend
uv sync
uv run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000Frontend
cd frontend
npm install
npm run devPOST /meal-eventsGET /meal-eventsGET /timelineGET /health