# vadimnotjustdev/amazonclone architecture

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

- Interactive diagram: https://gitdiagram.com/vadimnotjustdev/amazonclone
- Repository: https://github.com/vadimnotjustdev/amazonclone

## Overview

This is a React Native shopping app. A signed-in customer browses the catalog, opens a product, adds it to a cart, reviews quantities and subtotal, enters shipping details, pays, and then has an order created from the cart. The app also includes generated Amplify data/API modules and backend payment functions. Relationships below follow shown imports and calls; links between the payment mutation, backend function, and Stripe webhook are left unverified because their wiring was not shown.

Main entry points: [`src/screens/ShoopingCartScreen/index.tsx`](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/ShoopingCartScreen/index.tsx) (Shopping cart), [`src/models/schema.js`](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/models/schema.js) (Data models), [`src/screens/ProductScreen/index.tsx`](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/ProductScreen/index.tsx) (Product details), [`src/router/HomeStack.tsx`](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/HomeStack.tsx) (Home navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Mobile app"]
  node_app["App and auth<br/>[App.tsx]"]
  node_router["Navigation<br/>[index.tsx]"]
  node_home_stack["Home navigation<br/>[HomeStack.tsx]"]
  node_tabs["Tab navigation<br/>[bottomTabNav.tsx]"]
end

subgraph group_commerce["Shopping flow"]
  node_catalog["Catalog data<br/>[products.ts]"]
  node_home["Home screen<br/>[index.tsx]"]
  node_product_item["Product listing item<br/>[index.tsx]"]
  node_product_detail["Product details<br/>[index.tsx]"]
  node_cart["Shopping cart<br/>[index.tsx]"]
  node_cart_item["Cart item<br/>[index.tsx]"]
  node_quantity["Quantity selector<br/>[index.tsx]"]
  node_checkout["Address and checkout<br/>[index.tsx]"]
end

subgraph group_data["Data and API"]
  node_models["Data models<br/>[schema.js]"]
  node_graphql["GraphQL operations<br/>[mutations.ts]"]
  node_api_client["Generated API client<br/>[API.ts]"]
  node_cloud_schema["Cloud data schema<br/>[schema.graphql]"]
end

subgraph group_payments["Payments"]
  node_payment_intent["Payment intent function<br/>[index.js]"]
  node_stripe_webhook["Stripe webhook<br/>[index.js]"]
end

node_customer(("Customer"))
node_stripe(("Stripe"))

node_customer -->|"uses"| node_app
node_app -->|"renders"| node_router
node_router -->|"renders"| node_tabs
node_tabs -->|"routes to"| node_home_stack
node_tabs -->|"routes to"| node_cart
node_home_stack -->|"routes to"| node_home
node_home_stack -->|"routes to"| node_product_detail
node_home -->|"renders"| node_product_item
node_home -->|"reads"| node_catalog
node_product_detail -->|"queries"| node_models
node_product_detail -->|"renders"| node_quantity
node_product_detail -->|"saves and navigates"| node_cart
node_cart -->|"queries and observes"| node_models
node_cart -->|"renders"| node_cart_item
node_cart_item -->|"renders"| node_quantity
node_cart_item -->|"updates"| node_models
node_cart -->|"routes to"| node_checkout
node_checkout -->|"requests intent"| node_graphql
node_checkout -->|"creates order and clears cart"| node_models
node_models -.->|"models"| node_cloud_schema
node_graphql -.->|"invokes"| node_payment_intent
node_payment_intent -.->|"creates intent"| node_stripe
node_stripe -.->|"notifies"| node_stripe_webhook

click node_app "https://github.com/vadimnotjustdev/amazonclone/blob/main/App.tsx"
click node_router "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/index.tsx"
click node_home_stack "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/HomeStack.tsx"
click node_tabs "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/bottomTabNav.tsx"
click node_catalog "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/data/products.ts"
click node_home "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/HomeScreen/index.tsx"
click node_product_item "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/components/ProductItem/index.tsx"
click node_product_detail "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/ProductScreen/index.tsx"
click node_cart "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/ShoopingCartScreen/index.tsx"
click node_cart_item "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/components/CartProductItem/index.tsx"
click node_quantity "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/components/QuantitySelector/index.tsx"
click node_checkout "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/AddressScreen/index.tsx"
click node_models "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/models/schema.js"
click node_graphql "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/graphql/mutations.ts"
click node_api_client "https://github.com/vadimnotjustdev/amazonclone/blob/main/src/API.ts"
click node_cloud_schema "https://github.com/vadimnotjustdev/amazonclone/blob/main/amplify/backend/api/amazonclone/schema.graphql"
click node_payment_intent "https://github.com/vadimnotjustdev/amazonclone/blob/main/amplify/backend/function/CreatePaymentIntent/src/index.js"
click node_stripe_webhook "https://github.com/vadimnotjustdev/amazonclone/blob/main/amplify/backend/function/StripeWebhook/src/index.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,node_router,node_home_stack,node_tabs toneBlue
class node_catalog,node_home,node_product_item,node_product_detail,node_cart,node_cart_item,node_quantity,node_checkout toneAmber
class node_models,node_graphql,node_api_client,node_cloud_schema toneMint
class node_payment_intent,node_stripe_webhook toneRose
class node_customer,node_stripe toneIndigo
```

## Components

### Mobile app

- [App and auth](https://github.com/vadimnotjustdev/amazonclone/blob/main/App.tsx): `App.tsx`
- [Navigation](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/index.tsx): `src/router/index.tsx`
- [Home navigation](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/HomeStack.tsx): `src/router/HomeStack.tsx`
- [Tab navigation](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/router/bottomTabNav.tsx): `src/router/bottomTabNav.tsx`

### Shopping flow

- [Catalog data](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/data/products.ts): `src/data/products.ts`
- [Home screen](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/HomeScreen/index.tsx): `src/screens/HomeScreen/index.tsx`
- [Product listing item](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/components/ProductItem/index.tsx): `src/components/ProductItem/index.tsx`
- [Product details](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/ProductScreen/index.tsx): `src/screens/ProductScreen/index.tsx`
- [Shopping cart](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/ShoopingCartScreen/index.tsx): `src/screens/ShoopingCartScreen/index.tsx`
- [Cart item](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/components/CartProductItem/index.tsx): `src/components/CartProductItem/index.tsx`
- [Quantity selector](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/components/QuantitySelector/index.tsx): `src/components/QuantitySelector/index.tsx`
- [Address and checkout](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/screens/AddressScreen/index.tsx): `src/screens/AddressScreen/index.tsx`

### Data and API

- [Data models](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/models/schema.js): `src/models/schema.js`
- [GraphQL operations](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/graphql/mutations.ts): `src/graphql/mutations.ts`
- [Generated API client](https://github.com/vadimnotjustdev/amazonclone/blob/main/src/API.ts): `src/API.ts`
- [Cloud data schema](https://github.com/vadimnotjustdev/amazonclone/blob/main/amplify/backend/api/amazonclone/schema.graphql): `amplify/backend/api/amazonclone/schema.graphql`

### Payments

- [Payment intent function](https://github.com/vadimnotjustdev/amazonclone/blob/main/amplify/backend/function/CreatePaymentIntent/src/index.js): `amplify/backend/function/CreatePaymentIntent/src/index.js`
- [Stripe webhook](https://github.com/vadimnotjustdev/amazonclone/blob/main/amplify/backend/function/StripeWebhook/src/index.js): `amplify/backend/function/StripeWebhook/src/index.js`

### Other components

- **Customer**
- **Stripe**

## Connections

- Customer → App and auth: uses (evidence: `App.tsx`)
- App and auth → Navigation: renders (evidence: `App.tsx`)
- Navigation → Tab navigation: renders (evidence: `src/router/index.tsx`)
- Tab navigation → Home navigation: routes to (evidence: `src/router/bottomTabNav.tsx`)
- Tab navigation → Shopping cart: routes to (evidence: `src/router/bottomTabNav.tsx`)
- Home navigation → Home screen: routes to (evidence: `src/router/HomeStack.tsx`)
- Home navigation → Product details: routes to (evidence: `src/router/HomeStack.tsx`)
- Home screen → Product listing item: renders (evidence: `src/screens/HomeScreen/index.tsx`)
- Home screen → Catalog data: reads (evidence: `src/screens/HomeScreen/index.tsx`)
- Product details → Data models: queries (evidence: `src/screens/ProductScreen/index.tsx`)
- Product details → Quantity selector: renders (evidence: `src/screens/ProductScreen/index.tsx`)
- Product details → Shopping cart: saves and navigates (evidence: `src/screens/ProductScreen/index.tsx`)
- Shopping cart → Data models: queries and observes (evidence: `src/screens/ShoopingCartScreen/index.tsx`)
- Shopping cart → Cart item: renders (evidence: `src/screens/ShoopingCartScreen/index.tsx`)
- Cart item → Quantity selector: renders (evidence: `src/components/CartProductItem/index.tsx`)
- Cart item → Data models: updates (evidence: `src/components/CartProductItem/index.tsx`)
- Shopping cart → Address and checkout: routes to (evidence: `src/screens/ShoopingCartScreen/index.tsx`)
- Address and checkout → GraphQL operations: requests intent (evidence: `src/screens/AddressScreen/index.tsx`)
- Address and checkout → Data models: creates order and clears cart (evidence: `src/screens/AddressScreen/index.tsx`)
- Data models → Cloud data schema: models
- GraphQL operations → Payment intent function: invokes
- Payment intent function → Stripe: creates intent
- Stripe → Stripe webhook: notifies
