# abidev2003/fast-react-pizza architecture

> Architecture diagram of the GitHub repository abidev2003/fast-react-pizza, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abidev2003/fast-react-pizza
- Repository: https://github.com/abidev2003/fast-react-pizza

## Overview

1. **Overall shape**
   This is a **React + Vite single-page application** organized around business features rather than technical layers. The app is stateful, with **Redux Toolkit-style slices** managing shared domain state for the cart and user, while feature components handle presentation and user interactions.

2. **Entry and composition**
   `src/main.jsx` boots the app, `src/App.jsx` is the top-level composition point, and `src/store.js` wires the global state container. The UI shell is split into reusable layout pieces in `src/ui` such as `AppLayout`, `Header`, `Home`, `Loader`, `Error`, and navigation buttons/links.

3. **Feature-based domain boundaries**
   The repository is divided into four main feature areas under `src/features`: **menu**, **cart**, **order**, and **user**. This separation is the clearest architecture boundary in the codebase: menu reads external data, cart manages local selection state, user handles identity/profile, and order coordinates checkout and lookup/update flows.

4. **Menu subsystem**
   `src/features/menu` contains `Menu.jsx` and `MenuItem.jsx`, which likely render the restaurant menu and individual items. This subsystem is the primary consumer of the restaurant API service and acts as the catalog layer that feeds the cart.

5. **Cart subsystem**
   `src/features/cart` contains the cart UI and cart actions: `Cart.jsx`, `CartItem.jsx`, `CartOverview.jsx`, `UpdateItemQuantity.jsx`, `DeleteItem.jsx`, and `EmptyCart.jsx`. The cart state itself lives in `cartSlice.js`, making the cart a globally shared workflow state rather than local component state. It is the main aggregation point for selected menu items and quantities.

6. **User subsystem**
   `src/features/user` includes `CreateUser.jsx`, `Username.jsx`, and `userSlice.js`. This suggests a lightweight user/profile state used to persist or display the active customer identity across the ordering flow. It likely gates order creation and personalizes the checkout experience.

7. **Order subsystem**
   `src/features/order` contains `CreateOrder.jsx`, `Order.jsx`, `OrderItem.jsx`, `SearchOrder.jsx`, and `UpdateOrder.jsx`. This area appears to manage the lifecycle of an order after cart checkout: creating an order, viewing order details, searching existing orders, and updating them. It is the bridge between the client-side cart state and backend persistence.

8. **External service boundary**
   `src/services/apiRestaurant.js` and `src/services/apiGeocoding.js` are the main infrastructure boundaries. The restaurant API likely supplies menu/order data, while the geocoding API supports location or address resolution during checkout. These services isolate network access from feature components and keep integration concerns centralized.

9. **Shared UI and utilities**
   `src/ui` contains common presentation primitives, while `src/utils/helpers.js` likely holds formatting or transformation helpers used across multiple features. This layer keeps feature components lean and prevents duplicated UI or business utility logic.

10. **Data flow through the app**
   A typical flow is: **menu data is loaded from the restaurant API → user selects items → cart state updates in Redux → checkout/order creation uses cart + user state → order data is displayed or searched later**. Geocoding is an auxiliary flow used when address/location input is needed. The key architectural boundary is that feature components mostly orchestrate state and UI, while services encapsulate remote data access.

11. **Styling and build/tooling**
   The project uses the standard Vite toolchain with ESLint and Prettier, plus Tailwind configuration and app-wide CSS files (`src/index.css`, `src/styles.css`). Styling is therefore mixed between utility-driven and custom global styles, but this does not change the core architecture: it remains a client-side, feature-oriented React app with centralized state and service adapters.

