A full-stack nutrition tracker for logging meals, hitting your macro and water goals, and keeping a daily streak going. You add the ingredients you eat with their macros, combine them into meals you can reuse, and log those meals with a tap.
- Tracks calories, protein, carbs and fat against targets you set yourself
- Logs water and, if you turn it on, creatine, with a daily streak to keep you honest
- Saves reusable ingredients and meals, and lets you log one-off meals that don't clutter your library
- Signs you in with email and password (with email verification) or Google
- Runs as an installable PWA with light and dark themes
When you save a day to history, today's meals, water and creatine reset for the next one.
You'll need Node 20.19+ (or 22.12+) and Docker. Docker runs Postgres and a local mail inbox for the verification emails.
git clone https://github.com/KoZsombat/nutrition-app
cd nutrition-app
# install both sides
cd apps/client && npm install
cd ../server && npm install
cd ../..Next, set up your environment. Both apps read one .env in the repo root:
cp .env.example .envThe defaults work for local development. The only value you have to fill in is BETTER_AUTH_SECRET, which needs at least 32 characters (openssl rand -base64 32 makes one). Google login is optional: leave GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET blank to skip it.
Start Postgres and Mailpit, then create the tables:
docker compose up -d db mailpit
cd apps/server
npm run db:migrateStart both apps and open the app:
# in apps/server/
npm run dev
# in apps/client/
npm run devThe frontend runs at http://localhost:5173. Verification and password-reset emails land in Mailpit at http://localhost:8025.
compose.prod.yaml runs the whole stack behind Caddy, which handles HTTPS and serves the app and the API from a single domain. deploy.md walks through it step by step, from an empty Proxmox host to the live site.
React 19 and TypeScript on the front, with Tailwind CSS 4 and React Router. Express 5 and PostgreSQL on the back, using Drizzle ORM. Auth is handled by Better Auth (cookie sessions, email verification, optional Google OAuth). The build is Vite with vite-plugin-pwa.
If you want to dig in:
| Where | What's there |
|---|---|
apps/server/src/routes |
the API |
apps/server/src/db/schemas |
the database schema |
apps/server/drizzle |
migrations |
apps/client/src/lib/api.ts |
the client's API layer |
Built as a portfolio project, provided as-is.