# ruto1m/dummy-account architecture

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

- Interactive diagram: https://gitdiagram.com/ruto1m/dummy-account
- Repository: https://github.com/ruto1m/dummy-account

## Overview

This is a React checkout frontend. A shopper proceeds through account login or registration, shipping details, and payment; App selects the active step, while the checkout context holds the step and submitted shipping/payment data. Authentication uses browser localStorage for accounts and the current user. The README is empty, so the map reflects the supplied source and index; Header and OrderSummary are included as separate UI components, though their placement in the main flow is not shown.

Main entry points: [`checkout-page/src/App.tsx`](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/App.tsx) (Step coordinator), [`checkout-page/src/context/useCheckout.ts`](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/useCheckout.ts) (Checkout hook), [`checkout-page/src/AuthForm.tsx`](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/AuthForm.tsx) (Account form), [`checkout-page/src/context/AuthContext.tsx`](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/AuthContext.tsx) (User session)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_flow["Checkout flow"]
  node_app["Step coordinator<br/>[App.tsx]"]
  node_shipping["Shipping form<br/>[ShippingColumn.tsx]"]
  node_payment["Payment form<br/>[PaymentColumn.tsx]"]
end

subgraph group_identity["Authentication"]
  node_authform["Account form<br/>[AuthForm.tsx]"]
  node_authapi["Account operations<br/>[authAPI.ts]"]
  node_authcontext["User session<br/>[AuthContext.tsx]"]
  node_authhooks["Auth hook<br/>[authHooks.ts]"]
end

subgraph group_state["Application state"]
  node_checkoutcontext["Checkout context"]
  node_checkouthook["Checkout hook<br/>[useCheckout.ts]"]
  node_reducer["Checkout reducer<br/>[checkoutReducer.ts]"]
  node_browserstorage[("Browser localStorage")]
  node_entry["Provider entry<br/>[main.tsx]"]
end