Main entry points: [`src/features/cart/Cart.jsx`](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/Cart.jsx) (Cart), [`src/features/order/CreateOrder.jsx`](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/CreateOrder.jsx) (CreateOrder), [`src/features/order/Order.jsx`](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/Order.jsx) (Order), [`src/services/apiRestaurant.js`](https://github.com/abidev2003/fast-react-pizza/blob/main/src/services/apiRestaurant.js) (Restaurant API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grp_src["src"]
  node_node_main(("main<br/>entry<br/>[main.jsx]"))
  node_node_app["App<br/>composition<br/>[App.jsx]"]
  node_node_store[("Store<br/>[store.js]")]
  node_node_helpers["helpers<br/>[helpers.js]"]
end

subgraph group_grp_features["features"]
  node_node_menu["Menu<br/>catalog feature<br/>[Menu.jsx]"]
  node_node_menuitem["MenuItem<br/>catalog item<br/>[MenuItem.jsx]"]
  node_node_cart["Cart<br/>[Cart.jsx]"]
  node_node_cartslice[("cartSlice<br/>redux slice<br/>[cartSlice.js]")]
  node_node_cartitem["CartItem<br/>cart item<br/>[CartItem.jsx]"]
  node_node_cartoverview["CartOverview<br/>cart summary<br/>[CartOverview.jsx]"]
  node_node_updateqty["UpdateQty<br/>cart action"]
  node_node_deleteitem["DeleteItem<br/>cart action<br/>[DeleteItem.jsx]"]
  node_node_emptycart["EmptyCart<br/>cart action<br/>[EmptyCart.jsx]"]
  node_node_user["User<br/>identity feature<br/>[Username.jsx]"]
  node_node_userslice[("userSlice<br/>redux slice<br/>[userSlice.js]")]
  node_node_createuser["CreateUser<br/>identity form<br/>[CreateUser.jsx]"]
  node_node_order["Order<br/>[Order.jsx]"]
  node_node_createorder["CreateOrder<br/>checkout form<br/>[CreateOrder.jsx]"]
  node_node_orderitem["OrderItem<br/>order item<br/>[OrderItem.jsx]"]
  node_node_searchorder["SearchOrder<br/>order lookup<br/>[SearchOrder.jsx]"]
  node_node_updateorder["UpdateOrder<br/>order action<br/>[UpdateOrder.jsx]"]
end

subgraph group_grp_services["services"]
  node_node_api_rest["Restaurant API<br/>api client<br/>[apiRestaurant.js]"]
  node_node_api_geo["Geocoding API<br/>api client<br/>[apiGeocoding.js]"]
end

subgraph group_grp_ui["ui"]
  node_node_layout["AppLayout<br/>layout shell<br/>[AppLayout.jsx]"]
  node_node_header["Header<br/>[Header.jsx]"]
  node_node_home["Home<br/>landing view<br/>[Home.jsx]"]
  node_node_button["Button<br/>ui primitive<br/>[Button.jsx]"]
  node_node_linkbtn["LinkButton<br/>ui primitive<br/>[LinkButton.jsx]"]
  node_node_loader(("Loader<br/>status ui<br/>[Loader.jsx]"))
  node_node_error["Error<br/>status ui<br/>[Error.jsx]"]
end

node_node_main -->|"boots"| node_node_app
node_node_app -->|"uses store"| node_node_store
node_node_app -->|"composes"| node_node_layout
node_node_layout -->|"includes"| node_node_header
node_node_layout -->|"includes"| node_node_home
node_node_header -->|"uses"| node_node_button
node_node_header -->|"uses"| node_node_linkbtn
node_node_home -->|"shows"| node_node_loader
node_node_home -->|"shows"| node_node_error
node_node_menu -->|"renders"| node_node_menuitem
node_node_menu -->|"reads"| node_node_api_rest
node_node_menu -.->|"formats"| node_node_helpers
node_node_cart -->|"reads/writes"| node_node_cartslice
node_node_cart -->|"renders"| node_node_cartitem
node_node_cart -->|"summarizes"| node_node_cartoverview
node_node_cart -->|"allows"| node_node_updateqty
node_node_cart -->|"allows"| node_node_deleteitem
node_node_cart -->|"allows"| node_node_emptycart
node_node_user -->|"reads/writes"| node_node_userslice
node_node_user -->|"uses"| node_node_createuser
node_node_order -->|"creates"| node_node_createorder
node_node_order -->|"renders"| node_node_orderitem
node_node_order -->|"searches"| node_node_searchorder
node_node_order -->|"updates"| node_node_updateorder
node_node_createorder -->|"consumes"| node_node_cartslice
node_node_createorder -->|"consumes"| node_node_userslice
node_node_createorder -->|"writes"| node_node_api_rest
node_node_createorder -.->|"uses"| node_node_api_geo
node_node_searchorder -->|"reads"| node_node_api_rest
node_node_updateorder -->|"writes"| node_node_api_rest
node_node_store -->|"registers"| node_node_cartslice
node_node_store -->|"registers"| node_node_userslice

click node_node_main "https://github.com/abidev2003/fast-react-pizza/blob/main/src/main.jsx"
click node_node_app "https://github.com/abidev2003/fast-react-pizza/blob/main/src/App.jsx"
click node_node_store "https://github.com/abidev2003/fast-react-pizza/blob/main/src/store.js"
click node_node_layout "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/AppLayout.jsx"
click node_node_header "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Header.jsx"
click node_node_home "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Home.jsx"
click node_node_button "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Button.jsx"
click node_node_linkbtn "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/LinkButton.jsx"
click node_node_loader "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Loader.jsx"
click node_node_error "https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Error.jsx"
click node_node_menu "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/menu/Menu.jsx"
click node_node_menuitem "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/menu/MenuItem.jsx"
click node_node_cart "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/Cart.jsx"
click node_node_cartslice "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/cartSlice.js"
click node_node_cartitem "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/CartItem.jsx"
click node_node_cartoverview "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/CartOverview.jsx"
click node_node_updateqty "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/UpdateItemQuantity.jsx"
click node_node_deleteitem "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/DeleteItem.jsx"
click node_node_emptycart "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/EmptyCart.jsx"
click node_node_user "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/user/Username.jsx"
click node_node_userslice "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/user/userSlice.js"
click node_node_createuser "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/user/CreateUser.jsx"
click node_node_order "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/Order.jsx"
click node_node_createorder "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/CreateOrder.jsx"
click node_node_orderitem "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/OrderItem.jsx"
click node_node_searchorder "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/SearchOrder.jsx"
click node_node_updateorder "https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/UpdateOrder.jsx"
click node_node_api_rest "https://github.com/abidev2003/fast-react-pizza/blob/main/src/services/apiRestaurant.js"
click node_node_api_geo "https://github.com/abidev2003/fast-react-pizza/blob/main/src/services/apiGeocoding.js"
click node_node_helpers "https://github.com/abidev2003/fast-react-pizza/blob/main/src/utils/helpers.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_node_main,node_node_app,node_node_store,node_node_helpers toneBlue
class node_node_menu,node_node_menuitem,node_node_cart,node_node_cartslice,node_node_cartitem,node_node_cartoverview,node_node_updateqty,node_node_deleteitem,node_node_emptycart,node_node_user,node_node_userslice,node_node_createuser,node_node_order,node_node_createorder,node_node_orderitem,node_node_searchorder,node_node_updateorder toneAmber
class node_node_api_rest,node_node_api_geo toneMint
class node_node_layout,node_node_header,node_node_home,node_node_button,node_node_linkbtn,node_node_loader,node_node_error toneRose
```

## Components

### src

Application source code

- [main](https://github.com/abidev2003/fast-react-pizza/blob/main/src/main.jsx): entry · Bootstraps the app and mounts React · `src/main.jsx`
- [App](https://github.com/abidev2003/fast-react-pizza/blob/main/src/App.jsx): composition · Top-level app composition and routing shell · `src/App.jsx`
- [Store](https://github.com/abidev2003/fast-react-pizza/blob/main/src/store.js): redux store · Global state container wiring shared slices · `src/store.js`
- [helpers](https://github.com/abidev2003/fast-react-pizza/blob/main/src/utils/helpers.js): utility · Shared formatting and transformation helpers · `src/utils/helpers.js`

### features

Domain feature subsystems

- [Menu](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/menu/Menu.jsx): catalog feature · Renders menu listing and menu item entry points · `src/features/menu/Menu.jsx`
- [MenuItem](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/menu/MenuItem.jsx): catalog item · Individual menu item presentation · `src/features/menu/MenuItem.jsx`
- [Cart](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/Cart.jsx): cart feature · Cart screen and checkout-related cart state usage · `src/features/cart/Cart.jsx`
- [cartSlice](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/cartSlice.js): redux slice · Shared cart state and mutations · `src/features/cart/cartSlice.js`
- [CartItem](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/CartItem.jsx): cart item · Single cart line item · `src/features/cart/CartItem.jsx`
- [CartOverview](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/CartOverview.jsx): cart summary · Cart totals and checkout summary · `src/features/cart/CartOverview.jsx`
- [UpdateQty](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/UpdateItemQuantity.jsx): cart action · Quantity adjustment control · `src/features/cart/UpdateItemQuantity.jsx`
- [DeleteItem](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/DeleteItem.jsx): cart action · Remove item action · `src/features/cart/DeleteItem.jsx`
- [EmptyCart](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/cart/EmptyCart.jsx): cart action · Clears the cart · `src/features/cart/EmptyCart.jsx`
- [User](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/user/Username.jsx): identity feature · User/profile state and checkout identity · `src/features/user/Username.jsx`
- [userSlice](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/user/userSlice.js): redux slice · Shared user identity state · `src/features/user/userSlice.js`
- [CreateUser](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/user/CreateUser.jsx): identity form · Creates or updates active user identity · `src/features/user/CreateUser.jsx`
- [Order](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/Order.jsx): order feature · Order lifecycle and order details · `src/features/order/Order.jsx`
- [CreateOrder](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/CreateOrder.jsx): checkout form · Creates a new order from cart and user data · `src/features/order/CreateOrder.jsx`
- [OrderItem](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/OrderItem.jsx): order item · Single order line item · `src/features/order/OrderItem.jsx`
- [SearchOrder](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/SearchOrder.jsx): order lookup · Finds existing orders · `src/features/order/SearchOrder.jsx`
- [UpdateOrder](https://github.com/abidev2003/fast-react-pizza/blob/main/src/features/order/UpdateOrder.jsx): order action · Updates an existing order · `src/features/order/UpdateOrder.jsx`

### services

External API adapters

- [Restaurant API](https://github.com/abidev2003/fast-react-pizza/blob/main/src/services/apiRestaurant.js): api client · Remote data access for menu and order workflows · `src/services/apiRestaurant.js`
- [Geocoding API](https://github.com/abidev2003/fast-react-pizza/blob/main/src/services/apiGeocoding.js): api client · Address and location lookup adapter · `src/services/apiGeocoding.js`

### ui

Shared UI shell and primitives

- [AppLayout](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/AppLayout.jsx): layout shell · Main application layout wrapper · `src/ui/AppLayout.jsx`
- [Header](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Header.jsx): navigation header · Top navigation and account/cart access · `src/ui/Header.jsx`
- [Home](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Home.jsx): landing view · Home screen content and entry presentation · `src/ui/Home.jsx`
- [Button](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Button.jsx): ui primitive · Reusable button control · `src/ui/Button.jsx`
- [LinkButton](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/LinkButton.jsx): ui primitive · Button-styled navigation link · `src/ui/LinkButton.jsx`
- [Loader](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Loader.jsx): status ui · Loading state indicator · `src/ui/Loader.jsx`
- [Error](https://github.com/abidev2003/fast-react-pizza/blob/main/src/ui/Error.jsx): status ui · Error state display · `src/ui/Error.jsx`

## Connections

- main → App: boots · Application entry renders the root app
- App → Store: uses store · App is wrapped with shared state container
- App → AppLayout: composes · Main layout frames the application
- AppLayout → Header: includes · Layout places the header shell
- AppLayout → Home: includes · Layout renders the home/landing content
- Header → Button: uses · Header relies on shared button primitive
- Header → LinkButton: uses · Header uses link-styled navigation controls
- Home → Loader: shows · Home can display loading state
- Home → Error: shows · Home can display error state
- Menu → MenuItem: renders · Menu lists individual menu items
- Menu → Restaurant API: reads · Catalog data comes from restaurant API
- Menu → helpers: formats · Menu may use shared transformation helpers
- Cart → cartSlice: reads/writes · Cart screen coordinates shared cart state
- Cart → CartItem: renders · Cart shows line items
- Cart → CartOverview: summarizes · Cart includes totals and summary
- Cart → UpdateQty: allows · Cart enables quantity changes
- Cart → DeleteItem: allows · Cart enables item removal
- Cart → EmptyCart: allows · Cart can be cleared
- User → userSlice: reads/writes · User identity is managed in shared state
- User → CreateUser: uses · Identity feature includes create/update flow
- Order → CreateOrder: creates · Order feature initiates checkout
- Order → OrderItem: renders · Order details include line items
- Order → SearchOrder: searches · Order feature supports lookup flow
- Order → UpdateOrder: updates · Order feature supports updating persisted orders
- CreateOrder → cartSlice: consumes · Checkout uses cart contents
- CreateOrder → userSlice: consumes · Checkout uses user identity
- CreateOrder → Restaurant API: writes · Order creation persists through restaurant API
- CreateOrder → Geocoding API: uses · Checkout can resolve address/location data
- SearchOrder → Restaurant API: reads · Order lookup uses restaurant API
- UpdateOrder → Restaurant API: writes · Order updates persist through restaurant API
- Store → cartSlice: registers · Store wires cart state reducer
- Store → userSlice: registers · Store wires user state reducer
