Ritu — Ayurvedic Period Tracking App

Ancient wisdom meets modern cycles. Track your flow through an Ayurvedic lens and let 5,000 years of holistic knowledge guide your body back to its most natural, balanced, and powerfully radiant self.


Inspiration

For almost two years, I suffered with a hormonal imbalance went undiagnosed, untreated, and unexplained. My symptoms were severe. I had chronic anemia, exhaustion, and went through months of being genuinely, debilitatingly sick. Appointment after appointment with Western medicine offered no real answers, and just gave me band-aid solutions that never touched the root cause or fixed the problems in my body for good.

It wasn't until turning to homeopathy and Ayurveda that things began to shift. Slowly, my hormones began to balance. For the first time, I discovered there was a language for what my body had been trying to communicate all along.

That experience raised a much bigger question: why is this knowledge so hard to access for females, considering that so many of us suffer with hormonal issues? I mean, 10 to 13 percent of women alone have PCOS!

The answer is uncomfortable but well-documented. The majority of clinical medical research has historically been conducted on male subjects, whether it's a matter of drug trials or diagnostic benchmarks. This means the very foundation of Western medical advice given to women is built on incomplete data. Consider that even the standard metabolic rate formula used to calculate caloric needs:

$$ BMR = 88.36 + (13.4 \times \text{weight in kg}) + (4.8 \times \text{height in cm}) - (5.7 \times \text{age in years}) $$

.... was derived predominantly from male physiology. Female hormonal fluctuation across a roughly 28-day cycle means that metabolic needs, energy levels, nutritional requirements, and even emotional processing shift phase by phase. A single static formula cannot capture that. Ayurveda has known this for over 5,000 years.

After sticking to a system that has clearly not worked for so many women, myself included, I realized that Ayurveda was the future for women to take back control over our bodies and health.


What Was Learned

Building this project meant going deep into Ayurvedic texts, homeopathic practice, and the intersection of ancient medicine with modern cycle science.

The Three Doshas & The Menstrual Cycle

Ayurveda organizes all matter and energy into three constitutional forces:

Dosha Elements Cycle Phase Qualities
Vata Air + Ether Menstruation (Days 1–5) Movement, release, introspection
Kapha Earth + Water Follicular (Days 6–13) Building, nourishment, creativity
Pitta Fire + Water Ovulation & Luteal (Days 14–28) Transformation, intensity, heat

Understanding which dosha governs each phase reframes symptoms not as problems to suppress, but as signals to interpret and respond to.

Cyclical Living as Medicine

One of the most profound learnings was that the menstrual cycle mirrors the rhythm of nature itself. The infradian rhythm, which is the body's roughly 28-day biological clock, governs:

  • Hormone production
  • Metabolism
  • Brain chemistry
  • Immune function

When lifestyle, nutrition, and movement are aligned to the infradian rhythm rather than a flat week-to-week schedule, the body functions closer to its natural baseline.

Women facing hormonal problems are not often made aware of this, and that's the problem Ritu is trying to solve.

Where the Ayurvedic Data Comes From

The AI knowledge base was built by hand from primary Ayurvedic and homeopathic sources, then embedded directly into the application as a structured system prompt, which is large block of expert instructions that Claude AI reads before every single response.

  • Charaka Samhita — the foundational Ayurvedic text on internal medicine, written circa 600 BCE
  • Ashtanga Hridayam by Vagbhata — one of the three core classical Ayurvedic texts
  • Sushruta Samhita — classical Ayurvedic text on women's health and surgery
  • Classical homeopathic materia medica — Hahnemann, Kent, and Boericke's foundational works
  • Modern integrative women's health research — Dr. Aviva Romm, Dr. Sara Gottfried, and Alisa Vitti's infradian rhythm science from In the FLO

The knowledge base maps every herb, dietary recommendation, homeopathic remedy, and lifestyle practice to specific cycle phases, dosha types, climate conditions, hormonal conditions (PCOS, endometriosis, fibroids, thyroid), and seasonal patterns, which are all structured so the AI can retrieve the right guidance for each unique user.


How It Was Built

Ritu is a full-stack iOS application built solo from scratch, by yours truly. The architecture has three layers that work together:

SwiftUI iOS App  →  Python FastAPI Backend  →  Claude AI (Anthropic API)
                            ↕
                    Ayurvedic Knowledge Base

The AI Recommendation Engine