subgraph group_ui["Checkout UI"]
  node_product["Product column<br/>[ProductColumn.tsx]"]
  node_summary["Order summary<br/>[OrderSummary.tsx]"]
  node_header["Header<br/>[Header.tsx]"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses checkout"| node_app
node_app -->|"renders account"| node_authform
node_app -->|"renders shipping"| node_shipping
node_app -->|"renders payment"| node_payment
node_app -->|"renders column"| node_product
node_app -->|"reads session"| node_authhooks
node_app -->|"reads checkout"| node_checkouthook
node_authform -->|"calls login/register"| node_authapi
node_authform -->|"sets user"| node_authcontext
node_authform -->|"dispatches step"| node_checkouthook
node_authapi -->|"reads/writes accounts"| node_browserstorage
node_authcontext -->|"persists session"| node_browserstorage
node_authhooks -->|"reads context"| node_authcontext
node_shipping -->|"dispatches shipping"| node_checkouthook
node_payment -->|"dispatches payment"| node_checkouthook
node_checkouthook -->|"reads context"| node_checkoutcontext
node_checkoutcontext -->|"reduces actions"| node_reducer
node_summary -->|"reads checkout"| node_checkouthook
node_header -->|"reads session"| node_authhooks
node_entry -->|"renders application"| node_app
node_entry -->|"provides session"| node_authcontext
node_entry -->|"provides checkout"| node_checkoutcontext

click node_app "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/App.tsx"
click node_shipping "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/ShippingColumn.tsx"
click node_payment "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/PaymentColumn.tsx"
click node_authform "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/AuthForm.tsx"
click node_authapi "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/api/authAPI.ts"
click node_authcontext "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/AuthContext.tsx"
click node_authhooks "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/authHooks.ts"
click node_checkoutcontext "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/CheckoutContext.tsx"
click node_checkouthook "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/useCheckout.ts"
click node_reducer "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/checkoutReducer.ts"
click node_product "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/ProductColumn.tsx"
click node_summary "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/OrderSummary.tsx"
click node_header "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/components/Header.tsx"
click node_entry "https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/main.tsx"

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,node_shipping,node_payment toneBlue
class node_authform,node_authapi,node_authcontext,node_authhooks toneAmber
class node_checkoutcontext,node_checkouthook,node_reducer,node_browserstorage,node_entry toneMint
class node_product,node_summary,node_header toneRose
class node_shopper toneIndigo
```

## Components

### Checkout flow

- [Step coordinator](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/App.tsx): `checkout-page/src/App.tsx`
- [Shipping form](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/ShippingColumn.tsx): `checkout-page/src/ShippingColumn.tsx`
- [Payment form](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/PaymentColumn.tsx): `checkout-page/src/PaymentColumn.tsx`

### Authentication

- [Account form](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/AuthForm.tsx): `checkout-page/src/AuthForm.tsx`
- [Account operations](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/api/authAPI.ts): `checkout-page/src/api/authAPI.ts`
- [User session](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/AuthContext.tsx): `checkout-page/src/context/AuthContext.tsx`
- [Auth hook](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/authHooks.ts): `checkout-page/src/context/authHooks.ts`

### Application state

- [Checkout context](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/CheckoutContext.tsx): `checkout-page/src/context/CheckoutContext.tsx`
- [Checkout hook](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/useCheckout.ts): `checkout-page/src/context/useCheckout.ts`
- [Checkout reducer](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/context/checkoutReducer.ts): `checkout-page/src/context/checkoutReducer.ts`
- **Browser localStorage**
- [Provider entry](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/main.tsx): `checkout-page/src/main.tsx`

### Checkout UI

- [Product column](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/ProductColumn.tsx): `checkout-page/src/ProductColumn.tsx`
- [Order summary](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/OrderSummary.tsx): `checkout-page/src/OrderSummary.tsx`
- [Header](https://github.com/ruto1m/dummy-account/blob/main/checkout-page/src/components/Header.tsx): `checkout-page/src/components/Header.tsx`

### Other components

- **Shopper**

## Connections

- Shopper → Step coordinator: uses checkout (evidence: `checkout-page/src/App.tsx`)
- Step coordinator → Account form: renders account (evidence: `checkout-page/src/App.tsx`)
- Step coordinator → Shipping form: renders shipping (evidence: `checkout-page/src/App.tsx`)
- Step coordinator → Payment form: renders payment (evidence: `checkout-page/src/App.tsx`)
- Step coordinator → Product column: renders column (evidence: `checkout-page/src/App.tsx`)
- Step coordinator → Auth hook: reads session (evidence: `checkout-page/src/App.tsx`)
- Step coordinator → Checkout hook: reads checkout (evidence: `checkout-page/src/App.tsx`)
- Account form → Account operations: calls login/register (evidence: `checkout-page/src/AuthForm.tsx`)
- Account form → User session: sets user (evidence: `checkout-page/src/AuthForm.tsx`)
- Account form → Checkout hook: dispatches step (evidence: `checkout-page/src/AuthForm.tsx`)
- Account operations → Browser localStorage: reads/writes accounts (evidence: `checkout-page/src/api/authAPI.ts`)
- User session → Browser localStorage: persists session (evidence: `checkout-page/src/context/AuthContext.tsx`)
- Auth hook → User session: reads context (evidence: `checkout-page/src/context/authHooks.ts`)
- Shipping form → Checkout hook: dispatches shipping (evidence: `checkout-page/src/ShippingColumn.tsx`)
- Payment form → Checkout hook: dispatches payment (evidence: `checkout-page/src/PaymentColumn.tsx`)
- Checkout hook → Checkout context: reads context (evidence: `checkout-page/src/context/useCheckout.ts`)
- Checkout context → Checkout reducer: reduces actions (evidence: `checkout-page/src/context/CheckoutContext.tsx`)
- Order summary → Checkout hook: reads checkout (evidence: `checkout-page/src/OrderSummary.tsx`)
- Header → Auth hook: reads session (evidence: `checkout-page/src/components/Header.tsx`)
- Provider entry → Step coordinator: renders application (evidence: `checkout-page/src/main.tsx`)
- Provider entry → User session: provides session (evidence: `checkout-page/src/main.tsx`)
- Provider entry → Checkout context: provides checkout (evidence: `checkout-page/src/main.tsx`)
