How vadimnotjustdev/amazonclone works
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: ShoopingCartScreen/index.tsx Shopping cart · schema.js Data models · ProductScreen/index.tsx Product details · HomeStack.tsx Home navigation
Components 20
Mobile app
- App and auth
App.tsx - Navigation
src/router/index.tsx - Home navigation
src/router/HomeStack.tsx - Tab navigation
src/router/bottomTabNav.tsx
Shopping flow
- Catalog data
src/data/products.ts - Home screen
src/screens/HomeScreen/index.tsx - Product listing item
src/components/ProductItem/index.tsx - Product details
src/screens/ProductScreen/index.tsx - Shopping cart
src/screens/ShoopingCartScreen/index.tsx - Cart item
src/components/CartProductItem/index.tsx - Quantity selector
src/components/QuantitySelector/index.tsx - Address and checkout
src/screens/AddressScreen/index.tsx
Data and API
- Data models
src/models/schema.js - GraphQL operations
src/graphql/mutations.ts - Generated API client
src/API.ts - Cloud data schema
amplify/backend/api/amazonclone/schema.graphql
Payments
- Payment intent function
amplify/backend/function/CreatePaymentIntent/src/index.js - Stripe webhook
amplify/backend/function/StripeWebhook/src/index.js
Other components
- Customer
- Stripe
Connections 23
- Customer → App and auth: uses
App.tsx - App and auth → Navigation: renders
App.tsx - Navigation → Tab navigation: renders
src/router/index.tsx - Tab navigation → Home navigation: routes to
src/router/bottomTabNav.tsx - Tab navigation → Shopping cart: routes to
src/router/bottomTabNav.tsx - Home navigation → Home screen: routes to
src/router/HomeStack.tsx - Home navigation → Product details: routes to
src/router/HomeStack.tsx - Home screen → Product listing item: renders
src/screens/HomeScreen/index.tsx - Home screen → Catalog data: reads
src/screens/HomeScreen/index.tsx - Product details → Data models: queries
src/screens/ProductScreen/index.tsx - Product details → Quantity selector: renders
src/screens/ProductScreen/index.tsx - Product details → Shopping cart: saves and navigates
src/screens/ProductScreen/index.tsx - Shopping cart → Data models: queries and observes
src/screens/ShoopingCartScreen/index.tsx - Shopping cart → Cart item: renders
src/screens/ShoopingCartScreen/index.tsx - Cart item → Quantity selector: renders
src/components/CartProductItem/index.tsx - Cart item → Data models: updates
src/components/CartProductItem/index.tsx - Shopping cart → Address and checkout: routes to
src/screens/ShoopingCartScreen/index.tsx - Address and checkout → GraphQL operations: requests intent
src/screens/AddressScreen/index.tsx - Address and checkout → Data models: creates order and clears cart
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