Welcome to the Food Change Mood App! This app allows users to interact with various meal-related features. The application uses meal data from a CSV file and provides multiple functionalities related to meal suggestions, searching, games, and much more. The app also leverages Koin for Dependency Injection to manage dependencies across different components.
The app includes the following main categories and features:
These are the top-level categories that appear when the app starts in the CLI. Each category will allow you to choose specific actions or functionalities.
- Meal Suggestions 🍲
- Meal Search 🔍
- Meal Games 🎮
- Meal Viewing 🍴
After selecting a category, you will be presented with more specific features. Here's a breakdown of what each category offers:
- Sweets with No Eggs 🍩: Suggest one sweet that contains no eggs for users who are allergic to eggs. Users can like or dislike the suggestion to get a new one.
- Keto Diet Meal Helper 🥗: Suggest keto-friendly meals based on nutritional information.
- I Love Potato 🥔: Suggest meals that contain potatoes.
- So Thin Problem 🍽️: Suggest meals with more than 700 calories.
- Large Group Italian Meal Helper 🇮🇹 :Suggest original Italian dishes suitable for large groups — ideal for friends traveling together.
- Easy Food Suggestion 🎯 :this feature suggests meals that are easy to prepare.
- Search Meals by Name: Search for meals based on their name. It includes fuzzy search functionality to handle typos.
- Search Foods by Date 📅: Search meals by the date entered by user.
- Gym Helper 💪: Suggest meals based on desired calorie and protein intake.
- Explore Other Countries' Food Culture 🌍 :Search for meals from a specific country by name and return up to 20 random matching meals.
- Guess the Meal Preparation Time ⏳: Guess how long it takes to prepare a random meal. You have 3 attempts to get it right.
- Ingredient Game 🧩: A fun game where the user guesses the correct ingredient in a meal.
- Suggest a Healthy Meal: Get meal suggestions based on various criteria (e.g., calories, fat content, etc.).
- Seafood Meals Sorted by Protein Content 🦞: Lists seafood meals sorted by protein content.
- MealRepository 📦: Interface that defines methods for accessing meal data.
- CsvMealRepository 📊: Implementation of
MealRepositorythat reads and parses meal data from a CSV file. - FoodConsoleUi 🖥️: Provides the user interface, allowing interaction with the app's features.
- GamesMealsUseCases 🎮: Handles the game logic where users guess meal preparation times.
- ViewMealsUseCases 🍴: Manages viewing details of meals.
- SuggestionMealsUseCases 🍽️: Manages meal suggestions.
- SearchMealsUseCases 🔍: Handles meal search logic.
The app retrieves meal data from a CSV file and provides an efficient caching mechanism using Kotlin's lazy initialization. The CsvMealRepository class handles reading the CSV file and parsing it into a list of Meal objects.
Koin is a lightweight dependency injection framework for Kotlin. It allows us to manage the application's dependencies in a simple, easy-to-understand manner, reducing the boilerplate code associated with traditional dependency injection.
Koin simplifies the process of managing dependencies in Kotlin-based applications. It is particularly useful for:
- Decoupling components: Dependencies are injected rather than manually created, which makes the components independent of one another.
- Easy to set up: Unlike other dependency injection frameworks, Koin doesn't require annotation processors or complex setup steps.
- Lightweight: Koin's size and learning curve are minimal, making it a great choice for small and medium-sized Kotlin applications.
In this project, Koin is used to manage dependencies between the different components, such as the user interface, business logic, and data handling. Koin makes it easy to inject dependencies without having to manually create them in each class.
The app uses the following Koin modules to manage the dependencies:
- AppModule 🗂️: This is the main module that aggregates all the other modules and provides dependency injection throughout the app.
- Data Module 🗂️: Handles the creation of the repository and services responsible for meal data fetching and parsing.
- Logic Module 🧠: Handles the use cases and business logic, like meal suggestions, searching, and games.
- UI Module 🖥️: Provides the user interface components (like the
FoodConsoleUiwhich is responsible for displaying the app's features to the user).