Nirvan - AI Life Coach

Minimalist AI Coaching in Your Pocket

Technical Documentation

RevenueCat Shipyard 2026 Submission

Developer: Ramkumar Gudivada

Creator Brief: Simon @BetterCreating

Submission Date: February 10, 2026

πŸ’‘ Simon's Vision

"Simon's audience loves productivity, great design, and building systems β€” and he wants to bring coaching to more people. Create a clean, minimal mobile app where users can browse, create, and share AI coaches, add personal context/values, and start chatting immediately. No complex setup, just guidance at the right moment."

Table of Contents

  1. High-Level Architecture
  2. Technology Stack
  3. RevenueCat Integration
  4. AI Integration
  5. Data Flow
  6. Security & Privacy
  7. CI/CD Pipeline
  8. Performance Considerations

1. High-Level Architecture

System Overview

Nirvan AI Architecture

Component Architecture

App Structure:

app/
β”œβ”€β”€ (tabs)/              # Main tab navigation
β”‚   β”œβ”€β”€ index.tsx        # Home/Coach Selection
β”‚   β”œβ”€β”€ chat.tsx         # Chat Interface
β”‚   └── settings.tsx     # Settings & Account
β”œβ”€β”€ _layout.tsx          # Root layout with providers
β”œβ”€β”€ onboarding.tsx       # First-time user flow
└── paywall.tsx          # Subscription screen

components/
β”œβ”€β”€ CoachCard.tsx        # Coach selection cards
β”œβ”€β”€ ChatBubble.tsx       # Message display
β”œβ”€β”€ PremiumBanner.tsx    # Upgrade prompts
└── LoadingSpinner.tsx   # Loading states

contexts/
β”œβ”€β”€ ChatContext.tsx      # Chat state management
β”œβ”€β”€ PremiumContext.tsx   # Subscription state
└── CoachContext.tsx     # Active coach tracking

utils/
β”œβ”€β”€ ai-service.ts        # OpenAI integration
β”œβ”€β”€ revenuecat.ts        # RevenueCat SDK wrapper
└── storage.ts           # AsyncStorage helpers

2. Technology Stack

Frontend Framework

UI/UX - Minimalist Design Philosophy

Design Principles:

Backend Services

Development Tools

3. RevenueCat Integration

Configuration

API Key: appl_ooxzpzwxHOQNkUCjODAkqnLDbjJ

Entitlement ID: premium

Bundle ID: com.ramkumar.gudivada.nirvanaicoachv2

Products Configuration

App Store Connect Products

Property Value
Product ID monthly_premium
Type Auto-Renewable Subscription
Duration 1 Month
Price $9.99 USD
Subscription Group Premium Subscriptions
Status Ready to Submit

RevenueCat Offerings

Offering ID: default (Current)
Packages:
  - $rc_monthly β†’ monthly_premium
  - $rc_annual β†’ yearly_premium (future)
  - $rc_lifetime β†’ lifetime_premium (future)

Implementation Details

1. SDK Initialization

// utils/revenuecat.ts
import Purchases from 'react-native-purchases';

const API_KEYS = {
    ios: 'appl_ooxzpzwxHOQNkUCjODAkqnLDbjJ',
    android: 'goog_YOUR_KEY_HERE',
};

export class RevenueCatService {
    static async init() {
        // Safety check for Expo Go
        if (Constants.executionEnvironment === 'storeClient') {
            console.log('[RevenueCat] Running in Expo Go - Mock Mode');
            this.mockPro = true;
            return;
        }

        try {
            if (Platform.OS === 'ios') {
                await Purchases.configure({ apiKey: API_KEYS.ios });
            }
            if (__DEV__) {
                await Purchases.setLogLevel(Purchases.LOG_LEVEL.DEBUG);
            }
            console.log('RevenueCat Initialized');
        } catch (e) {
            console.warn('RevenueCat Init Failed:', e);
        }
    }
}

2. Purchase Flow

static async purchasePackage(pkg: PurchasesPackage) {
    try {
        const { customerInfo } = await Purchases.purchasePackage(pkg);
        return { success: true, customerInfo };
    } catch (e: any) {
        if (!e.userCancelled) {
            console.error('Purchase error', e);
            return { success: false, error: e.message };
        } else {
            return { success: false, userCancelled: true };
        }
    }
}

3. Checking Premium Status

