Track calories by scanning food barcodes. Built with React and FastAPI, backed by PostgreSQL.
- Python 3.11+
- Node.js 18+
- PostgreSQL running locally on port 5432
cd Food-Tracker
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r backend/requirements.txtcd frontend
npm installYou need two terminals.
Terminal 1 — Backend:
source venv/bin/activate # Windows: venv\Scripts\activate
uvicorn backend.main:app --reloadAPI runs at http://localhost:8000
Terminal 2 — Frontend:
cd frontend
npm startApp opens at http://localhost:3000
The backend connects to a local PostgreSQL database (postgres db, postgres user) by default. You can override with environment variables:
| Variable | Default |
|---|---|
DATABASE_URL |
(overrides all below) |
DB_NAME |
postgres |
DB_USER |
postgres |
DB_PASS |
(your password) |
DB_HOST |
localhost |
DB_PORT |
5432 |
The users and entries tables must exist in your database before running.