How purvaagine/campus-connect works
Project type and purpose
• This is a full-stack auction/bidding web application.
• Frontend: a React single-page app (in /client) for browsing products, placing bids, managing your profile, and viewing notifications.
• Backend: an Express/Node API server (in /server) that handles authentication, product and bid management, notifications, and image uploads via Cloudinary.
• Database: likely MongoDB (inferred from model folder naming conventions).
File structure
• Top-level folders:
• /client – React UI and state management (Redux)
• /server – API, middleware, data models, configuration
• Key patterns:
• Frontend follows a “pages” + “components” + “apicalls” + “redux” slice structure.
• Backend follows an MVC-style separation: models, routes (controllers), middleware, config.
• Config & tooling:
• nodemon.json – dev hot-reload for the server
• Tailwind CSS config in the client
• Cloudinary config in server/config/cloudinaryConfig.js
• DB config in server/config/dbConfig.js
• Authentication middleware in server/middlewares/authMiddleware.js
(empty) README for hints
• No extra constraints; follow best practices for full-stack web apps.
a. Main components
1. React Frontend
• Pages: Home, Login, Register, ProductInfo, Admin, Profile (with nested sub-pages)
• State: Redux store with usersSlice (handles user auth/session)
• API Layer: Axios instances and modules for users, products, bids, notifications
2. Express Backend
• Routes/Controllers: usersRoute, productsRoute, bidsRoute, notificationsRoute
• Models: userModel, productModel, bidModel, notificationsModel
• Middleware: authMiddleware (JWT-based auth guard)
• Config: dbConfig (connect to MongoDB), cloudinaryConfig (upload images)
3. Database
• MongoDB collections: users, products, bids, notifications
4. External Services
• Cloudinary (image storage & CDN)
• Optional: Email/SMS for notifications (if integrated)
b. Relationships & interactions
• Frontend → Backend: HTTP(S) REST calls via Axios
• Login/Register → POST /api/users
• Fetch products → GET /api/products
• Bid → POST /api/bids
• Get notifications → GET /api/notifications
• Backend → Database: CRUD operations on collections via Mongoose models
• Backend → Cloudinary: upload/download product images
c. Architectural patterns & design principles
• Separation of concerns: UI vs. application logic vs. data access
• MVC (on the server): models, controllers (routes), middleware
• Client-side state management: Redux slices
• API-first design: clear REST endpoints
• Layered architecture: presentation (React), business (Express routes & middleware), data (MongoDB)
d. Key technologies/frameworks
• Frontend: React, Redux, Axios, Tailwind CSS
• Backend: Node.js, Express, Mongoose (implied), Cloudinary SDK, JSON Web Tokens
• Dev tooling: nodemon, jest/react-testing (App.test.js), create-react-app base
Diagramming conventions
• Blue for frontend,
• Green for backend,
• Orange for data/external services.
Detail checklist
• User roles if needed (admin vs. regular user flows).
• Middleware responsibilities (e.g., JWT validation).