Inspiration

Living with diabetes means guessing, many times a day. How much will this pizza spike me? Will this run send me low? A continuous glucose monitor (CGM) gives you a constant stream of readings, but it doesn't link a curve back to the meal or workout that caused it. The pattern is somewhere in the data, and you're left to find it yourself. We wanted an app that remembers for you and turns months of readings into answers you can use before your next meal.

What it does

Dextrack connects to your Dexcom CGM and ties your glucose data to what you actually do.

  • Meals and workouts you can log again and again. Build a meal from USDA food data (carbs are filled in for you) or save a workout, then log it each time. Every log stores your glucose curve from 30 minutes before to 3–4 hours after.
  • Predicted curves. After a few logs, Dextrack averages your past responses into a predicted curve: "Predicted based on past 5 times."
  • Predictability badges. Each meal and workout is rated Consistent or Unpredictable, based on how much your peak (or drop) varies from one time to the next.
  • AI assistant. Type "about to eat two slices of pizza" and Gemini estimates the carbs and matches it to your saved meal. The dose is then calculated from your own carb ratio and correction settings, using your live CGM reading. Workouts get a carb suggestion, never an insulin change.
  • Insulin calculator with separate settings for breakfast, lunch, dinner and snacks, plus daily reminders for long-acting insulin.
  • Dashboard with your current reading and trend arrow, an estimated A1C and dawn phenomenon tracking (how much your glucose rises in the early morning).

How we built it

  • Mobile app: Expo (React Native) in plain JavaScript, with bottom tabs, detail screens for each meal and workout, reusable glucose charts, and light and dark themes.
  • Backend: Node.js and Express. It handles Dexcom OAuth2 sign-in and token refresh, fetches and caches glucose readings, looks up carbs through USDA FoodData Central, and calls the Google Gemini API. Data is stored in a lightweight JSON file (lowdb), so there's no database to set up.
  • Predictions: past glucose windows are lined up by minutes from the meal or workout, grouped into 5-minute buckets and averaged. Predictability comes from the standard deviation of the peak (or the post-workout drop) across logs.
  • Networking: our team worked from different networks, each running the project locally, so we connected our dev machines and phones over a Tailscale network. Everyone could reach a shared backend and test on real phones, including the Dexcom sign-in flow.
  • Demo data: a seed script generates realistic glucose curves after meals, including a deliberately unpredictable pizza.

Challenges we ran into

  • Keeping AI out of the dose math. In a medical app, a language model must never make up an insulin dose. We split the work: Gemini only reads the message and writes the reply. The dose comes from fixed code, and any adjustment based on your history uses set rules capped at ±15%.
  • Gemini rate limits. We kept hitting free-tier limits during testing, so we built a fallback chain that tries lighter models first and moves to the next one on a rate-limit or unavailable error.
  • Working as a team across different networks. A phone on one network can't reach a laptop on another, and we were all working from different places. Tailscale gave everyone a shared private network, so any teammate's phone could talk to the backend, and Dexcom sign-in could finish right on the phone.
  • Glucose data for past events. Past glucose windows have to be fetched once the event is over and then cached, so the app doesn't keep asking Dexcom for the same data.

Accomplishments that we're proud of

  • Turning raw CGM data into something you can act on: "this meal usually peaks at 190 around the 60-minute mark, and it's consistent."
  • A dosing assistant that is useful and still safe: the AI helps you understand the situation, while the numbers come from your own settings and fixed calculations.
  • A complete, working mobile app with real Dexcom sign-in, built in 36 hours.

What we learned

  • How CGM data works in practice: 5-minute readings, trend arrows, data delays, and how measures like estimated A1C and dawn phenomenon are calculated.
  • How OAuth2 sign-in works with a real health API, including redirect URLs and refreshing access tokens.
  • Where AI helps and where it doesn't. It's great at understanding "a big bowl of pasta," but calculations with health consequences belong in fixed, testable code.

What's next for Dextrack

  • Real account security and encrypted token storage
  • Smoother sign-in, so you don't have to paste your user ID after Dexcom login
  • Glucose curves shown by time of day, since the same meal can behave differently at breakfast and dinner
  • Reports you can share with your care team

Built With

Share this project:

Updates

Submission history