How saad-mrk/lbal works
LBAL is a Moroccan buy-and-sell marketplace frontend. Visitors browse and search ads, open listings, and can sign in to publish ads or use account features such as messaging, favorites, and profile management. The router dispatches URLs to page components, while application-wide contexts provide authentication, cart, language, user, and notification state. The sampled code confirms authentication and notification API behavior; the README contains no product documentation, so several page-level integrations and backend relationships remain unverified.
Main entry points: AppRouter.tsx Route dispatcher · App.tsx App providers · notificationService.ts Notification service · auth.api.ts Authentication API
Components 23
Application shell
- App providers
src/App.tsx - Route dispatcher
src/routes/AppRouter.tsx - Language settings
src/contexts/LanguageContext.tsx
Marketplace
- Marketplace home
src/pages/Index.tsx - Search interface
src/components/search/HeroSearch.tsx - Ad details
src/pages/AdDetails.tsx - Create listing
src/pages/CreateAd.tsx
Accounts and activity
- Login and signup
src/pages/Login.tsx - Authentication form
src/features/auth/useAuthForm.ts - Authentication state
src/contexts/AuthContext.tsx - Profile and settings
src/pages/Profile.tsx - User dashboard
src/pages/UserDashboard.tsx - Messaging
src/pages/Messages.tsx - Favorites
src/pages/Favorites.tsx - Shopping cart
src/pages/Cart.tsx - Cart state
src/contexts/CartContext.tsx - Notification state
src/contexts/NotificationContext.tsx
API and services
- Ads API
src/api/ads.api.ts - Authentication API
src/api/auth.api.ts - Notification service
src/services/notificationService.ts
Other components
- Visitor
- Marketplace backend
- SignalR notifications
Connections 26
- Visitor → Route dispatcher: opens routes
src/routes/AppRouter.tsx - App providers → Route dispatcher: renders
src/App.tsx - Route dispatcher → Marketplace home: routes to
src/routes/AppRouter.tsx - Route dispatcher → Ad details: routes to
src/routes/AppRouter.tsx - Route dispatcher → Create listing: protects route
src/routes/AppRouter.tsx - Route dispatcher → Login and signup: routes to
src/routes/AppRouter.tsx - Route dispatcher → User dashboard: protects route
src/routes/AppRouter.tsx - Route dispatcher → Messaging: protects route
src/routes/AppRouter.tsx - Route dispatcher → Favorites: protects route
src/routes/AppRouter.tsx - Route dispatcher → Shopping cart: routes to
src/routes/AppRouter.tsx - Marketplace home → Search interface: renders
src/pages/Index.tsx - Login and signup → Authentication form: uses
- Authentication form → Authentication API: calls
src/features/auth/useAuthForm.ts - Authentication state → Authentication API: calls
src/contexts/AuthContext.tsx - Authentication API → Marketplace backend: requests auth
src/api/auth.api.ts - Create listing → Marketplace backend: submits listing
- Ads API → Marketplace backend: requests ads
- App providers → Authentication state: provides
src/App.tsx - App providers → Cart state: provides
src/App.tsx - App providers → Language settings: provides
src/App.tsx - App providers → Notification state: provides
src/App.tsx - Shopping cart → Cart state: uses
- Notification state → Notification service: uses
src/contexts/NotificationContext.tsx - Notification service → Marketplace backend: requests notifications
src/services/notificationService.ts - Notification service → SignalR notifications: builds connection
src/services/notificationService.ts - Ad details → Ads API: loads listing