How haimni/freshflow-b2b-ordering-platform works
FreshFlow is a B2B ordering platform with a React client and FastAPI backend. The intended customer journey spans registration or login, customer catalog access, order placement and order history; administrators have catalog, inventory and order-management areas. The tree identifies these domain areas, but most page, route and service implementations were not sampled, so uncertain call wiring is omitted. The sampled authentication flow and application/router setup support the explicit connections shown.
Main entry points: router.py Versioned router · auth.py Auth routes · http.ts HTTP transport · App.tsx App shell
Components 34
Web client
- App shell
client/src/App.tsx - Home and auth UI
client/src/pages/HomePage.tsx - Role dashboard
client/src/pages/DashboardPage.tsx - Customer catalog
client/src/pages/CustomerCatalogPage.tsx - Customer orders
client/src/pages/CustomerOrdersPage.tsx - Cart panel
client/src/components/CartPanel.tsx - Admin catalog
client/src/pages/AdminCatalogPage.tsx - Admin inventory
client/src/pages/AdminInventoryPage.tsx - Admin orders
client/src/pages/AdminOrdersPage.tsx - Auth API client
client/src/api/auth.ts - Catalog API clients
client/src/api/customerCatalog.ts - Order API clients
client/src/api/customerOrders.ts - Admin API clients
client/src/api/adminCatalog.ts - HTTP transport
client/src/api/http.ts
API backend
- FastAPI application
server/app/main.py - Versioned router
server/app/api/v1/router.py - Auth routes
server/app/api/v1/routes/auth.py - Customer routes
server/app/api/v1/routes/customer_catalog.py - Order routes
server/app/api/v1/routes/customer_orders.py - Admin routes
server/app/api/v1/routes
Domain services
- Authentication
server/app/services/auth.py - Customer registration
server/app/services/registration.py - Catalog services
server/app/services/customer_catalog.py - Order services
server/app/services/orders.py - Inventory services
server/app/services/inventory.py - Admin catalog services
server/app/services/admin_catalog.py - Admin order services
server/app/services/admin_orders.py
Identity and data
- Auth and roles
server/app/deps/auth.py - Token security
server/app/core/security.py - DB sessions
server/app/db/session.py - Domain models
server/app/models - SQL database
Other components
- Customer or admin
- API service
Connections 25
- Customer or admin → App shell: uses
- App shell → Home and auth UI: shows
- App shell → Role dashboard: shows
- App shell → Auth API client: restores session
- Auth API client → HTTP transport: requests
- Catalog API clients → HTTP transport: requests
- Order API clients → HTTP transport: requests
- Admin API clients → HTTP transport: requests
- HTTP transport → API service: HTTP
- FastAPI application → Versioned router: mounts
- Versioned router → Auth routes: dispatches
- Versioned router → Customer routes: dispatches
- Versioned router → Order routes: dispatches
- Versioned router → Admin routes: dispatches
- API service → FastAPI application: serves requests
- Auth routes → Authentication: authenticates
- Auth routes → Customer registration: registers customer
- Auth routes → Token security: creates token
- Auth routes → Auth and roles: requires user
- Authentication → DB sessions: queries through
- Authentication → Token security: verifies password
- Auth and roles → Token security: decodes token
- Auth and roles → DB sessions: loads user
- DB sessions → SQL database: connects
- Domain models → SQL database: maps entities