# nguyennhan6704/ffshop architecture

> Architecture diagram of the GitHub repository nguyennhan6704/ffshop, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nguyennhan6704/ffshop
- Repository: https://github.com/nguyennhan6704/ffshop

## Overview

FastFoodShop is a React Native shopping app. The main journey is account access, product discovery and detail, cart management, COD checkout, and order history/detail; profile editing and favorites are supporting capabilities. The graph follows the documented MVVM structure. Several view/viewmodel relationships are backed by the SOURCE INDEX or README rather than sampled call sites, so those edges cite that evidence; Firebase is shown as an external backend.

Main entry points: [`src/navigation/MainNavigator.js`](https://github.com/nguyennhan6704/ffshop/blob/main/src/navigation/MainNavigator.js) (Main navigation), [`src/viewmodels/AuthViewModels.js`](https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/AuthViewModels.js) (Auth logic), [`src/viewmodels/ProductViewModel.js`](https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/ProductViewModel.js) (Product logic), [`firebaseConfig.js`](https://github.com/nguyennhan6704/ffshop/blob/main/firebaseConfig.js) (Firebase client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app_entry["App entry<br/>[App.js]"]
  node_navigation["Main navigation<br/>[MainNavigator.js]"]
end

subgraph group_shopping["Shopping experience"]
  node_home["Home<br/>[HomeScreen.js]"]
  node_search["Product search<br/>[SearchScreen.js]"]
  node_detail["Product detail"]
  node_favorites["Favorites<br/>[FavoriteScreen.js]"]
  node_cart_screen["Cart<br/>[CartScreen.js]"]
  node_checkout["COD checkout<br/>[CheckoutScreen.js]"]
  node_orders["Order history<br/>[OrderScreen.js]"]
  node_order_detail["Order detail"]
end

subgraph group_account["Account and identity"]
  node_auth_screen["Authentication<br/>[AuthScreen.js]"]
  node_profile["Profile<br/>[ProfileScreen.js]"]
  node_information["Personal information"]
end

subgraph group_data["Viewmodels and data"]
  node_auth_vm["Auth logic<br/>[AuthViewModels.js]"]
  node_product_vm["Product logic"]
  node_cart_vm["Cart logic<br/>[CartViewModels.js]"]
  node_order_vm["Order logic<br/>[OrderViewModels.js]"]
  node_product_model["Product model<br/>[Product.js]"]
  node_user_model["User model<br/>[User.js]"]
  node_order_model["Order model<br/>[Order.js]"]
  node_firebase_config["Firebase client<br/>[firebaseConfig.js]"]
  node_cloudinary_service["Avatar upload service"]
end

node_customer(("Shopper"))
node_firebase[("Firebase backend")]
node_cloudinary{{"Cloudinary"}}

node_customer -->|"opens app"| node_app_entry
node_app_entry -->|"shows signed out"| node_auth_screen
node_app_entry -->|"shows signed in"| node_navigation
node_app_entry -->|"loads account"| node_auth_vm
node_auth_screen -->|"authenticates"| node_auth_vm
node_navigation -->|"routes to"| node_home
node_navigation -->|"routes to"| node_search
node_navigation -->|"routes to"| node_cart_screen
node_navigation -->|"routes to"| node_profile
node_navigation -->|"routes to"| node_detail
node_navigation -->|"routes to"| node_favorites
node_navigation -->|"routes to"| node_checkout
node_navigation -->|"routes to"| node_orders
node_navigation -->|"routes to"| node_order_detail
node_navigation -->|"routes to"| node_information
node_home -->|"loads products"| node_product_vm
node_search -->|"loads and searches"| node_product_vm
node_detail -->|"loads product"| node_product_vm
node_favorites -->|"manages favorites"| node_product_vm
node_detail -->|"adds to cart"| node_cart_vm
node_cart_screen -->|"manages cart"| node_cart_vm
node_checkout -->|"reads and clears cart"| node_cart_vm
node_checkout -->|"places order"| node_order_vm
node_orders -->|"loads history"| node_order_vm
node_order_detail -->|"loads order"| node_order_vm
node_profile -->|"loads account"| node_auth_vm
node_information -->|"updates profile"| node_auth_vm
node_product_vm -->|"creates products"| node_product_model
node_auth_vm -->|"creates user"| node_user_model
node_auth_vm -->|"uses client"| node_firebase_config
node_product_vm -->|"queries catalog"| node_firebase_config
node_cart_vm -->|"reads and writes"| node_firebase_config
node_order_vm -->|"reads and writes"| node_firebase_config
node_firebase_config -->|"connects to"| node_firebase
node_auth_vm -->|"uploads avatar"| node_cloudinary_service
node_cloudinary_service -->|"uploads image"| node_cloudinary

click node_app_entry "https://github.com/nguyennhan6704/ffshop/blob/main/App.js"
click node_navigation "https://github.com/nguyennhan6704/ffshop/blob/main/src/navigation/MainNavigator.js"
click node_auth_screen "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/AuthScreen.js"
click node_home "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/HomeScreen.js"
click node_search "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/SearchScreen.js"
click node_detail "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/ProductDetailScreen.js"
click node_favorites "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/FavoriteScreen.js"
click node_cart_screen "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/CartScreen.js"
click node_checkout "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/CheckoutScreen.js"
click node_orders "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/OrderScreen.js"
click node_order_detail "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/OrderDetailScreen.js"
click node_profile "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/ProfileScreen.js"
click node_information "https://github.com/nguyennhan6704/ffshop/blob/main/src/views/InformationScreen.js"
click node_auth_vm "https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/AuthViewModels.js"
click node_product_vm "https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/ProductViewModel.js"
click node_cart_vm "https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/CartViewModels.js"
click node_order_vm "https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/OrderViewModels.js"
click node_product_model "https://github.com/nguyennhan6704/ffshop/blob/main/src/models/Product.js"
click node_user_model "https://github.com/nguyennhan6704/ffshop/blob/main/src/models/User.js"
click node_order_model "https://github.com/nguyennhan6704/ffshop/blob/main/src/models/Order.js"
click node_firebase_config "https://github.com/nguyennhan6704/ffshop/blob/main/firebaseConfig.js"
click node_cloudinary_service "https://github.com/nguyennhan6704/ffshop/blob/main/src/services/CloudinaryServices.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_entry,node_navigation toneBlue
class node_home,node_search,node_detail,node_favorites,node_cart_screen,node_checkout,node_orders,node_order_detail,node_firebase toneAmber
class node_auth_screen,node_profile,node_information toneMint
class node_auth_vm,node_product_vm,node_cart_vm,node_order_vm,node_product_model,node_user_model,node_order_model,node_firebase_config,node_cloudinary_service toneRose
class node_customer,node_cloudinary toneIndigo
```

## Components

### App and navigation

- [App entry](https://github.com/nguyennhan6704/ffshop/blob/main/App.js): `App.js`
- [Main navigation](https://github.com/nguyennhan6704/ffshop/blob/main/src/navigation/MainNavigator.js): `src/navigation/MainNavigator.js`

### Shopping experience

- [Home](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/HomeScreen.js): `src/views/HomeScreen.js`
- [Product search](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/SearchScreen.js): `src/views/SearchScreen.js`
- [Product detail](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/ProductDetailScreen.js): `src/views/ProductDetailScreen.js`
- [Favorites](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/FavoriteScreen.js): `src/views/FavoriteScreen.js`
- [Cart](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/CartScreen.js): `src/views/CartScreen.js`
- [COD checkout](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/CheckoutScreen.js): `src/views/CheckoutScreen.js`
- [Order history](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/OrderScreen.js): `src/views/OrderScreen.js`
- [Order detail](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/OrderDetailScreen.js): `src/views/OrderDetailScreen.js`

### Account and identity

- [Authentication](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/AuthScreen.js): `src/views/AuthScreen.js`
- [Profile](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/ProfileScreen.js): `src/views/ProfileScreen.js`
- [Personal information](https://github.com/nguyennhan6704/ffshop/blob/main/src/views/InformationScreen.js): `src/views/InformationScreen.js`

### Viewmodels and data

- [Auth logic](https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/AuthViewModels.js): `src/viewmodels/AuthViewModels.js`
- [Product logic](https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/ProductViewModel.js): `src/viewmodels/ProductViewModel.js`
- [Cart logic](https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/CartViewModels.js): `src/viewmodels/CartViewModels.js`
- [Order logic](https://github.com/nguyennhan6704/ffshop/blob/main/src/viewmodels/OrderViewModels.js): `src/viewmodels/OrderViewModels.js`
- [Product model](https://github.com/nguyennhan6704/ffshop/blob/main/src/models/Product.js): `src/models/Product.js`
- [User model](https://github.com/nguyennhan6704/ffshop/blob/main/src/models/User.js): `src/models/User.js`
- [Order model](https://github.com/nguyennhan6704/ffshop/blob/main/src/models/Order.js): `src/models/Order.js`
- [Firebase client](https://github.com/nguyennhan6704/ffshop/blob/main/firebaseConfig.js): `firebaseConfig.js`
- [Avatar upload service](https://github.com/nguyennhan6704/ffshop/blob/main/src/services/CloudinaryServices.js): `src/services/CloudinaryServices.js`

### Other components

- **Shopper**
- **Firebase backend**
- **Cloudinary**

## Connections

- Shopper → App entry: opens app (evidence: `README.md`)
- App entry → Authentication: shows signed out (evidence: `App.js`)
- App entry → Main navigation: shows signed in (evidence: `App.js`)
- App entry → Auth logic: loads account (evidence: `App.js`)
- Authentication → Auth logic: authenticates (evidence: `src/views/AuthScreen.js`)
- Main navigation → Home: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Product search: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Cart: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Profile: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Product detail: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Favorites: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → COD checkout: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Order history: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Order detail: routes to (evidence: `src/navigation/MainNavigator.js`)
- Main navigation → Personal information: routes to (evidence: `src/navigation/MainNavigator.js`)
- Home → Product logic: loads products (evidence: `src/views/HomeScreen.js`)
- Product search → Product logic: loads and searches (evidence: `src/views/SearchScreen.js`)
- Product detail → Product logic: loads product (evidence: `src/views/ProductDetailScreen.js`)
- Favorites → Product logic: manages favorites (evidence: `src/views/FavoriteScreen.js`)
- Product detail → Cart logic: adds to cart (evidence: `src/views/ProductDetailScreen.js`)
- Cart → Cart logic: manages cart (evidence: `src/views/CartScreen.js`)
- COD checkout → Cart logic: reads and clears cart (evidence: `src/views/CheckoutScreen.js`)
- COD checkout → Order logic: places order (evidence: `src/views/CheckoutScreen.js`)
- Order history → Order logic: loads history (evidence: `src/views/OrderScreen.js`)
- Order detail → Order logic: loads order (evidence: `src/views/OrderDetailScreen.js`)
- Profile → Auth logic: loads account (evidence: `src/views/ProfileScreen.js`)
- Personal information → Auth logic: updates profile (evidence: `src/views/InformationScreen.js`)
- Product logic → Product model: creates products (evidence: `src/viewmodels/ProductViewModel.js`)
- Auth logic → User model: creates user (evidence: `src/viewmodels/AuthViewModels.js`)
- Auth logic → Firebase client: uses client (evidence: `src/viewmodels/AuthViewModels.js`)
- Product logic → Firebase client: queries catalog (evidence: `src/viewmodels/ProductViewModel.js`)
- Cart logic → Firebase client: reads and writes (evidence: `src/viewmodels/CartViewModels.js`)
- Order logic → Firebase client: reads and writes (evidence: `src/viewmodels/OrderViewModels.js`)
- Firebase client → Firebase backend: connects to (evidence: `firebaseConfig.js`)
- Auth logic → Avatar upload service: uploads avatar (evidence: `src/viewmodels/AuthViewModels.js`)
- Avatar upload service → Cloudinary: uploads image (evidence: `src/services/CloudinaryServices.js`)
