How sriram-arch616/campusmart works
CampusMarketPlace is a campus-only marketplace for listing, discovering, and trading items. Students use the browser client to authenticate, browse or manage listings, and communicate; the Express API handles requests, applies authentication and feature logic, and stores marketplace state in MySQL. Distinct product capabilities include listing search and image uploads, chat and trade requests, notifications, admin management, and support tickets. The README documents Redis-backed Socket.io scaling and Cloudinary storage; excerpts do not expose every integration path, so some capability links are documented rather than source-traced.
Main entry points: js Web client · db.js MySQL · app.js Express app · productRoutes.js Product routes
Components 28
Browser client
- Web client
frontend/js - Account UI
frontend/js/utils/auth.js - Marketplace UI
frontend/js/dashboard.js - Listing UI
frontend/js/addProduct.js - Profile UI
frontend/js/profile.js - Chat UI
frontend/js/chat.js - Notification UI
frontend/js/utils/notifications.js
API and security
- HTTP server
backend/server.js - Express app
backend/src/app.js - Auth routes
backend/src/routes/authRoutes.js - Authentication
backend/src/controllers/authController.js - Auth service
backend/src/services/authService.js - Token middleware
backend/src/middleware/authMiddleware.js
Marketplace workflows
- Product routes
backend/src/routes/productRoutes.js - Product handling
backend/src/controllers/productController.js - Product service
backend/src/services/productService.js - Image upload
backend/src/middleware/uploadMiddleware.js
Community features
- Chat routes
backend/src/routes/chatRoutes.js - Chat and trades
backend/src/controllers/chatController.js - Realtime messaging
backend/src/config/socket.js - Support tickets
backend/src/controllers/supportController.js - Admin management
backend/src/controllers/adminController.js - Notifications
backend/src/services/notificationService.js
Data and integrations
- MySQL
backend/src/config/db.js - Cloudinary images
backend/src/config/cloudinary.js - Email delivery
backend/src/services/emailService.js - Redis adapter
Other components
- Student
Connections 34
- Student → Web client: uses
README.md - Web client → HTTP server: calls API
README.md - Web client → Realtime messaging: opens realtime
README.md - Account UI → Web client: renders account
- Marketplace UI → Web client: renders listings
- Listing UI → Web client: submits listings
- Profile UI → Web client: manages profile
- Chat UI → Web client: renders chat
- Notification UI → Web client: renders notices
- HTTP server → Express app: serves HTTP
backend/server.js - Express app → Auth routes: mounts routes
backend/src/app.js - Express app → Product routes: mounts routes
backend/src/app.js - Express app → Chat routes: mounts routes
backend/src/app.js - Auth routes → Authentication: dispatches
backend/src/routes/authRoutes.js - Auth routes → Token middleware: protects endpoint
backend/src/routes/authRoutes.js - Authentication → Auth service: calls
backend/src/controllers/authController.js - Auth service → MySQL: reads and writes
backend/src/services/authService.js - Product routes → Product handling: dispatches
backend/src/routes/productRoutes.js - Product routes → Token middleware: protects endpoints
backend/src/routes/productRoutes.js - Product routes → Image upload: accepts image
backend/src/routes/productRoutes.js - Product handling → Product service: calls
backend/src/controllers/productController.js - Product handling → Cloudinary images: deletes images
backend/src/controllers/productController.js - Product service → MySQL: reads and writes
backend/src/services/productService.js - Image upload → Cloudinary images: stores images
README.md - Chat routes → Chat and trades: dispatches
backend/src/routes/chatRoutes.js - Chat routes → Token middleware: requires token
backend/src/routes/chatRoutes.js - Chat and trades → MySQL: reads and writes
backend/src/controllers/chatController.js - HTTP server → Realtime messaging: initializes
backend/server.js - Realtime messaging → Redis adapter: scales through
README.md - Realtime messaging → Notifications: uses service
backend/src/config/socket.js - Support tickets → MySQL: reads and writes
backend/src/controllers/supportController.js - Admin management → MySQL: manages records
- Notifications → MySQL: reads and writes
backend/src/services/notificationService.js - Authentication → Email delivery: sends OTP
backend/src/controllers/authController.js