How bear-system-brasil/bear-delivery-app-web works
Bear Delivery is a multi-role food-delivery web app. Customers discover restaurants, customize items, manage a cart, check out, and track orders; restaurant staff, cooks, finance users, and drivers have separate operational workspaces. The client centralizes backend requests through the Next.js proxy, while auth routes and middleware manage session-aware access. The README documents real-time kitchen, delivery, and notification updates. Most feature-page implementations were not sampled, so their internal call relationships are not asserted here.
Main entry points: api.ts API client · cart/page.tsx Shopping cart · checkout/page.tsx Checkout · useAuthModal.ts Authentication flow
Components 26
Customer ordering
- Restaurant discovery
src/app/(home)/page.tsx - Restaurant detail
src/app/restaurant/[id]/page.tsx - Item customization
src/components/customize-order/customize-order/index.tsx - Shopping cart
src/app/cart/page.tsx - Checkout
src/app/checkout/page.tsx - Order tracking
src/app/order-status/page.tsx
Restaurant operations
- Menu and categories
src/app/menu-management/page.tsx - Order management
src/app/orders/page.tsx - Kitchen display
src/components/kitchen/index.tsx - Financial management
src/app/financial-management/dashboard/page.tsx - Delivery dashboard
src/app/delivery-dashboard/page.tsx - Team management
src/app/team-management/page.tsx - Notifications
src/providers/notifications-provider.tsx
Platform services
- API client
src/services/api.ts - Backend proxy
src/app/api/proxy/[...path]/route.ts - Cart state
src/stores/cart-store.ts - Browser storage
src/utils/storage-manager.ts
Identity and access
- Authentication dialog
src/components/auth-modal/index.tsx - Authentication flow
src/hooks/useAuthModal.ts - Auth state
src/stores/auth-store.ts - Auth API routes
src/app/api/auth/login/route.ts - Session cookie
src/lib/session.ts - Role route guard
src/middleware.ts - Role helpers
src/utils/role-helpers.ts
Other components
- Customer
- Delivery backend
Connections 25
- Customer → Restaurant discovery: browses
README.md - Restaurant discovery → Restaurant detail: opens
README.md - Restaurant detail → Item customization: customizes
README.md - Item customization → Shopping cart: adds items
README.md - Shopping cart → Checkout: checks out
README.md - Checkout → API client: submits order
- Checkout → Order tracking: tracks order
README.md - Shopping cart → Cart state: uses state
- Menu and categories → API client: manages menu
- Order management → API client: manages orders
- Kitchen display → API client: handles orders
- Financial management → API client: loads finances
- Delivery dashboard → API client: updates delivery
- Team management → API client: manages staff
- Notifications → API client: loads feed
- API client → Backend proxy: requests through
src/services/api.ts - Backend proxy → Delivery backend: forwards requests
README.md - Authentication dialog → Authentication flow: renders
src/components/auth-modal/index.tsx - Authentication flow → API client: authenticates
src/hooks/useAuthModal.ts - Authentication flow → Auth state: updates session
src/hooks/useAuthModal.ts - Auth API routes → Session cookie: sets cookie
src/app/api/auth/login/route.ts - Auth API routes → Delivery backend: authenticates with
- Auth state → Browser storage: persists via
src/stores/auth-store.ts - Role route guard → Role helpers: checks roles
src/middleware.ts - Role route guard → Auth state: checks identity