How ipgoutam/g-mart works
G-MART is a grocery-shopping application with a React customer storefront and admin console backed by a FastAPI service. Shoppers browse products, manage a cart, check out, and track orders; administrators manage catalog, inventory, orders, payments, and store operations. The frontend routes users into these experiences and uses a shared API client; the backend registers API routers over database-backed models. Notification delivery is a distinct capability. Several feature modules were not sampled, so their internal calls and some frontend-to-backend links are not asserted.
Main entry points: main.py FastAPI application · App.tsx Route application · customer Customer storefront · api.ts API client
Components 22
Web experience
- Route application
frontend/web/src/App.tsx - Customer storefront
frontend/web/src/pages/customer - Admin console
frontend/web/src/pages/admin - Sign-in UI
frontend/web/src/pages/auth/Login.tsx - Auth state
frontend/web/src/context/AuthContext.tsx - Cart state
frontend/web/src/context/CartContext.tsx - API client
frontend/web/src/services/api.ts - Theme preference
frontend/web/src/hooks/useTheme.ts
Commerce API
- Authentication
backend/app/routers/auth.py - Product catalog
backend/app/routers/products.py - Product details
backend/app/routers/product_details.py - Cart operations
backend/app/routers/cart.py - Order lifecycle
backend/app/routers/orders.py - Payments
backend/app/routers/payments.py
Store operations
- Store management
backend/app/routers - Notification delivery
backend/app/services/notification_service.py
Backend platform
- FastAPI application
backend/app/main.py - SQL database
backend/app/database.py
Other components
- Shopper
- Administrator
- Razorpay
- Email and SMS
Connections 26
- Shopper → Route application: uses storefront
frontend/web/src/App.tsx - Administrator → Route application: uses console
frontend/web/src/App.tsx - Route application → Customer storefront: routes customers
frontend/web/src/App.tsx - Route application → Admin console: routes admins
frontend/web/src/App.tsx - Route application → Sign-in UI: routes sign-in
frontend/web/src/App.tsx - Sign-in UI → Auth state: calls login
frontend/web/src/pages/auth/Login.tsx - Auth state → API client: requests profile
frontend/web/src/context/AuthContext.tsx - Cart state → Auth state: reads identity
frontend/web/src/context/CartContext.tsx - Cart state → API client: syncs cart
frontend/web/src/context/CartContext.tsx - Customer storefront → API client: fetches store data
frontend/web/src/pages/customer/Home.tsx - Customer storefront → Cart state: manages cart
frontend/web/src/pages/customer/ProductDetails.tsx - Customer storefront → Theme preference: uses theme
frontend/web/src/pages/customer/Home.tsx - API client → FastAPI application: sends HTTP requests
- FastAPI application → Authentication: registers router
backend/app/main.py - FastAPI application → Product catalog: registers router
backend/app/main.py - FastAPI application → Product details: registers router
backend/app/main.py - FastAPI application → Cart operations: registers router
backend/app/main.py - FastAPI application → Order lifecycle: registers router
backend/app/main.py - FastAPI application → Payments: registers router
backend/app/main.py - FastAPI application → Store management: registers routers
backend/app/main.py - Order lifecycle → Notification delivery: creates order alerts
backend/app/routers/orders.py - Notification delivery → Email and SMS: sends messages
backend/app/services/notification_service.py - Order lifecycle → SQL database: queries and writes
backend/app/routers/orders.py - Authentication → SQL database: uses sessions
backend/app/routers/auth.py - FastAPI application → SQL database: initializes tables
backend/app/main.py - Payments → Razorpay: payment integration