A professional, feature-rich marketplace designed for university students to buy, sell, and trade items safely within their campus community.
- 🔐 Secure Authentication & Middleware: JWT-based authentication stored in secure HttpOnly cookies, encrypted password storage using Bcrypt, API request rate limiting (
express-rate-limit), and HTTP headers security (helmet). - 🛒 Product Management: Full CRUD operations for listing items, with cloud-hosted image uploads via Multer and Cloudinary.
- 💬 Scalable Real-time Chat: Integrated messaging system using Socket.io, with a Redis adapter for horizontal scaling and multi-instance compatibility.
- 🔍 Advanced Filtering: Search items by title, category, price range, and type (buy/rent).
- 🛡️ Admin Dashboard: Administration portal to manage users, listings, and support tickets.
- 📞 Support Ticket System: Built-in support portal for raising issues and tracking resolutions.
- 🐳 Containerized Deployment: Ready-to-deploy multi-container environment orchestrated via Docker Compose.
- 📱 Responsive UI: A premium, modern interface served via Nginx and styled with responsive CSS.
- Backend: Node.js, Express.js
- Frontend: HTML5, CSS3, JavaScript, Nginx (production server)
- Database: MySQL (compatible with TiDB Cloud / local server)
- Real-time Engine & Caching: Socket.io, Redis (Pub/Sub Adapter)
- Image Storage: Cloudinary (via Multer middleware)
- Security: JSON Web Tokens (JWT), Bcrypt, Helmet.js, Express Rate Limit
- Containerization: Docker, Docker Compose
- Node.js installed (v18+)
- A MySQL database (local or cloud)
- Cloudinary account for image uploads
Clone the repository and install dependencies:
git clone https://github.com/A-S-Manoj/CampusMarketPlace.git
cd CampusMarketPlace
npm installCopy the .env.example file to .env and fill in your credentials:
cp .env.example .envEnsure you provide the correct database and Cloudinary details.
Import the provided schema.sql into your MySQL database to create the necessary tables.
Development mode (using nodemon):
npm run devProduction mode:
npm startThe server will start on http://localhost:5000.
This project is fully containerized using Docker and Docker Compose, which automatically provisions MySQL, Redis, the Node.js backend, and the Nginx-based frontend.
- Make sure you have Docker and Docker Compose installed.
- Build and start all services in the background or active terminal:
docker-compose up --build
- Access the services:
- Frontend client: http://localhost (mapped to port 80)
- Backend API server: http://localhost:5000
backend/: Node.js & Express.js server application.src/app.js: Main API entry point.src/controllers/: Route controller handlers.src/services/: Database interaction logic and services.src/routes/: Express router endpoint definitions.src/config/: DB connection, Cloudinary, and Socket.io configuration.schema.sql: Database initialization schema.
frontend/: Static SPA client application (served via Nginx in Docker).- HTML pages (
index.html,dashboard.html,chat.html,support.html, etc.). js/: Client-side logic, API fetch functions, and Socket.io client listeners.css/: Clean, responsive stylesheets.
- HTML pages (
docker-compose.yml: Multi-container Docker deployment configuration orchestrating the frontend, backend, database, and Redis.
This project is licensed under the ISC License.