How disha2553/campus-connect works
Project Type and Purpose
• This is a full-stack web application (“Campus Connect”) for a peer-to-peer second-hand marketplace.
• Frontend: React + Redux + Tailwind CSS + Ant Design.
• Backend: Node.js + Express.js + MongoDB + Cloudinary (for image uploads).
• Key features: User auth (JWT), product listings, bidding, notifications, admin panel.
File Structure
• Top level:
• client/ → React SPA
• server/ → Express API
• nodemon.json, package.json → build & run scripts
• client/src/apicalls → Axios instances & wrappers
• client/src/redux → Redux store & slices (state management)
• server/config → DB & Cloudinary setup
• server/middlewares → JWT auth
• server/models → Mongoose schemas
• server/routes → REST endpoints
README for Additional Insights
• Confirms MERN stack, deployment on Render, use of JWT, Cloudinary, Multer.
• Highlights core modules: Authentication, Products, Bidding, Notifications, Admin.
Main Components & Their Interactions
a. Frontend (Browser/Client)
• React app
• Redux store
• Components & Pages (Home, Login, Register, ProductInfo, Admin, Profile)
• Axios → HTTP calls to API
b. Backend (Server/API)
• Express.js server (server/server.js)
• Middleware: authMiddleware (JWT verification)
• Routes & Controllers: usersRoute, productsRoute, bidsRoute, notificationsRoute
• Models: userModel, productModel, bidModel, notificationsModel
c. Database
• MongoDB (hosted locally or in cloud)
d. External Services
• Cloudinary for image storage
• (Optional) Email or push notification service
e. Deployment Platform
• Render (hosting both client static build and server)
Relationships & Data Flows
• User → Browser → React UI
• React components dispatch Redux actions → update store
• UI → Axios HTTP request → Express API
• Express route → authMiddleware → controller logic → Mongoose Model → MongoDB
• For file uploads: Express → Multer middleware → Cloudinary SDK → Cloudinary
• Response flows back to client → Redux store update → UI render
Architectural Patterns & Design Principles
• Separation of concerns: UI, state management, API, data layer
• RESTful services
• MVC-style organization on server (Routes → Controllers → Models)
• Stateless authentication (JWT)
• Containerization of API calls (axiosInstance)
• Reusable React components, page-level routing