The core of the app is a personalized scoring system. When a user completes onboarding, every answer feeds into a dosha imbalance calculator that weights symptoms, conditions, climate, stress, and cycle patterns:

$$ \text{Dosha Score} = \sum_{i=1}^{n} w_i \cdot f(\text{symptom}_i, \text{condition}_i, \text{climate}_i) $$

Where:

  • \(w_i\) = weighted relevance of each reported health factor
  • \(f\) = a dosha alignment function mapping inputs to Vata, Pitta, or Kapha
  • The dosha with the highest score becomes the primary imbalance driving recommendations

Every AI response is then personalized using this profile. The AI advisor knows the user's current cycle phase, primary dosha imbalance, diet, stress level, climate, hormonal conditions, and days until next period — and uses all of it to give specific, actionable guidance rather than generic advice.

Cycle Prediction with Irregular Cycle Handling

Period predictions use statistical smoothing to handle irregular cycles. Given a history of period dates:

$$ \bar{L} = \frac{1}{n}\sum_{i=1}^{n} L_i \qquad \sigma_L = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(L_i - \bar{L})^2} $$

Where \(\bar{L}\) is the average cycle length and \(\sigma_L\) is the standard deviation. Higher standard deviation widens the prediction confidence window — instead of giving a false precise date to someone with an irregular cycle, Ritu gives an honest range.

Tech Stack

iOS App — SwiftUI Built with SwiftUI, the app handles onboarding, cycle tracking, period logging, an AI chat advisor, a color-coded calendar, and a complete Ayurvedic glossary. Every Ayurvedic term in the app has an expandable plain-language definition so users never encounter jargon without explanation.

Backend — Python + FastAPI A Python FastAPI server handles all AI communication, cycle calculations, dosha analysis, and period prediction. The server also runs a markdown stripping pipeline, since the AI tends to format responses with asterisks and headers. So, the backend strips all formatting before it reaches the app, ensuring clean plain text always that allows for optimal usability and conciseness for the user, always.

AI — Claude (Anthropic API) Claude claude-haiku-4-5-20251001 powers all four AI endpoints of this app: onboarding profile analysis, daily insights, cycle log tips, and the AI advisor chat. The Ayurvedic knowledge base lives as a structured system prompt that Claude reads with every request, grounding every response in classical Ayurvedic and homeopathic knowledge.


Challenges Faced

1. Getting the AI to Give Sufficient Responses

The single most persistent challenge was making the AI respond in clean, readable prose rather than formatted lists with headers and asterisks. The AI defaults to structured markdown regardless of instructions. The solution required three layers working simultaneously: explicit rules in the system prompt, formatting rules appended directly to every user message, a server-side markdown stripping function in Python, and a final client-side stripping function in Swift.

2. Bridging Ancient and Modern

Translating 5,000-year-old Ayurvedic concepts into something digestible for someone with no prior knowledge , without losing the depth or integrity of the tradition, was the hardest design challenge. The solution was to make education the first step of onboarding: before asking a single question, users swipe through illustrated cards explaining every cycle phase and every dosha in plain seasonal language.

3. The Gender Data Gap

Validating recommendations against Western clinical research was repeatedly hampered by the lack of female-specific studies. In many cases, the Ayurvedic framework offered more female-specific guidance than peer-reviewed Western literature. Unfortunately, this is just a systemic failure that urgently needs to be addressed, and also a part of what Ritu is trying to work around in the meantime.

4. Building Alone

This entire app, backend, iOS frontend, AI system, knowledge base, UI design, color system, onboarding flow, calendar, glossary , was built solo! It was alot of hard work :)

5. Personalization at Scale

No two bodies and no two cycles are the same. Building a recommendation system that feels genuinely personal, not generic, meant layering dosha type, cycle history, symptom patterns, climate, diet, stress, and known conditions together in a way that produces different outputs for different users. An Indian woman in hot humid Hyderabad in her luteal phase with cramps gets different guidance than a vegan woman in cold Toronto in her follicular phase. That specificity is the whole point.


What's Next

  • Supabase integration for persistent user accounts and cycle history
  • HealthKit integration, pulling cycle data from Apple Health
  • Push notifications for phase transitions ("Your follicular phase starts tomorrow — great time to plan something new")
  • Cycle history graphs showing patterns over time
  • Herbal remedy tracker
  • App Store submission and formatting for iphone
  • Hormonal history and menstrual cycle history pdf's made available to user for professional consultation

Built With

Share this project:

Updates