How programing360/fresh-root works
Fresh Root is an organic-food e-commerce application. Shoppers browse and filter products, inspect product details, and use the shopping and order flows; authenticated users can manage products through a dashboard. The map includes the documented search, inventory, and product-card capabilities, plus the homepage content subsystem. Some backend behavior is described only in the README, and several routes and helpers were not sampled, so those connections are omitted or marked unverified rather than inferred.
Main entry points: products.ts Product API · server.ts Server Requests · auth-client.ts Auth Client · page.tsx Home Page
Components 27
Storefront
- Home Page
src/app/(public)/page.tsx - Home Sections
src/components/sections - Site Navigation
src/components/Global/Navbar.tsx
Product Shopping
- Product Search
src/app/(public)/shop/shop.tsx - Product Cards
src/components/ProductCard.tsx - Product Detail Route
src/app/(public)/shop/[id]/page.tsx - Product Details
src/app/(public)/shop/[id]/ProductDetails.tsx - Product API
src/lib/api/products.ts - Cart API
src/lib/api/cart.ts - Orders Page
src/app/(public)/orders/page.tsx - Product Model
src/types/product.ts
Identity & Access
- Login Page
src/app/auth/login/Login.tsx - Registration Page
src/app/auth/register/Register.tsx - Auth Client
src/lib/auth-client.ts - Client Session
src/lib/core/session-client.ts - Auth Route
src/app/api/auth/[...all]/route.ts - Auth Service
src/lib/auth.ts - MongoDB Auth Store
- Server Requests
src/lib/core/server.ts - Server Session
src/lib/core/session.ts
Catalog Operations
- Dashboard Home
src/app/(userDashboard)/dashboard/page.tsx - Dashboard Overview
src/components/dashboard/UserDashboardHome.tsx - Add Product Form
src/app/(userDashboard)/dashboard/item/add/page.tsx - Product Add Action
src/lib/action/product-add.ts - Item Management
src/components/dashboard/ItemManagementTable.tsx
Other components
- Shopper
- Commerce Backend
Connections 32
- Shopper → Home Page: browses
- Home Page → Home Sections: renders
src/app/(public)/page.tsx - Home Page → Product API: loads products
src/app/(public)/page.tsx - Shopper → Product Search: searches catalog
- Product Search → Product API: queries products
src/app/(public)/shop/shop.tsx - Product Search → Product Cards: renders items
src/app/(public)/shop/shop.tsx - Product Cards → Product Detail Route: opens preview
src/components/ProductCard.tsx - Product Detail Route → Product Details: renders details
src/app/(public)/shop/[id]/page.tsx - Product Detail Route → Product API: loads product
src/app/(public)/shop/[id]/page.tsx - Product API → Commerce Backend: requests catalog data
src/lib/api/products.ts - Product API → Server Requests: uses protected requests
src/lib/api/products.ts - Product API → Product Model: types product data
src/lib/api/products.ts - Shopper → Orders Page: views orders
- Product Cards → Cart API: cart actions
- Shopper → Login Page: signs in
- Shopper → Registration Page: registers
- Login Page → Auth Client: authenticates
- Registration Page → Auth Client: creates account
- Site Navigation → Auth Client: uses auth
src/components/Global/Navbar.tsx - Site Navigation → Client Session: reads session
src/components/Global/Navbar.tsx - Client Session → Auth Client: reads session
src/lib/core/session-client.ts - Auth Route → Auth Service: dispatches requests
src/app/api/auth/[...all]/route.ts - Auth Service → MongoDB Auth Store: persists auth data
src/lib/auth.ts - Shopper → Dashboard Home: manages catalog
- Dashboard Home → Dashboard Overview: renders overview
src/app/(userDashboard)/dashboard/page.tsx - Dashboard Home → Product API: loads products
src/app/(userDashboard)/dashboard/page.tsx - Add Product Form → Product Add Action: submits product
src/app/(userDashboard)/dashboard/item/add/page.tsx - Product Add Action → Server Requests: posts product
src/lib/action/product-add.ts - Item Management → Product API: updates catalog
src/components/dashboard/ItemManagementTable.tsx - Server Requests → Server Session: gets user token
src/lib/core/server.ts - Server Requests → Commerce Backend: sends requests
src/lib/core/server.ts - Server Session → Auth Service: reads auth session
src/lib/core/session.ts