Skip to content

danielkosgei/IngreDiet

Repository files navigation

IngreDiet

A modern recipe management and meal planning Android application built with Jetpack Compose, featuring a rich collection of Kenyan cuisine recipes, personalized nutrition tracking, and intelligent shopping list management.

IngreDiet Logo

Platform SDK Kotlin Compose Status License


Screenshots

Home Recipe Detail Meal Planner Shopping List

Home · Recipe Detail · Meal Planner · Shopping List

Nutrition Summary Recipe Finder Cooking Mode

Nutrition Summary · Recipe Finder · Cooking Mode


Architecture

IngreDiet follows MVVM (Model-View-ViewModel) architecture with the Repository Pattern, ensuring a clean separation of concerns and testability.

┌─────────────────────────────────────────────────────────────────┐
│                         Presentation Layer                      │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────────┐ │
│  │   Screens   │  │  ViewModels │  │  Compose UI Components  │ │
│  │ (Composable)│←→│   (State)   │  │    (Reusable Views)     │ │
│  └─────────────┘  └──────┬──────┘  └─────────────────────────┘ │
└──────────────────────────┼──────────────────────────────────────┘
                           │
┌──────────────────────────┼──────────────────────────────────────┐
│                     Domain Layer                                 │
│  ┌───────────────────────┴────────────────────────────────────┐ │
│  │                     Repositories                            │ │
│  │  • RecipeRepository        • ProfileRepository              │ │
│  │  • FavoritesRepository     • MealPlanRepository             │ │
│  │  • ShoppingListRepository  • NutritionRepository            │ │
│  └───────────────────────┬────────────────────────────────────┘ │
└──────────────────────────┼──────────────────────────────────────┘
                           │
┌──────────────────────────┼──────────────────────────────────────┐
│                       Data Layer                                 │
│  ┌───────────────┐  ┌─────────────────┐  ┌──────────────────┐  │
│  │ Network APIs  │  │  Local Storage  │  │  Cache Services  │  │
│  │  (Supabase)   │  │(SharedPrefs/...)│  │(RecipeCacheServ) │  │
│  └───────────────┘  └─────────────────┘  └──────────────────┘  │
└─────────────────────────────────────────────────────────────────┘

Project Structure

app/src/main/java/com/thenewkenya/ingrediet/
├── IngreDietApplication.kt      # Application class with DI setup
├── MainActivity.kt              # Single Activity with Navigation
│
├── data/
│   ├── model/                   # Data classes
│   │   ├── Recipe.kt           # Recipe, DetailedRecipe, NutritionFacts
│   │   ├── KenyanRecipe.kt     # Kenyan cuisine data models
│   │   ├── Profile.kt          # User profile data
│   │   ├── UserMealPlan.kt     # Meal planning models
│   │   └── ...
│   │
│   ├── network/                 # Network layer
│   │   ├── SupabaseClient.kt   # Supabase configuration
│   │   ├── AuthManager.kt      # Authentication handling
│   │   ├── SessionManager.kt   # Token persistence
│   │   ├── CacheManager.kt     # Caching strategies
│   │   └── ...
│   │
│   └── repository/              # Repository pattern
│       ├── RecipeRepository.kt
│       ├── ProfileRepository.kt
│       ├── FavoritesRepository.kt
│       ├── MealPlanRepository.kt
│       ├── ShoppingListRepository.kt
│       └── NutritionRepository.kt
│
├── feature/                     # Feature modules
│   ├── authentication/          # Login, Register, Password Reset
│   ├── recipe/                  # Recipe browsing & details
│   ├── kenyan/                  # Kenyan cuisine section
│   ├── favorites/               # Saved recipes
│   ├── mealplanner/             # Weekly meal planning
│   ├── shopping/                # Shopping list management
│   ├── search/                  # Recipe & ingredient search
│   ├── profile/                 # User settings & profile
│   ├── create/                  # Recipe creation
│   ├── onboarding/              # First-time user experience
│   ├── notifications/           # Notification management
│   ├── security/                # App lock features
│   └── ...
│
└── ui/theme/                    # Material 3 theming
    ├── Color.kt                # Nutritional color palette
    ├── Theme.kt                # Light/Dark theme config
    └── Type.kt                 # Typography definitions

Tech Stack

Android & UI

Technology Version Purpose
Kotlin 2.0.0 Primary language
Jetpack Compose 2024.04 BOM Declarative UI framework
Material 3 1.2.1 Design system
Navigation Compose 2.8.8 Screen navigation
Coil 3 3.0.0-alpha04 Image loading

Backend & Data

Technology Version Purpose
Supabase 3.1.1 BOM Backend-as-a-Service
Ktor 3.0.3 HTTP client (OkHttp engine)
Kotlinx Serialization 1.6.2 JSON parsing
PostgreSQL Database (via Supabase)

Authentication

