How I Built Caloriv - A Full-Stack Nutrition Tracking App
How I Built Caloriv
Caloriv started as a simple question: why are most nutrition apps either too complex or too shallow? I wanted something that does the math correctly, stays fast, and doesn't require a subscription.
The Core Problem
Most calorie trackers treat BMR/TDEE as a black box. Users enter their details and get a number with no explanation. I wanted Caloriv to be transparent - show the formula, show the calculation, let the user understand what they're working with.
The Math Behind It
The app uses the Mifflin-St Jeor equation - the most validated formula for estimating Basal Metabolic Rate:
Men: BMR = 10 x weight(kg) + 6.25 x height(cm) - 5 x age + 5
Women: BMR = 10 x weight(kg) + 6.25 x height(cm) - 5 x age - 161
TDEE is then calculated by multiplying BMR by an activity multiplier:
| Activity Level | Multiplier | |---|---| | Sedentary | 1.2 | | Lightly Active | 1.375 | | Moderately Active | 1.55 | | Very Active | 1.725 |
Tech Stack Decisions
Why Next.js? App Router gives co-located server and client logic. I could handle form submissions and data reads in the same file without a separate Express backend.
Why SQLite? For a solo project with no concurrent users, SQLite is the right call. No hosted database costs, no connection pooling complexity. The entire database is a single file.
Why TypeScript? Nutrition data has a lot of shape - user profiles, meal entries, macro breakdowns. TypeScript caught several bugs at compile time that would have been painful runtime errors.
