How kmbandillo/farm-to-table works
AgriLink is a farm-products storefront with customer and administrator experiences. Customers sign in, browse products, build a cart, check out, and manage orders and profiles; administrators manage the catalog and accounts, process orders, and review sales. The graph preserves these distinct workflows and the backend’s authentication, catalog, user, transaction, and persistence layers. Frontend-to-API calls are not shown in the sampled excerpts, so those links are omitted; UI composition and backend routing are supported by the source index and excerpts.
Main entry points: main.jsx Role-based routes · router.js API routes · transactionController.js Transaction handlers · StorePage.jsx Product storefront
Components 28
Customer storefront
- Customer home
frontend/src/components/Customer/CustomerHome.jsx - Product storefront
frontend/src/components/Customer/StorePage.jsx - Product card
frontend/src/components/Customer/ProductCard.jsx - Shopping cart
frontend/src/components/Customer/ShoppingCart.jsx - Checkout
frontend/src/components/Customer/CheckoutPage.jsx - Customer orders
frontend/src/components/Customer/CustomerOrders.jsx - Customer profile
frontend/src/components/Customer/ProfilePage.jsx
Admin console
- Admin dashboard
frontend/src/components/Admin/AdminHome.jsx - Catalog management
frontend/src/components/Admin/AdminCatalog.jsx - Product form
frontend/src/components/Admin/ProductForm.jsx - Product listings
frontend/src/components/Admin/ProductsPage.jsx - Account management
frontend/src/components/Admin/AdminAccounts.jsx - Order processing
frontend/src/components/Admin/AdminOrders.jsx - Sales reporting
frontend/src/components/Admin/AdminSales.jsx
Identity and access
- Sign in
frontend/src/components/SignIn.jsx - Sign up
frontend/src/components/SignUp.jsx - Role-based routes
frontend/src/main.jsx
Backend API
- HTTP server
backend/server.js - API routes
backend/router.js - Authentication handlers
backend/controllers/authController.js - Product handlers
backend/controllers/productController.js - User handlers
backend/controllers/userController.js - Transaction handlers
backend/controllers/transactionController.js
Domain data
- User records
backend/models/User.js - Product records
backend/models/Product.js - Transaction records
backend/models/Transaction.js
Other components
- Shopper or admin
- MongoDB
Connections 31
- Shopper or admin → Sign in: opens
- Shopper or admin → Sign up: opens
- Sign in → Role-based routes: authenticates via
frontend/src/main.jsx - Sign up → Role-based routes: registers via
frontend/src/main.jsx - Role-based routes → Customer home: routes to
frontend/src/main.jsx - Role-based routes → Product storefront: routes to
frontend/src/main.jsx - Role-based routes → Checkout: routes to
frontend/src/main.jsx - Role-based routes → Customer orders: routes to
frontend/src/main.jsx - Role-based routes → Customer profile: routes to
frontend/src/main.jsx - Role-based routes → Admin dashboard: routes to
frontend/src/main.jsx - Role-based routes → Catalog management: routes to
frontend/src/main.jsx - Role-based routes → Account management: routes to
frontend/src/main.jsx - Role-based routes → Order processing: routes to
frontend/src/main.jsx - Role-based routes → Sales reporting: routes to
frontend/src/main.jsx - Product storefront → Product card: renders
frontend/src/components/Customer/StorePage.jsx - Product storefront → Shopping cart: renders
frontend/src/components/Customer/StorePage.jsx - Shopping cart → Checkout: proceeds to
- Catalog management → Product form: renders
frontend/src/components/Admin/AdminCatalog.jsx - Catalog management → Product listings: renders
frontend/src/components/Admin/AdminCatalog.jsx - HTTP server → API routes: mounts
backend/server.js - API routes → Authentication handlers: routes auth to
backend/router.js - API routes → Product handlers: routes products to
backend/router.js - API routes → User handlers: routes users to
backend/router.js - API routes → Transaction handlers: routes transactions to
backend/router.js - Authentication handlers → User records: reads and writes
backend/controllers/authController.js - Product handlers → Product records: reads and writes
backend/controllers/productController.js - User handlers → User records: reads and writes
backend/controllers/userController.js - Transaction handlers → Transaction records: reads and writes
backend/controllers/transactionController.js - Transaction handlers → User records: updates
backend/controllers/transactionController.js - Transaction handlers → Product records: updates
backend/controllers/transactionController.js - HTTP server → MongoDB: connects to
backend/server.js