How pglim06/ez-swap works
EZ Swap is a campus peer-to-peer marketplace. Students discover listings, contact sellers, negotiate offers, coordinate handover, confirm completion and review one another; administrators moderate users, listings, reports and disputes. The React client routes users through these activities, while Express routes dispatch API requests to controllers and MongoDB-backed models. The README documents the product lifecycle and integrations; some frontend and controller implementations were not sampled, so those links are shown only where documented or indexed.
Main entry points: App.jsx React application · server.js Express and Socket.IO · listingRoutes.js Listing routes · listingController.js Listing discovery and management
Components 32
Marketplace client
- React application
client/src/App.jsx - Browse and listing views
client/src/pages - Account and profile
client/src/pages - Orders and handover
client/src/pages/MyOrders.jsx - Messaging
client/src/pages/Messages.jsx - Moderation dashboard
client/src/pages/AdminDashboard.jsx - Listing creation and detail
client/src/pages
Identity and discovery
- Authentication state
client/src/context/AuthContext.jsx - Authentication
controllers/authController.js - Listing discovery and management
controllers/listingController.js - Recommendations
controllers/recommendationController.js - Recommendation scoring
utils/recommendationEngine.js
Trading and trust
- Offer negotiation
controllers/orderController.js - Meetup and handover
controllers/transactionController.js - Mutual reviews
controllers/reviewController.js - Moderation operations
controllers/adminController.js
API and realtime
- Authentication routes
routes/authRoutes.js - Listing routes
routes/listingRoutes.js - Review routes
routes/reviewRoutes.js - Conversation API
controllers/chatController.js - Realtime messaging
socket/socketHandler.js - Express and Socket.IO
server.js - Session authorization
middleware/authMiddleware.js
Marketplace data
- Listings
models/Listing.js - Users
models/User.js - Offers and orders
models/Order.js - Transactions
models/Transaction.js - Reviews
models/Review.js
Other components
- Student
- Administrator
- Cloudinary image storage
- MongoDB
Connections 45
- Student → React application: uses
README.md - Administrator → React application: uses
README.md - React application → Authentication state: provides state
client/src/App.jsx - React application → Browse and listing views: routes to
client/src/App.jsx - React application → Account and profile: routes to
client/src/App.jsx - React application → Orders and handover: routes to
client/src/App.jsx - React application → Messaging: routes to
client/src/App.jsx - React application → Moderation dashboard: routes to
client/src/App.jsx - Student → Browse and listing views: browses
README.md - Browse and listing views → Listing routes: requests listings
README.md - Listing creation and detail → Listing routes: manages listings
README.md - Authentication state → Authentication routes: calls auth API
client/src/context/AuthContext.jsx - Authentication routes → Authentication: dispatches
routes/authRoutes.js - Listing routes → Listing discovery and management: dispatches
routes/listingRoutes.js - Listing routes → Recommendations: dispatches
routes/listingRoutes.js - Listing discovery and management → Listings: reads and writes
controllers/listingController.js - Listing discovery and management → Cloudinary image storage: uploads images
controllers/listingController.js - Listing discovery and management → Recommendation scoring: scores candidates
controllers/listingController.js - Recommendations → Recommendation scoring: uses scoring
controllers/recommendationController.js - Recommendations → Listings: loads candidates
controllers/recommendationController.js - Student → Messaging: chats
README.md - Messaging → Conversation API: uses chat API
README.md - Express and Socket.IO → Conversation API: mounts routes
server.js - Express and Socket.IO → Realtime messaging: initializes handlers
server.js - Student → Orders and handover: negotiates offers
README.md - Orders and handover → Offer negotiation: submits offers
README.md - Offer negotiation → Transactions: creates transaction
controllers/orderController.js - Orders and handover → Meetup and handover: coordinates handover
README.md - Meetup and handover → Transactions: updates handover
controllers/transactionController.js - Meetup and handover → Offers and orders: reads order
controllers/transactionController.js - Student → Mutual reviews: submits ratings
README.md - Mutual reviews → Reviews: creates reviews
controllers/reviewController.js - Mutual reviews → Transactions: checks completion
controllers/reviewController.js - Reviews → Users: updates reputation
models/Review.js - Moderation dashboard → Moderation operations: moderates platform
README.md - Express and Socket.IO → Authentication routes: mounts routes
server.js - Express and Socket.IO → Listing routes: mounts routes
server.js - Express and Socket.IO → Review routes: mounts routes
server.js - Review routes → Mutual reviews: dispatches
routes/reviewRoutes.js - Express and Socket.IO → Session authorization: uses protection
- Session authorization → Users: loads session user
middleware/authMiddleware.js - Moderation operations → Users: moderates users
controllers/adminController.js - Moderation operations → Listings: moderates listings
controllers/adminController.js - Moderation operations → Transactions: reviews disputes
controllers/adminController.js - Express and Socket.IO → MongoDB: connects database
server.js