How neruaka/janadistribution works
Jana Distribution is a B2B/B2C food-commerce platform. Its main customer journey runs from product discovery through a persistent cart and order creation, with account access for order history and invoices; a separate admin journey manages the catalog, customers, orders, promotions, statistics, and site settings. The README documents the frontend-to-REST-API boundary and PostgreSQL/optional Redis roles. Sampled source confirms selected controller, route, service, repository, and frontend responsibilities; links between unsampled modules are omitted where their wiring cannot be verified.
Main entry points: App.jsx React application · index.js Express API server · api.js HTTP client · AdminDashboard.jsx Admin screens
Components 23
Customer storefront
- React application
frontend/src/App.jsx - Catalog and product pages
frontend/src/pages/CataloguePage.jsx - Cart and checkout
frontend/src/pages/CartPage.jsx - Account and orders
frontend/src/pages/OrderHistoryPage.jsx - Auth and cart state
frontend/src/contexts/AuthContext.jsx - Product API client
frontend/src/services/productService.js - Cart API client
frontend/src/services/cartService.js - Order API client
frontend/src/services/orderService.js
Commerce API
- Authentication routes
backend/src/routes/auth.routes.js - Authentication logic
backend/src/services/auth.service.js - Product endpoints
backend/src/controllers/product.controller.js - Cart and order domain
backend/src/services/order.service.js
Administration
- Admin screens
frontend/src/pages/admin/AdminDashboard.jsx - Admin API client
frontend/src/services/adminService.js - Admin order routes
backend/src/routes/admin.order.routes.js - Site settings
backend/src/controllers/settings.controller.js
API runtime and state
- HTTP client
frontend/src/services/api.js - Express API server
backend/src/index.js
External services
- PostgreSQL
backend/src/config/database.js - Redis cache
backend/src/config/redis.js - Email delivery
backend/src/services/email.service.js - Image storage
backend/src/config/r2.js
Other components
- Shopper
Connections 26
- Shopper → React application: uses
- React application → Catalog and product pages: routes to
- React application → Cart and checkout: routes to
- React application → Account and orders: routes to
- React application → Auth and cart state: provides state
- Catalog and product pages → Product API client: requests products
- Cart and checkout → Cart API client: requests cart
- Cart and checkout → Order API client: submits orders
- Account and orders → Order API client: requests orders
- Product API client → HTTP client: sends requests
- Cart API client → HTTP client: sends requests
- Order API client → HTTP client: sends requests
- Admin screens → Admin API client: requests admin data
- Admin API client → HTTP client: sends requests
- HTTP client → Express API server: calls REST API
- Express API server → Authentication routes: mounts routes
- Authentication routes → Authentication logic: delegates auth
- Express API server → Product endpoints: mounts products
- Express API server → Admin order routes: mounts admin routes
- Product endpoints → PostgreSQL: reads and writes
- Admin order routes → PostgreSQL: queries orders
- Site settings → PostgreSQL: reads and writes
- Express API server → Redis cache: connects optionally
- Authentication logic → Email delivery: sends email
- Admin screens → Site settings: manages settings
- Admin screens → Image storage: uploads images