Skip to content

About

Full-stack nutrition and macro tracker with reusable meals, water and creatine tracking, daily streaks, and PWA support. React 19 · Express 5 · PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Nutrition App

Frontend Backend Build

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.

What it does

  • 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.

Running it locally

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 .env

The 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:migrate

Start both apps and open the app:

# in apps/server/
npm run dev

# in apps/client/
npm run dev

The frontend runs at http://localhost:5173. Verification and password-reset emails land in Mailpit at http://localhost:8025.

Deploying

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.

Under the hood

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

License

Built as a portfolio project, provided as-is.

About

Full-stack nutrition and macro tracker with reusable meals, water and creatine tracking, daily streaks, and PWA support. React 19 · Express 5 · PostgreSQL.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages