Skip to content

HarK-github/Campus-Marketplace

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

155 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Campus Marketplace

IIT Bhilai

A community-first intranet marketplace platform for students to buy, sell, exchange, and pre-order items within IIT Bhilai.

Status: Deployed Development: Active License: MIT PRs Welcome

Pull Requests Merged Open Issues Contributors Stars Forks


Table of Contents

About Overview, features, and tech stack
Docker Setup One-command containerized deployment
Getting Started Manual development setup (no Docker)
Usage How to navigate and use the platform
Contributing Guidelines for contributors
Maintainers Core team
Campus Marketplace Preview

About the Project

This project provides a dedicated intranet marketplace for the IIT Bhilai community.

Tech Stack


Frontend: React + Vite + Tailwind CSS Β |Β  Backend: Node.js + Express + MongoDB Β |Β  File Storage: Cloudinary Β |Β  Containerization: Docker & Docker Compose

Docker Setup

This project is fully containerized. Run the entire stack with a single command.

Prerequisites

  • Docker Desktop (version 20.10+) or Docker Engine + Compose V2
  • At least 4GB RAM allocated to Docker

Quick Start

  1. Clone the repository

    git clone https://github.com/OpenLake/Campus-Marketplace.git
    cd Campus-Marketplace
  2. Create environment files (see Environment Variables)

    cp backend/.env.example backend/.env
    cp frontend/.env.example frontend/.env
  3. Start all services

    docker compose up -d
  4. Access the application

Service Ports (default)

Service Container Port Host Port
Frontend 4173 4173
Backend 5000 5000
MongoDB 27017 (internal)

Important: For local Docker development, VITE_API_URL must point to host port 5000 (http://localhost:5000/api), not the container service name. The browser cannot resolve backend:5000.


Environment Variables

Create a .env file inside backend/ and frontend/ respectively.

Getting Started

For local development without Docker, follow these manual steps.

Backend Setup

  1. Navigate to the backend folder:
    cd backend
  2. Install dependencies:
    npm install
  3. Create a .env file (see template above).
  4. Start the development server:
    npm run dev
    The API will run at http://localhost:5000.

Frontend Setup

  1. Open another terminal and navigate to the frontend folder:
    cd frontend
  2. Install dependencies:
    npm install
  3. Create a .env file (see template above).
  4. Start the Vite development server:
    npm run dev
    The frontend will run at http://localhost:4173.

Usage

Using Docker (recommended)

  1. Ensure Docker is running.
  2. docker compose up -d
  3. Open http://localhost:4173 in your browser.
  4. Register or log in using email/password or Google OAuth.
  5. Create a listing (sell an item), browse listings, and express interest.

Manual Development

Run backend and frontend separately as described in Getting Started.

Common Actions

Action How to do it
List an item Click "Sell" β†’ fill in details β†’ upload images β†’ publish.
Express interest On a listing page, click "I'm interested" β†’ seller receives a notification.
Manage listings Go to Dashboard β†’ My Listings β†’ edit or mark as sold.


Troubleshooting

Docker Issues

Port already in use

# Find process using port 5000 (Linux/macOS)
sudo lsof -i :5000
# Kill it
kill -9 <PID>

# Or change the host port in docker-compose.yml

Frontend can't reach backend (404 on API calls)

  • Wrong VITE_API_URL – Ensure it's http://localhost:5000/api (not http://localhost:4173).
  • CORS misconfiguration – Backend CORS_ORIGIN must include http://localhost:4173.
  • Container network – If you changed ports, rebuild: docker compose up --build

Google OAuth fails with 404

  • Check that users/google route exists in backend routes (/api/users/google).
  • Verify your frontend api.js has baseURL: 'http://localhost:5000/api'.

Cloudinary upload errors

  • Ensure your Cloudinary credentials are correct and the environment variables are loaded.
  • Restart the backend after changing .env.

Logs and Debugging

# View all logs
docker compose logs

# Follow backend logs only
docker compose logs -f backend

# Follow frontend logs
docker compose logs -f frontend

# Rebuild a single service
docker compose up -d --build backend


Contributing

We welcome contributions from the community.
Please read CONTRIBUTING.md for guidelines before submitting a pull request.

Development Workflow

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/amazing-feature).
  3. Commit your changes (git commit -m 'Add some amazing feature').
  4. Push to the branch (git push origin feature/amazing-feature).
  5. Open a Pull Request.


Maintainers

Avatar Name GitHub
Harshit Kandpal @Hark-github
Garvit Sharma @garvit-sharma

See MAINTAINERS.md for the full list.


License

Distributed under the MIT License.
See LICENSE for details.

MIT License

Copyright (c) 2025 OpenLake Society

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...

Built with ❀️ by Harshit Kandpal @ OpenLake

About

πŸ›οΈ A student-centric campus marketplace platform to buy, sell, and exchange items within the college community, built for seamless, secure, and verified peer-to-peer transactions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 99.1%
  • Other 0.9%