How serpenthedeceiver/zyro-frontend works
Zyro is a React frontend for a trust-focused second-hand marketplace. A buyer signs in by phone OTP, discovers a listing, contacts its seller, and can proceed through order and escrow tracking; sellers can create listings and manage their profiles. The UI routes these tasks through a selectable mock/live API layer, with listing images uploaded directly to Supabase Storage. The README documents local Spring services behind an API gateway, but those services are not in this repository. Several domain screens are documented but their implementation details were not sampled.
Main entry points: main.jsx Page routing · index.js API mode selector · ProfilePage.jsx Profile and listings · AuthContext.jsx Session and profile
Components 24
Application
- Page routing
src/main.jsx
Identity and seller access
- OTP sign-in
src/pages/AuthPage.jsx - Session and profile
src/context/AuthContext.jsx - Seller access
src/routes/VerifiedSellerRoute.jsx - KYC flow
src/pages/KYCPage.jsx - Profile and listings
src/pages/ProfilePage.jsx - Settings and notices
src/pages/SettingsPage.jsx
Marketplace
- Listing discovery
src/pages/HomePage.jsx - Product search
src/pages/ProductListPage.jsx - Product details
src/pages/ProductDetailPage.jsx - Create listing
src/pages/CreateListingPage.jsx - Image upload
src/hooks/useImageUpload.js - Buyer-seller chat
src/pages/ChatPage.jsx - Chat operations
src/hooks/useChat.js
Transactions
- Order views
src/pages/OrdersPage.jsx - Escrow order detail
src/pages/OrderDetailPage.jsx - Wallet activity
src/pages/WalletPage.jsx
API and state
- API mode selector
src/api/index.js - HTTP client
src/api/client.js - Shared local state
src/hooks/useLocalStorage.js
Other components
- Marketplace user
- Spring API gateway
- Supabase Storage
- Supabase Phone Auth
Connections 33
- Marketplace user → Page routing: uses
src/main.jsx - Page routing → OTP sign-in: routes to
src/main.jsx - Page routing → Listing discovery: routes to
src/main.jsx - Page routing → Product search: routes to
src/main.jsx - Page routing → Product details: routes to
src/main.jsx - Page routing → Create listing: routes to
src/main.jsx - Page routing → Buyer-seller chat: routes to
src/main.jsx - Page routing → Order views: routes to
src/main.jsx - Page routing → Escrow order detail: routes to
src/main.jsx - Page routing → Wallet activity: routes to
src/main.jsx - Page routing → Profile and listings: routes to
src/main.jsx - Page routing → Settings and notices: routes to
src/main.jsx - Page routing → KYC flow: routes to
src/main.jsx - OTP sign-in → Session and profile: requests OTP
src/pages/AuthPage.jsx - Session and profile → API mode selector: uses auth API
src/context/AuthContext.jsx - Seller access → Session and profile: checks access
src/routes/VerifiedSellerRoute.jsx - Create listing → Image upload: uploads images
src/pages/CreateListingPage.jsx - Image upload → Supabase Storage: stores images
README.md - Buyer-seller chat → Chat operations: uses chat hook
src/pages/ChatPage.jsx - Chat operations → API mode selector: uses chat API
src/hooks/useChat.js - Order views → API mode selector: loads orders
src/pages/OrdersPage.jsx - Escrow order detail → API mode selector: loads order
src/pages/OrderDetailPage.jsx - Wallet activity → API mode selector: loads wallet
src/pages/WalletPage.jsx - Profile and listings → Session and profile: updates profile
src/pages/ProfilePage.jsx - Profile and listings → API mode selector: loads listings
src/pages/ProfilePage.jsx - Listing discovery → API mode selector: loads products
src/pages/HomePage.jsx - Product search → API mode selector: loads products
src/pages/ProductListPage.jsx - Product details → API mode selector: uses marketplace API
src/pages/ProductDetailPage.jsx - Create listing → API mode selector: publishes listing
src/pages/CreateListingPage.jsx - API mode selector → HTTP client: selects live API
src/api/index.js - HTTP client → Spring API gateway: sends HTTP
README.md - API mode selector → Supabase Phone Auth: supports OTP auth
README.md - Profile and listings → Shared local state: shares UI state
src/pages/ProfilePage.jsx