How eng-muhamad-hasan/fruit_shop works
Fruit Shop is a Flutter fruit-shopping app. Its main user journey is sign-in, product discovery, cart management, then address/shipping/payment checkout and order handling. Separate branches provide an AI shopping assistant and profile preferences; Firebase-backed authentication and data services support app features. The README also describes admin management, favorites, and Supabase Storage, but the tree provides no dedicated admin or storage implementation, so those capabilities are not expanded into speculative flows. Dart feature implementations were not sampled, so arrows reflect documented responsibilities and named boundaries rather than verified method calls.
Main entry points: presentation Home and profile · order_cubit.dart Checkout flow · firebase_firestore_service.dart Firestore service · main.dart Flutter app
Components 22
App entry
- Flutter app
lib/main.dart - Route selection
lib/core/functions/on_generate_routes.dart
Shopping
- Home and profile
lib/feature/home/presentation - Product discovery
lib/feature/home/presentation/cubit/products_cubit/products_cubit.dart - Cart management
lib/feature/home/presentation/cubit/cart/cart_cubit.dart - Checkout flow
lib/feature/checkout/presentation/cubit/order/order_cubit.dart
Account
- Sign in / sign up
lib/feature/auth/presentation - Authentication data
lib/feature/auth/data/repos/auth_repo_impl.dart - Language and theme
lib/feature/home/presentation/cubit/profile-cubit
Smart assistant
- AI chat
lib/feature/ai_chat/presentation - Chat state
lib/feature/ai_chat/presentation/cubit/ai_chat/ai_chat_cubit.dart
Services
- Firebase auth
lib/core/services/firebase/firebase_auth_service.dart - Product repository
lib/core/repos/products_repo/products_repo_impl.dart - Firestore service
lib/core/services/firebase/firebase_firestore_service.dart - Order repository
lib/core/repos/orders_repo/orders_repo_impl.dart - PayPal integration
lib/core/services/paypal_service.dart - Google Generative AI
- Cloud messaging
lib/core/services/firebase/firebase_cloud_messaging_service.dart
Other components
- Shopper
- Firebase
- Product data
- Payment provider
Connections 22
- Shopper → Flutter app: opens app
- Flutter app → Route selection: selects routes
- Shopper → Sign in / sign up: signs in
- Sign in / sign up → Authentication data: requests auth
- Authentication data → Firebase auth: uses auth
- Firebase auth → Firebase: authenticates
- Shopper → Home and profile: browses
- Home and profile → Product discovery: opens catalog
- Product discovery → Product repository: loads products
- Product repository → Firestore service: accesses data
- Firestore service → Product data: reads catalog
- Shopper → Cart management: manages cart
- Shopper → Checkout flow: starts checkout
- Checkout flow → PayPal integration: initiates payment
- PayPal integration → Payment provider: processes payment
- Checkout flow → Order repository: submits order
- Order repository → Firestore service: persists orders
- Shopper → AI chat: asks assistant
- AI chat → Chat state: sends messages
- Chat state → Google Generative AI: requests suggestions
- Home and profile → Language and theme: changes settings
- Cloud messaging → Firebase: uses messaging