How nguyenbrandon327/r-mart works
R-Mart is a UCR-student marketplace. Students browse and search listings, create or manage products, and can message sellers; the frontend is a Next.js app and the backend is an Express API backed by PostgreSQL. The tree and excerpts also show accounts, saved/recent products, real-time messaging, and an AI assistant. Several frontend-to-API links and unsampled feature internals are not shown, so those relationships are left unverified rather than asserted.
Main entry points: productController.ts Product workflows · chatbotService.ts Agent orchestration · messageController.ts Messaging workflows · server.ts Express API
Components 28
Marketplace experience
- Browse listings
frontend/app/all-listings/page.tsx - Search listings
frontend/app/search/page.tsx - Create listing
frontend/app/add-listing/page.tsx - Account onboarding
frontend/app/auth/onboarding/page.tsx - Product details
frontend/app/product/[slug]/page.tsx - Buyer-seller inbox
frontend/app/inbox/[chatId]/page.tsx - Saved products
frontend/app/saved/page.tsx
Client state
- Redux state
frontend/store/slices/productSlice.ts - Search state
frontend/store/slices/searchSlice.ts - Auth state
frontend/store/slices/authSlice.ts
API and domain services
- Express API
backend/server.ts - Product workflows
backend/controllers/productController.ts - Search service
backend/controllers/searchController.ts - Account workflows
backend/controllers/userController.ts - Messaging workflows
backend/controllers/messageController.ts - Authentication
backend/controllers/authController.ts
Persistence and integrations
- PostgreSQL
backend/config/db.ts - Meilisearch
backend/config/meilisearch.ts - Image storage
backend/utils/s3.ts - Live messaging
backend/socket/socket.ts
AI assistant
- Chatbot endpoints
backend/routes/chatbotRoutes.ts - Chatbot controller
backend/controllers/chatbotController.ts - Agent orchestration
backend/langchain/services/chatbotService.ts - Intent router
backend/langchain/agents/routerAgent.ts - Buyer assistant
backend/langchain/agents/buyerAgent.ts - Seller copilot
backend/langchain/agents/sellerAgent.ts - Support and safety
backend/langchain/agents/supportAgent.ts
Other components
- UCR student
Connections 36
- UCR student → Browse listings: browses
- UCR student → Search listings: searches
- UCR student → Create listing: posts listings
- UCR student → Buyer-seller inbox: messages sellers
- Browse listings → Redux state: uses state
frontend/app/all-listings/page.tsx - Search listings → Search state: dispatches search
frontend/app/search/page.tsx - Create listing → Redux state: dispatches product
frontend/app/add-listing/page.tsx - Account onboarding → Auth state: dispatches auth
frontend/app/auth/onboarding/page.tsx - Browse listings → Product workflows: fetches listings
- Search listings → Search service: queries catalog
- Create listing → Product workflows: submits listing
- Account onboarding → Authentication: submits account
- Buyer-seller inbox → Messaging workflows: loads conversations
- Express API → Product workflows: routes products
backend/server.ts - Express API → Authentication: routes auth
backend/server.ts - Express API → Messaging workflows: routes messages
backend/server.ts - Express API → Chatbot endpoints: mounts chatbot
backend/server.ts - Chatbot endpoints → Chatbot controller: dispatches requests
backend/routes/chatbotRoutes.ts - Product workflows → PostgreSQL: reads and writes
backend/controllers/productController.ts - Product workflows → Search service: indexes products
backend/controllers/productController.ts - Product workflows → Image storage: manages images
backend/controllers/productController.ts - Search service → Meilisearch: searches index
backend/controllers/searchController.ts - Account workflows → PostgreSQL: reads and writes
backend/controllers/userController.ts - Account workflows → Image storage: manages profile images
backend/controllers/userController.ts - Authentication → PostgreSQL: reads and writes
backend/controllers/authController.ts - Messaging workflows → PostgreSQL: stores messages
backend/controllers/messageController.ts - Messaging workflows → Live messaging: emits messages
backend/controllers/messageController.ts - Messaging workflows → Image storage: uploads images
backend/controllers/messageController.ts - Chatbot controller → Agent orchestration: uses assistant
- Agent orchestration → Intent router: routes intent
backend/langchain/services/chatbotService.ts - Agent orchestration → Buyer assistant: dispatches buyer
backend/langchain/services/chatbotService.ts - Agent orchestration → Seller copilot: dispatches seller
backend/langchain/services/chatbotService.ts - Agent orchestration → Support and safety: dispatches support
backend/langchain/services/chatbotService.ts - Intent router → Buyer assistant: selects agent
- Intent router → Seller copilot: selects agent
- Intent router → Support and safety: selects agent