This is a SwiftUI app that allows users to manage their personal recipes. Users can sign up and log in to their accounts to view, add, and see the details of their recipes. The app uses Firebase for authentication, storing recipe data in Firestore, and saving recipe images to Firebase Storage.
- User Authentication: Secure sign-up and login functionality implemented with Firebase Authentication.
- Recipe Management: Users can create new recipes by providing a name, preparation time, cooking instructions, and an image.
- Firebase Backend: The app is powered by Firebase, using Firestore as the database for recipe information and Firebase Storage for image hosting.
- Asynchronous Operations: Modern concurrency with
async/awaitis used for all network requests to Firebase, ensuring a smooth and responsive user experience. - SwiftUI Views: The user interface is built with SwiftUI, featuring views for authentication, a main recipe gallery, detailed recipe views, and a form for adding new recipes.
- Image Handling: Users can upload recipe images from their photo library using
PhotosPickeror take a new photo using the camera.
- Firebase Integration: I learned how to set up and use Firebase services in a SwiftUI application, including Firebase Authentication for user management, Firestore for data persistence, and Firebase Storage for file uploads.
- Asynchronous Programming with
async/await: I utilizedasync/awaitto handle all asynchronous tasks, such as signing users in, fetching recipe data, and uploading images, which simplifies the code and improves readability. - SwiftUI and MVVM: I applied the MVVM (Model-View-ViewModel) architecture to structure the app, separating the UI logic in Views from the business logic in ViewModels. I used
@StateObjectand@Observableto manage the state and data flow. - SwiftUI Views and Components: I gained experience in building a variety of SwiftUI views and creating reusable UI components, such as a
LazyVGridfor displaying recipes, custom button styles, and loading indicators. - Image Picking and Handling: I implemented image selection from the user's photo library with
PhotosPickerand created aUIViewControllerRepresentablewrapper forUIImagePickerControllerto provide camera functionality.
- To run this app on your device, you need to create a Firebase project and add your own
GoogleService-Info.plistfile to the project. - Make sure to enable Firebase Authentication (Email/Password), Firestore, and Firebase Storage in your Firebase project console.