Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Sign in to like and favorite skills
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a SwiftUI-based iOS ordering platform app using Firebase as the backend. The app allows users to browse menu items, add them to a cart, and manage their orders.
Cmd+B in Xcode or use Product → BuildCmd+R in Xcode or use Product → RunCmd+Shift+K in XcodeCmd+U in Xcode or use Product → TestThe app follows MVVM architecture using SwiftUI's
@Observable macro:
MenuItem and User structs in /Models//Views/ folder@Observable classes in /ViewModel/ folder/Components/The app uses SwiftUI's environment system for shared state:
CartViewViewModel is injected as environment object in TestingOwnOrderingPlatformApp.swift@Environment(CartViewViewModel.self) var cartViewModelMainViewViewModel handles authentication state using Firebase Auth listenersLoginView when not authenticated, TabView when authenticatedinit() and cleaned up in stopHandler()menuItems collection: Contains all menu itemsusers/{userId}/cart/current document: Stores user's cart itemsMainView (auth gate) ├── LoginView (unauthenticated) └── TabView (authenticated) ├── MenuView (Order tab) ├── CartView (Cart tab) └── ProfileView (Profile tab)
Cart items are stored as:
[String: Int] where key is menuItemId and value is quantity
/Views/ folder/ViewModel/ folder using @ObservableFirebaseAuth, FirebaseFirestore)[ViewName]View and [ViewName]ViewModel@FirestoreQuery for real-time data fetching (see MenuView)Firestore.firestore() instance for write operationsAuth.auth().currentUser?.uidsetData(_:) for dictionaries, setData(from:) for Codable objects@Environment(CartViewViewModel.self) var cartViewModelcartViewModel.addItemsToCart(menuItemId:count:)The project uses Swift Package Manager with these key dependencies:
GoogleService-Info.plist is properly added to the projectAppDelegate.application(_:didFinishLaunchingWithOptions:)menuItem.id ?? menuItem.name as fallback identifier for cart operationsupdateCartItemsToFirebase() after local updates