How 68319010007-gif/wedapp-inventra works
Inventra combines staff inventory/sales administration with an online customer storefront. Customers browse products, manage a cart, check out, track orders, and submit payment; staff manage stock, purchasing, sales, payments, and reporting. The React app routes these experiences to an Express REST API backed by Prisma/PostgreSQL, with documented real-time stock updates. The graph preserves major README capabilities, but several route implementations were not sampled, so uncertain links are omitted.
Main entry points: app.js REST route mount · App.jsx Web app routing · database.js Prisma database client · store.routes.js Store catalog and orders
Components 33
React experiences
- Web app routing
frontend/src/App.jsx - Storefront
frontend/src/pages/store - Customer account
frontend/src/pages/store - Admin workspace
frontend/src/pages - Cart state
frontend/src/store/CartContext.jsx - Customer session
frontend/src/store/StoreAuthContext.jsx - Store settings
frontend/src/store/SiteSettingsContext.jsx - Store API client
frontend/src/services/storeApi.js - Admin API client
frontend/src/services/api.js - Stock updates
frontend/src/utils/useStockUpdates.js
Commerce API
- Store authentication
backend/src/routes/storeAuth.routes.js - Store catalog and orders
backend/src/routes/store.routes.js - Customer addresses
backend/src/routes/addresses.routes.js
Operations API
- Product catalog
backend/src/routes/products.routes.js - Inventory movements
backend/src/routes/inventory.routes.js - Sales orders
backend/src/routes/sales.routes.js - Purchasing
backend/src/routes/purchases.routes.js - Payment review
backend/src/routes/payments.routes.js - Payment channels
backend/src/routes/paymentChannels.routes.js - Reports and dashboard
backend/src/routes/reports.routes.js - Staff and settings
backend/src/routes
Shared platform
- REST route mount
backend/src/app.js - Staff authorization
backend/src/middleware/auth.js - Customer authorization
backend/src/middleware/customerAuth.js - Audit logging
backend/src/middleware/auditLog.js - File uploads
backend/src/middleware/upload.js - Stock operations
backend/src/utils/stock.js - Socket.IO service
backend/src/socket.js - Public settings
backend/src/utils/siteSettings.js - Prisma database client
backend/src/config/database.js
Other components
- Customer
- Staff
- PostgreSQL
Connections 46
- Customer → Web app routing: uses storefront
README.md - Staff → Web app routing: uses admin
README.md - Web app routing → Storefront: routes storefront
frontend/src/App.jsx - Web app routing → Customer account: routes account
frontend/src/App.jsx - Web app routing → Admin workspace: routes admin
frontend/src/App.jsx - Storefront → Cart state: uses cart state
- Customer account → Customer session: uses customer session
- Web app routing → Store settings: provides settings
frontend/src/App.jsx - Store settings → Store API client: fetches settings
frontend/src/store/SiteSettingsContext.jsx - Customer session → Store API client: sends auth requests
frontend/src/store/StoreAuthContext.jsx - Storefront → Store API client: requests store data
frontend/src/pages/store/AddressesPage.jsx - Admin workspace → Admin API client: requests admin data
frontend/src/pages/SalesPage.jsx - Web app routing → Stock updates: uses stock updates
- Store API client → REST route mount: calls REST API
- Admin API client → REST route mount: calls REST API
- REST route mount → Store authentication: mounts routes
backend/src/app.js - REST route mount → Store catalog and orders: mounts routes
backend/src/app.js - REST route mount → Customer addresses: mounts routes
backend/src/app.js - REST route mount → Product catalog: mounts routes
backend/src/app.js - REST route mount → Inventory movements: mounts routes
backend/src/app.js - REST route mount → Sales orders: mounts routes
backend/src/app.js - REST route mount → Purchasing: mounts routes
backend/src/app.js - REST route mount → Reports and dashboard: mounts routes
backend/src/app.js - REST route mount → Staff and settings: mounts routes
backend/src/app.js - REST route mount → Payment review: mounts routes
backend/src/app.js - REST route mount → Payment channels: mounts routes
backend/src/app.js - Store catalog and orders → Customer authorization: authenticates customers
backend/src/routes/store.routes.js - Customer addresses → Customer authorization: authenticates customers
backend/src/routes/addresses.routes.js - Sales orders → Staff authorization: authenticates staff
backend/src/routes/sales.routes.js - Product catalog → Staff authorization: authenticates staff
backend/src/routes/products.routes.js - Sales orders → Stock operations: adjusts stock
backend/src/routes/sales.routes.js - Store catalog and orders → Stock operations: restores stock
backend/src/routes/store.routes.js - Purchasing → Socket.IO service: broadcasts stock changes
backend/src/routes/purchases.routes.js - Sales orders → Audit logging: records actions
backend/src/routes/sales.routes.js - Payment channels → Audit logging: records actions
backend/src/routes/paymentChannels.routes.js - Store catalog and orders → File uploads: accepts payment slips
backend/src/routes/store.routes.js - Product catalog → File uploads: accepts product images
backend/src/routes/products.routes.js - Store catalog and orders → Public settings: formats public settings
backend/src/routes/store.routes.js - Store authentication → Prisma database client: reads and writes
backend/src/routes/storeAuth.routes.js - Customer addresses → Prisma database client: reads and writes
backend/src/routes/addresses.routes.js - Store catalog and orders → Prisma database client: reads and writes
backend/src/routes/store.routes.js - Product catalog → Prisma database client: reads and writes
backend/src/routes/products.routes.js - Sales orders → Prisma database client: reads and writes
backend/src/routes/sales.routes.js - Purchasing → Prisma database client: reads and writes
backend/src/routes/purchases.routes.js - Prisma database client → PostgreSQL: persists data
- Socket.IO service → Stock updates: broadcasts stock events