Skip to content

Latest commit

Β 

History

History
119 lines (91 loc) Β· 3.22 KB

File metadata and controls

119 lines (91 loc) Β· 3.22 KB

CalTrack πŸ›

An Indian food calorie tracking app powered by AI. Scan food images, describe meals, or manually log your calorie intake.

Features

  • πŸ“· Scan Food - Take a photo of your meal for instant calorie analysis
  • ✍️ Describe Food - Type a description and get calorie estimates
  • βž• Manual Entry - Add custom food items manually
  • πŸ“Š Daily Tracking - View your daily calorie progress
  • πŸ“œ History - Browse your food log by date
  • 🎯 Personalized Goals - Set your own daily calorie target

Tech Stack

  • React Native with Expo
  • TypeScript
  • React Native Paper (Material Design 3)
  • SQLite for local storage
  • Portkey AI Gateway for LLM routing

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Expo CLI (npm install -g expo-cli)
  • Expo Go app on your phone (for testing)

Setup

  1. Clone the repository

    git clone https://github.com/aritroCoder/caltrack.git
    cd caltrack
  2. Install dependencies

    npm install
  3. Configure environment variables

    Create a .env file in the project root:

    EXPO_PUBLIC_PORTKEY_API_KEY=your_portkey_api_key_here

    Get your Portkey API key from portkey.ai

  4. Start the development server

    npx expo start
  5. Run on your device

    • Scan the QR code with Expo Go (Android) or Camera app (iOS)
    • Or press a to open on Android emulator
    • Or press w to open in web browser

Building APK

Option 1: EAS Build (Recommended)

  1. Login to Expo

    eas login
  2. Add your API key to EAS (one-time setup)

    eas env:create --name EXPO_PUBLIC_PORTKEY_API_KEY --value "your_api_key" --environment production --visibility sensitive
  3. Build the APK

    eas build --platform android --profile production

Option 2: Local Build (Requires Android SDK)

npx expo run:android --variant release

Project Structure

caltrack/
β”œβ”€β”€ App.tsx                 # Main app entry point
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ config.ts       # App configuration
β”‚   β”‚   └── prompts.ts      # AI prompt templates
β”‚   β”œβ”€β”€ screens/
β”‚   β”‚   β”œβ”€β”€ HomeScreen.tsx      # Dashboard
β”‚   β”‚   β”œβ”€β”€ ResultScreen.tsx    # Analysis results
β”‚   β”‚   β”œβ”€β”€ HistoryScreen.tsx   # Food history
β”‚   β”‚   β”œβ”€β”€ TextInputScreen.tsx # Text-based input
β”‚   β”‚   β”œβ”€β”€ ManualEntryScreen.tsx # Manual food entry
β”‚   β”‚   β”œβ”€β”€ OnboardingScreen.tsx  # First-run setup
β”‚   β”‚   └── SettingsScreen.tsx    # User settings
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ geminiService.ts    # AI API integration
β”‚   β”‚   └── databaseService.ts  # SQLite operations
β”‚   β”œβ”€β”€ store/
β”‚   β”‚   └── appStore.ts     # Zustand state management
β”‚   └── theme/
β”‚       └── index.ts        # App theme configuration
└── .env                    # Environment variables

License

MIT

Developer

Aritra Bhaduri