Technology Purpose
Supabase Auth Email/password authentication
Android Credentials Google Sign-In integration
Biometric API Fingerprint/Face unlock

Utilities

Technology Purpose
Kotlin Coroutines 1.7.3
Kotlin Flow Reactive data streams
Desugaring Java 8+ APIs on older Android

Getting Started

1. Clone the Repository

git clone https://github.com/thenewkenya/IngreDiet.git
cd IngreDiet

2. Configure API Keys

Create an apikeys.properties file in the project root:

SUPABASE_ANON_KEY=your_supabase_anon_key_here
SUPABASE_URL=https://your-project.supabase.co

⚠️ Important: Never commit apikeys.properties to version control. It's already in .gitignore.

3. Supabase Setup (Optional - for Development)

If you want to run your own Supabase instance:

# Install Supabase CLI
npm install -g supabase

# Start local Supabase
cd supabase
supabase start

# Apply migrations
supabase db reset

4. Build and Run

Open the project in Android Studio and:

  1. Click "Sync Project with Gradle Files"
  2. Select a device or emulator (API 24+)
  3. Click Run

Or via command line:

./gradlew assembleDebug
./gradlew installDebug

Database Schema

IngreDiet uses PostgreSQL via Supabase with Row Level Security (RLS) enabled on all tables.

Core Tables

┌─────────────────┐     ┌─────────────────────┐     ┌─────────────────┐
│    profiles     │     │    user_favorites   │     │  user_meal_plans│
├─────────────────┤     ├─────────────────────┤     ├─────────────────┤
│ id (UUID, PK)   │──┐  │ id (SERIAL, PK)     │     │ id (UUID, PK)   │
│ email           │  │  │ user_id (FK)────────┼──┐  │ user_id (FK)    │
│ first_name      │  │  │ recipe_id (FK)      │  │  │ day_of_week     │
│ last_name       │  │  │ created_at          │  │  │ meal_type       │
│ dietary_pref[]  │  │  └─────────────────────┘  │  │ recipe_id       │
│ allergies[]     │  │                           │  │ meal_name       │
│ calorie_target  │  └───────────────────────────┘  │ calories        │
│ weight_goal     │                                 │ time            │
└─────────────────┘                                 └─────────────────┘
         │
         └──────────────────────────┐
                                    ▼
┌─────────────────┐     ┌─────────────────────┐
│ shopping_items  │     │  kenyan_recipes     │
├─────────────────┤     ├─────────────────────┤
│ id (UUID, PK)   │     │ id (SERIAL, PK)     │──┬──────────────────┐
│ user_id (FK)    │     │ name                │  │                  │
│ name            │     │ description         │  │                  │
│ category        │     │ prep_time/cook_time │  ▼                  ▼
│ is_checked      │     │ difficulty          │ ingredients    instructions
└─────────────────┘     │ region              │   table           table
                        │ calories            │       ▲
                        └─────────────────────┘       │
                                                   tags table

Edge Functions

The Supabase backend includes serverless functions:

Function Description
getRecipes Fetch paginated recipe list
getRecipeById Get single recipe details
getRecipeWithDetails Full recipe with ingredients/instructions
getKenyanRecipes Kenyan cuisine specific queries
createRecipe Add new user recipe
updateRecipe Modify existing recipe
deleteRecipe Remove recipe

Permissions

IngreDiet requires the following Android permissions:

Permission Reason
INTERNET Network requests to Supabase API
ACCESS_NETWORK_STATE Check connectivity status
POST_NOTIFICATIONS Meal reminders (Android 13+)
SCHEDULE_EXACT_ALARM Precise meal time notifications
WAKE_LOCK Ensure alarms trigger reliably
USE_BIOMETRIC Fingerprint/Face authentication

Testing

Run Unit Tests

./gradlew test

Run Instrumented Tests

./gradlew connectedAndroidTest

Test Structure

app/src/
├── test/                    # Unit tests
│   └── java/
└── androidTest/             # Instrumented tests
    └── java/

Build Variants

Variant Purpose
debug Development build with debugging enabled
release Production build with ProGuard/R8 optimization
# Build debug APK
./gradlew assembleDebug

# Build release APK (requires signing config)
./gradlew assembleRelease

Roadmap

Current Focus (Alpha)

  • Recipe browser with search and filtering
  • Recipe detail view with ingredients and instructions
  • Favorites system
  • Basic shopping list management
  • User authentication (email + biometric)
  • Kenyan recipes collection
  • Offline mode with local caching
  • Meal planner calendar polish
  • Shopping list generation from meal plans

Planned Features

  • Recipe recommendations based on ingredients
  • Detailed nutritional breakdown visualization
  • Serving size adjuster with ingredient scaling
  • Rating and review system
  • Cooking timers integrated with recipe steps
  • "My Pantry" feature with expiration tracking
  • Social sharing functionality
  • Integration with health tracking apps

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.


Contact

Daniel Togeydanieltogey@proton.me

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published