DEV Community

Kethan Dosapati
Kethan Dosapati

Posted on

I was sick of bad health apps, so I built my own with Next.js

Not going to lie I built this app mostly to scratch my own itch.

Every health tracker I tried had the same problem. Great at one thing, terrible at everything else. Or just ugly. Or both. I wanted food logging, water tracking, workouts, weight trends, sleep, and actual AI insights all under one roof, without it looking like a hospital form.

So I spent the last few months building Arogyamandiram. Here's what I actually learned.


The stack

Next.js 15 with the App Router for the full-stack setup. TypeScript in strict mode non-negotiable when you're dealing with health data and math. MongoDB because a daily log is genuinely document-shaped and fighting a relational schema for every new field felt pointless. Tailwind, NextAuth, Recharts, and GPT 4o-mini for the AI layer.

Nothing exotic. Just tools that fit.


The thing I underestimated

The food catalog. I thought it'd take a weekend. It took way longer not because the code was hard, but because getting nutrition data right is actually hard. I ended up with 150+ foods built-in and a USDA FoodData Central API fallback for everything else. Fuzzy search so typos don't ruin the experience. Auto meal-type detection by time of day.

It sounds like a boring feature. It is the feature.


Security stuff I'm proud of

User API keys (for the AI features) are encrypted with AES-256-GCM before they touch the database. Passwords hashed with bcrypt at 12 salt rounds. All API responses filtered server-side so nothing leaks into the browser network tab. Route guards at both the layout level and the API level.

Not glamorous, but it's the kind of thing you only notice when it's missing.


The AI layer and why I was careful

When you ask for AI insights, only anonymized health metrics go to OpenAI. No name. No email. Nothing that identifies you. Just numbers.

And it won't make stuff up. If you haven't logged enough data to generate a meaningful insight, it tells you that. I think an AI that says "I don't have enough yet" is more trustworthy than one that confidently fills your screen with generic advice.


What I'd do differently

Build the onboarding flow first. I built it near the end and had to retrofit the data model around it annoying but fixable. And I'd write more tests for the AI layer specifically. Prompt consistency is harder to test than regular code and I learned that the slow way.


Try It
Live - https://arogyamandiram.vercel.app
Code - https://github.com/utsaaham/arogyamandiram - MIT licensed, and the setup actually works if you follow the README.
If you find a bug, want to contribute, or just tried it - I'd love to hear from you.

Top comments (0)