static async isPro(): Promise<boolean> {
    if (this.mockPro) return true; // Mock for testing

    try {
        const customerInfo = await this.getCustomerInfo();
        return customerInfo?.entitlements.active['premium'] !== undefined;
    } catch (e) {
        console.error("Failed to check pro status", e);
        return false;
    }
}

Monetization Flow

User Journey:

1. App Launch β†’ RevenueCat.init()
2. User selects coach β†’ Check isPro()
3. Free tier: 5 messages per coach
4. Message limit reached β†’ Show paywall
5. User taps "Upgrade" β†’ getOfferings()
6. Display packages β†’ User selects plan
7. Tap "Subscribe" β†’ purchasePackage()
8. Apple processes payment
9. RevenueCat validates receipt
10. Premium entitlement granted
11. User gets unlimited access

4. AI Integration

Model: GPT-4

API Version: v1

Max Tokens: 500 per response

Temperature: 0.7 (balanced creativity)

Implementation

// utils/ai-service.ts
import OpenAI from 'openai';

const OPENAI_API_KEY = process.env.EXPO_PUBLIC_OPENAI_API_KEY || '';

const openai = new OpenAI({
    apiKey: OPENAI_API_KEY,
});

export async function sendMessage(
    coachType: string,
    messages: Message[]
): Promise<string> {
    try {
        const systemPrompt = getCoachSystemPrompt(coachType);
        
        const completion = await openai.chat.completions.create({
            model: 'gpt-4',
            messages: [
                { role: 'system', content: systemPrompt },
                ...messages.map(m => ({
                    role: m.role,
                    content: m.content
                }))
            ],
            max_tokens: 500,
            temperature: 0.7,
        });

        return completion.choices[0].message.content || 'No response';
    } catch (error) {
        console.error('OpenAI API Error:', error);
        throw error;
    }
}

Coach Personas

Each coach has a specialized system prompt:

Coach Specialization
Fitness Coach Certified personal trainer and nutritionist providing evidence-based fitness advice, workout plans, and nutrition guidance
Career Coach Experienced career counselor specializing in tech careers, resume writing, interview prep, and salary negotiation
Mindfulness Coach Meditation instructor and stress management expert guiding mindfulness practices and mental wellness
Relationship Coach Licensed relationship therapist providing advice on communication, conflict resolution, and healthy relationships
Finance Coach Certified financial planner helping with budgeting, saving, investing, and financial goal setting
Productivity Coach Productivity expert specializing in time management, workflow optimization, and habit building

5. Data Flow

Chat Message Flow

User Types Message ↓ Check Message Count ↓ [Limit Reached] β†’ Show Paywall [Within Limit] β†’ Continue ↓ Send to OpenAI API ↓ Receive AI Response ↓ Save to AsyncStorage ↓ Update UI ↓ Increment Message Count

Purchase Flow

User Taps "Upgrade" ↓ Fetch Offerings from RevenueCat ↓ Display Packages ↓ User Selects Package ↓ Initiate Purchase ↓ Apple Processes Payment ↓ RevenueCat Validates Receipt ↓ Grant Premium Entitlement ↓ Update App State ↓ Unlock All Features

6. Security & Privacy

API Key Management

OpenAI API Key:

RevenueCat API Key:

Privacy Principles

7. CI/CD Pipeline

GitHub Actions Workflow

Trigger: Manual workflow dispatch

Runner: macOS-latest

Build Time: ~24 minutes

name: Build iOS App

on:
  workflow_dispatch:

jobs:
  build:
    runs-on: macos-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Node.js 20.x
        uses: actions/setup-node@v4
        with:
          node-version: 20.x
          cache: npm

      - name: Setup EAS
        uses: expo/expo-github-action@v8
        with:
          eas-version: latest
          token: ${{ secrets.EXPO_TOKEN }}

      - name: Install dependencies
        run: npm install

      - name: Build iOS App
        run: eas build --platform ios --profile production
        env:
          EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
          EXPO_PUBLIC_OPENAI_API_KEY: ${{ secrets.EXPO_PUBLIC_OPENAI_API_KEY }}

      - name: Submit to TestFlight
        run: eas submit --platform ios --profile production
        env:
          EXPO_APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.EXPO_APPLE_APP_SPECIFIC_PASSWORD }}

8. Performance Considerations

Optimization Strategies

Target Metrics

Metric Target
App launch time < 2 seconds
Chat response time < 3 seconds
Purchase flow < 5 seconds
Memory usage < 150 MB

Future Enhancements

Phase 1 (Next 30 Days)

Phase 2 (60-90 Days)

Phase 3 (6 Months)