This app is purely AI generated, I wouldn't really trust it with anything. I just got sick of the shit that is out there.
A full-stack nutrition tracker that stores ingredients, builds recipes, and logs intake. Barcode scanning uses the browser camera via the BarcodeDetector API with a manual fallback.
- Ingredient library with barcode support
- Recipe builder with nutrition totals per serving
- Intake log with daily macro totals
- Everything stored in a database (SQLite by default)
- Install dependencies:
npm install
- Create your environment file:
cp .env.example .env
- Start the server (databases are initialized automatically):
npm run dev
Visit http://localhost:3000.
Mobile browsers require HTTPS for camera access when using an IP address. Generate a local self-signed cert, then enable HTTPS in .env.
- Generate a self-signed certificate (include your LAN IP for phones):
HOST_IP=192.168.1.8 ./scripts/generate-cert.sh
- Update
.env:HTTPS=true SSL_KEY_PATH=certs/localhost-key.pem SSL_CERT_PATH=certs/localhost-cert.pem
- Start the server and visit:
https://localhost:3000https://192.168.1.8:3000(accept the browser warning)
The app uses SQLite files for both the nutrition data and auth data.
DATABASE_URLpoints to the nutrition database file.AUTH_DATABASE_URLpoints to the auth database file.
- Barcode scanning requires a secure context (
httpsorhttp://localhost). - If the browser does not support
BarcodeDetector, use the barcode input field manually.
Create users manually and sign in at /login.
npm run create:user -- username password
npm run password:user -- username newpasswordUse the dashboard buttons to export a JSON file or import one back in. Imports default to merge (existing ingredients match on barcode or name).
Barcode lookup defaults to Open Food Facts when no API keys are configured. Add keys to .env to enable USDA or Nutritionix.
USDA_API_KEYfor FoodData Central (barcode search)NUTRITIONIX_APP_IDandNUTRITIONIX_APP_KEY
Use the CLI helper to test lookup results directly against the providers.
npm run lookup:barcode -- 012345678905
npm run lookup:barcode -- 012345678905 --provider usda