How spinhobby/spin-hobby works
Spin Hobby is a React storefront and commerce frontend, with customer and Square/merchant authentication, product discovery, cart and checkout, account features, and admin/cashier pages. The principal flow starts at the routed app, proceeds through catalog/search and product selection, then cart and checkout to payment and success. Redux reducers and sagas provide an internal state/async layer. The README only describes the app scaffold and deployment; unsampled page and API internals are represented by their exact tree paths, with uncertain connections omitted.
Main entry points: App.tsx Router and shell · store.ts Redux store and reducers · square.ts Square commerce API · index.tsx Home storefront
Components 28
Application shell
- Router and shell
src/App.tsx
Storefront
- Home storefront
src/view/pages/Home/index.tsx - Search results
src/view/pages/Search/index.tsx - Navigation search
src/view/components/NavBarV2/Search.tsx - Product browsing
src/view/pages/Product/index.tsx - Product detail
src/view/pages/ProductDetail/index.tsx - Events
src/view/pages/Events/index.tsx - Square commerce API
src/api/square.ts - Homepage API
src/api/homepage.ts
Commerce
- Shopping cart
src/view/pages/Cart/index.tsx - Checkout
src/view/pages/CheckOut/index.tsx - Square payments
src/api/square.ts - PayPal checkout support
src/view/components/Paypal/index.tsx - Checkout success
src/view/pages/CheckoutSuccess/index.tsx
Identity and state
- Auth initialization
src/hooks/useAuthInit.ts - Customer auth API
src/api/customerAuth.ts - Square auth service
src/api/squareAuth.ts - Wishlist hook and API
src/hooks/useWishlist.ts - Redux store and reducers
src/store.ts - Domain reducers
src/reducers/cartReducer.ts - Search saga
src/saga/searchSaga.ts
Admin and content
- Application API
src/api/index.ts - Account and orders
src/view/pages/Account/index.tsx - Cashier
src/view/pages/Cashier/index.tsx - Homepage administration
src/view/pages/HomepageAdmin/index.tsx - Events API
src/api/events.ts
Other components
- Shopper
- Commerce backend
Connections 34
- Shopper → Router and shell: opens
src/App.tsx - Router and shell → Home storefront: routes to
src/App.tsx - Router and shell → Search results: routes to
src/App.tsx - Router and shell → Product browsing: routes to
src/App.tsx - Router and shell → Product detail: routes to
src/App.tsx - Router and shell → Shopping cart: routes to
src/App.tsx - Router and shell → Checkout: routes to
src/App.tsx - Router and shell → Checkout success: routes to
src/App.tsx - Router and shell → Events: routes to
src/App.tsx - Router and shell → Account and orders: routes to
src/App.tsx - Router and shell → Cashier: routes to
src/App.tsx - Router and shell → Homepage administration: routes to
src/App.tsx - Router and shell → Auth initialization: initializes
src/App.tsx - Router and shell → Redux store and reducers: reads state
src/App.tsx - Home storefront → Square commerce API: loads catalog
src/view/pages/Home/index.tsx - Home storefront → Homepage API: loads content
src/view/pages/Home/index.tsx - Home storefront → Wishlist hook and API: uses
src/view/pages/Home/index.tsx - Navigation search → Square commerce API: searches catalog
src/view/components/NavBarV2/Search.tsx - Search results → Wishlist hook and API: uses
src/view/pages/Search/index.tsx - Shopping cart → Square commerce API: loads commerce data
src/view/pages/Cart/index.tsx - Checkout → Square payments: creates payment
src/view/pages/CheckOut/index.tsx - Square payments → Commerce backend: sends payment request
src/api/square.ts - Checkout → PayPal checkout support: offers payment UI
- Auth initialization → Square auth service: checks merchant session
src/hooks/useAuthInit.ts - Auth initialization → Customer auth API: checks customer session
src/hooks/useAuthInit.ts - Auth initialization → Redux store and reducers: dispatches auth state
src/hooks/useAuthInit.ts - Wishlist hook and API → Redux store and reducers: reads user state
src/hooks/useWishlist.ts - Wishlist hook and API → Commerce backend: loads and updates
- Redux store and reducers → Domain reducers: combines reducers
src/store.ts - Redux store and reducers → Search saga: runs sagas
src/store.ts - Search saga → Application API: fetches search results
src/saga/searchSaga.ts - Search saga → Square commerce API: loads inventory
src/saga/searchSaga.ts - Search saga → Domain reducers: dispatches results
src/saga/searchSaga.ts - Application API → Square commerce API: delegates catalog lookup
src/api/index.ts