Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

UniCircle

A campus-only marketplace where students buy, sell, and rent items with peers from their own college.

React Vite Tailwind CSS Node.js MongoDB

Overview

UniCircle tackles a familiar campus problem: students constantly outgrow textbooks, electronics, and furniture, while others need exactly those items for a semester. Instead of a generic classifieds site, UniCircle scopes every listing to a college community — when a user signs up, their college is derived from their email domain, and they only ever see listings posted by students of the same college.

The project is a full-stack MERN application built during a hackathon: a React single-page app talking to an Express/MongoDB REST API.

Key Features

  • JWT authentication — signup and login endpoints issue JSON Web Tokens; passwords are hashed with bcrypt before storage, and protected routes are guarded by an auth middleware.
  • College-scoped marketplace — the user's college is automatically extracted from their email domain at signup, and product queries are filtered so students only see listings from their own campus.
  • Sell or rent listings — items can be posted for sale or for rent; rental listings additionally capture a duration and duration unit (days / weeks / months / years).
  • Image uploads — listing photos are uploaded via Multer and served as static files by the backend.
  • Categorised products — listings belong to one of five categories: electronics, furniture, books, stationary, or others.
  • Store with Sell / Buy / Rent sections — a tabbed store page (nested React Router routes) for posting an item, browsing items for sale, and browsing rentals; each product card links to a detail view with seller info.
  • Marketing pages — Home, About, and Contact pages with a responsive Tailwind + Flowbite UI, plus a custom 404 page.

Tech Stack

Layer Technology
Frontend React 18, Vite, React Router 7, Tailwind CSS, Flowbite React, React Icons, React Fast Marquee
Backend Node.js, Express 4, Multer (file uploads)
Database MongoDB with Mongoose 8
Auth JSON Web Tokens, bcrypt

Project Structure

unicircle-main/unicircle-main/
├── backend/          # Express REST API
│   ├── index.js      # Routes: /signup, /login, /me, /product, /getproducts, /product/:id
│   ├── db.js         # MongoDB connection
│   ├── models/       # User and Product Mongoose schemas
│   └── middleware/   # JWT auth middleware
└── frontend/         # React SPA (Vite)
    └── src/
        ├── App.jsx           # Route definitions
        └── components/       # Home, About, Contact, Login, Signup, Store, Navbar, Footer

Running Locally

Prerequisites

  • Node.js (v18+ recommended)
  • MongoDB running locally on mongodb://127.0.0.1:27017/

1. Clone the repository

git clone https://github.com/techieshreya/Unicircle.git
cd Unicircle/unicircle-main/unicircle-main

2. Start the backend

cd backend
npm install

Create a .env file in backend/:

JWT_TOKEN_SECRET=your_secret_here
PORT=3000

Then run:

npm run dev

The API starts on http://localhost:3000.

3. Start the frontend

In a second terminal:

cd frontend
npm install
npm run dev

Vite serves the app (by default on http://localhost:5173); it expects the backend at http://localhost:3000.

API Endpoints

Method Endpoint Auth Description
POST /signup Register (name, email, password); returns a JWT
POST /login Log in; returns a JWT
GET /me Current user's profile
POST /product Create a listing (multipart form with image)
POST /getproducts List products of type sell or rent for the user's college
GET /product/:id Product detail with seller name and email

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages