How saumya028/local-mart works
LocalMart is a multi-vendor marketplace: customers browse products, maintain a cart and address, place per-shop orders, and track payment and fulfillment; shops manage catalog, orders, returns, and payment settings, while administrators manage platform settings and users. The frontend calls a FastAPI backend, which authenticates Supabase sessions and persists marketplace state in Postgres, with Redis supporting cart, cache, and rate-limit behavior. The README documents direct UPI/cash payments and major customer, shop, and admin capabilities. Some frontend-to-endpoint wiring and unsampled modules are not shown, so those links are omitted.
Main entry points: main.py API application · db.py Postgres · orders.py Orders and payments · auth.py Authentication
Components 28
Customer storefront
- Browse storefront
frontend/app/page.tsx - Product detail
frontend/app/product/[id]/page.tsx - Cart and checkout
frontend/app/checkout/page.tsx - Order tracking
frontend/app/orders/[id]/page.tsx - Account and returns
frontend/app/profile/page.tsx - Shop dashboard
frontend/app/shop/dashboard/page.tsx - Admin panel
frontend/app/admin/page.tsx - API client
frontend/lib/apiClient.ts
Marketplace API
- API application
backend/app/main.py - Authentication
backend/app/routers/auth.py - Catalog and shops
backend/app/routers/products.py - Cart operations
backend/app/routers/cart.py - Orders and payments
backend/app/routers/orders.py - Returns
backend/app/routers/returns.py - Shop operations
backend/app/routers/shop_dashboard.py - Administration
backend/app/routers/admin.py
Domain services
- JWT and roles
backend/app/core/security.py - Payment confirmation
backend/app/core/payment_confirmation.py - Cart service
backend/app/core/cart.py - Order lifecycle
backend/app/core/order_status.py - Return lifecycle
backend/app/core/return_status.py
Platform services
- Postgres
backend/app/core/db.py - Redis client
backend/app/core/redis_client.py - Rate limiting
backend/app/core/rate_limit.py - Request logging
backend/app/core/logging_config.py
Other components
- Customer
- Shop operator
- Administrator
Connections 30
- Customer → Browse storefront: browses
- Customer → Product detail: views products
- Customer → Cart and checkout: checks out
- Customer → Order tracking: tracks orders
- Customer → Account and returns: manages account
- Shop operator → Shop dashboard: manages shop
- Administrator → Admin panel: manages platform
- API client → API application: sends requests
frontend/lib/apiClient.ts - API application → Authentication: registers
backend/app/main.py - API application → Catalog and shops: registers
backend/app/main.py - API application → Cart operations: registers
backend/app/main.py - API application → Orders and payments: registers
backend/app/main.py - API application → Returns: registers
backend/app/main.py - API application → Shop operations: registers
backend/app/main.py - API application → Administration: registers
backend/app/main.py - Authentication → JWT and roles: verifies identity
backend/app/routers/auth.py - Authentication → Postgres: opens session
backend/app/routers/auth.py - Cart operations → Cart service: uses cart service
backend/app/routers/cart.py - Cart operations → Postgres: opens session
backend/app/routers/cart.py - Orders and payments → Cart service: uses cart service
backend/app/routers/orders.py - Orders and payments → Payment confirmation: confirms payment
backend/app/routers/orders.py - Orders and payments → Order lifecycle: uses lifecycle
backend/app/routers/orders.py - Orders and payments → Postgres: opens session
backend/app/routers/orders.py - Returns → Return lifecycle: uses lifecycle
backend/app/routers/returns.py - Returns → Postgres: opens session
backend/app/routers/returns.py - Shop operations → Postgres: opens session
- Administration → Postgres: opens session
backend/app/routers/admin.py - Authentication → Rate limiting: limits requests
backend/app/routers/auth.py - Rate limiting → Redis client: uses Redis
backend/app/core/rate_limit.py - API application → Request logging: configures logging
backend/app/main.py