How valterandremachado/recipecraze works
Main Components
• UI Layer (View):
– Derived from the “Recipe Craze/MyApp” and “Recipe Craze/View” folders.
– Contains screen components for Authentication (LoginVC, SignupVC, ForgotPasswordVC, OnboardingVC), Home (HomeVC, FoodInfoVC, OnScreenStepsVC), Categories (CategoryVC, CategoryDetailsVC), Favorites (FavoriteVC), and Search (SearchVC).
• ViewModel Layer:
– Located in the “Recipe Craze/ViewModel” directory.
– Contains specific view models like CategoryViewModel, RecipeViewModel, UserAuthViewModel, and UserRegistrationViewModel that mediate between the UI and data models.
• Model / Data Layer:
– Found primarily in the “Recipe Craze/Model” folder.
– Holds entities like Recipe, CategoryModel, FavoritedRecipe, and also service classes such as RecipeService and CategoryService for fetching/parsing data from the JSON API (using URLSession).
• Persistence Layer:
– Two subparts:
° Core Data: Managed in “Recipe Craze/CoreData” and extensions/models like FavoritedRecipeToCD, PersistenceManager.swift, and the CoreDataModel.
° Realm Database: Indicated under “Recipe Craze/RealDatabase” including RealmService and RecipeRealmObject.
• External Services & Networking:
– Networking components are implied in the Model layer (JSON API parsing via URLSession and usage of JSONSerialization).
– Firebase services (for Auth and Database, as mentioned in the README) need to be represented as external services.
• Utilities & Helpers:
– Utilities in “Recipe Craze/utils” (e.g., Extensions, SpeechService, custom UI components, feedback generators) serve as supporting components across the project.
Relationships and Interactions
• UI components (Views and View Controllers) interact with their corresponding ViewModels.
• The ViewModels handle business logic and coordinate with the Models/Services:
– They request data from the network using URLSession.
– They handle persistence by communicating with the Core Data and Realm layers.
• The Models also interact directly with the external services like Firebase for authentication and real-time database updates.
• Utility classes provide cross-cutting support (e.g., UI feedback, custom behaviors) to both the UI and business logic layers.
Architectural Patterns and Design Principles
• The MVVM Pattern: Clearly separate the View (UI), ViewModels (presentation logic), and Models (data and business logic).
• Data Persistence Separation: Highlight the use of Core Data for storing favorited recipes along with an alternative Realm-based persistence layer.
• External Integration: Show how external services (Firebase for auth and data, JSON API via URLSession) integrate with the core application.
Including Relevant Technologies, Frameworks, and Libraries
• UIKit is the framework used for the UI layer.
• Core Data and Realm represent local data persistence.
• Firebase (Auth and Database) is integrated for user management and remote data service.
• The project uses URLSession for network calls and JSONSerialization for API data parsing.