☕ Syncaff Time your energy. — Science-backed caffeine timing that syncs your coffee with your biology.

🎯 Inspiration We've all been there: that 3 PM espresso that seemed like a good idea... until 2 AM when you're still wide awake. Or the morning coffee you chugged before your eyes were fully open, only to crash by noon.

The problem isn't caffeine — it's timing.

Most people don't realize that caffeine works with or against your body's natural rhythm. Drink too early (before cortisol peaks) and you build tolerance faster. Drink too late (within 8 hours of bed) and sleep suffers. The result? Poor sleep, midday crashes, and a constant tug-of-war with the very thing that's supposed to help.

We built Syncaff because we wanted something smarter than "don't drink coffee after 2 PM." We wanted personalized, science-backed guidance that considers when you wake, when you sleep, and who you are — your age, sensitivity, and lifestyle.

✨ What It Does Syncaff is your caffeine timing companion. Here's what it brings to the table:

🌅 Optimal Caffeine Window Enter your sleep and wake times, and Syncaff calculates your ideal caffeine window using:

Cortisol alignment: Your body's cortisol peaks ~45 minutes after waking. Caffeine is most effective after this peak, so we start your window there. 8-hour rule: Caffeine has a ~5–6 hour half-life. We recommend stopping 8+ hours before bed to protect sleep quality. 📊 Active Caffeine Tracking See exactly how much caffeine is currently in your system — not just what you drank. Our exponential-decay model factors in:

Your body weight and metabolism Caffeine sensitivity (from your profile) Half-life adjustments for age, gender, smoking, and exercise 😊 Mocha: Your Caffeine Coach Meet Mocha — a friendly character that brings your data to life. Mocha's mood reflects your caffeine load (happy when balanced, sleepy when overloaded) and delivers AI-powered insights powered by Google Gemini, explaining why your window works and offering personalized tips.

📝 Smart Logging Log coffee, tea, or energy drinks with one tap. Syncaff tracks whether you drank within your optimal window and correlates your habits with sleep quality over time.

👤 Personalized Profiles Create a profile with age, weight, chronotype (morning lark vs. night owl), and caffeine sensitivity. Syncaff adjusts your window and half-life calculations accordingly.

🛠 How We Built It Frontend React Native — Cross-platform mobile app (iOS & Android), built with React Native CLI React Navigation — Screen routing and navigation React Native SVG — Gradient progress bars and visual polish AsyncStorage — Local persistence for user preferences React Native Config — Environment-based API URL configuration Backend Python Flask — REST API server Flask-CORS — Cross-origin requests for mobile dev Database Snowflake — Cloud data warehouse storing: User schedules (sleep/wake times, optimal windows) Caffeine logs (type, amount, timing, was_in_window) User profiles (demographics, sensitivity, lifestyle) Sleep quality ratings (for future correlation analytics) AI Google Gemini API (gemini-2.5-flash) — Powers Mocha's friendly explanations and personalized tips. We use fallback responses when rate-limited. Algorithms Caffeine half-life model — Exponential decay (remaining = initial × 0.5^(time/half_life)) with profile-based adjustments Personalized window calculation — Chronotype, gender, age, and lifestyle modifiers for cutoff times 😤 Challenges We Ran Into

  1. User ID Routing Across Screens The app starts without authentication (optional Auth0). We needed a consistent user_id across Home → Results → Log → History. Solution: generate a UUID on first launch, store in AsyncStorage, and pass it through navigation params and persist it when the backend returns one after the first calculation.

  2. Snowflake Connection in Serverless Context Initially we hit connection pooling issues when the backend was cold. We added retry logic and ensured connections were properly closed after each request.

  3. Gemini Rate Limits During demos, we occasionally hit 429s. We implemented fallback strings for both the window explanation and tips so the app always delivers value, even when the AI is unavailable.

  4. Time Zone & Format Consistency Mobile uses 12-hour display; backend expects 24-hour HH:MM. We built conversion utilities (convertTo24Hour, to12HourDisplay) and made sure log_time sent to the API matched the backend's expectations.

🏆 Accomplishments End-to-end flow — From sleep inputs to AI insights, everything works in a single cohesive experience. Science-backed UX — We didn't just slap an algorithm on a UI; we explain why the window matters and make it feel approachable with Mocha. Production-ready data layer — Snowflake gives us a scalable foundation for future analytics (e.g., sleep score predictions, habit trends). Graceful degradation — No Gemini? No profile? The app still works with sensible defaults. 📚 What We Learned Cortisol timing matters more than we thought — The 45-minute post-wake rule is a game-changer for people who drink coffee immediately upon waking. Half-life personalization is non-trivial — Age, gender, smoking, and exercise each shift the curve. Getting the formula right took iteration. Mocha adds soul — A simple mascot with contextual moods made the app feel less clinical and more like a helpful friend. 🚀 What's Next for Syncaff Sleep correlation dashboard — "When you cut caffeine by 6 PM, your sleep rating improved 23%." Push notifications — "Your window opens in 15 minutes!" and "Last call — 2 hours left in your window." Widget support — Glanceable window status on the home screen. Apple Health / Google Fit integration — Auto-import sleep data. Social features — Share your window with accountability partners.

Built With

Share this project:

Updates