Check Out Live Site: https://swaphubx.vercel.app
SwapHub is a comprehensive college platform designed specifically for students to buy, sell, donate, and rent items within their campus community. This platform streamlines the exchange of goods among students, promoting sustainability and resource sharing.
SwapHub connects students within the same college ecosystem, allowing them to:
- Buy and sell used textbooks, electronics, furniture, and more
- Donate items they no longer need to fellow students
- Rent items temporarily for short-term use
- Build a trusted community through ratings and reviews
- Node.js with Express.js framework
- MongoDB for database storage
- Mongoose for object data modeling
- Passport.js for authentication
- React.js for interactive UI components
- Redux for state management
- Material UI/Bootstrap for styling
- Axios for API requests
- Google OAuth integration
- Session-based authentication
- JWT for secure API access
- Create and manage product listings
- Upload multiple product images
- Set prices and availability
- Respond to buyer inquiries
- Track listing statistics
- Browse available items with advanced filtering
- Search for specific items across categories
- Contact sellers directly through the platform
- Save favorite items
- Complete secure transactions
- List items for donation
- Specify item condition and availability
- Connect with students in need
- Track donation history
- User Dashboard: Personalized interface showing listings, transactions, and interactions
- Sidebar Navigation: Improved visibility and accessibility across all screen sizes
- Rating & Reviews: Comprehensive feedback system for building trust
- Notification System: Real-time updates on inquiries and transactions
- Mobile Responsive: Optimized experience on all devices
-
Clone the repository:
git clone https://github.com/SolarisXD/swaphub.git cd swaphub -
Install dependencies for both backend and frontend:
# Install backend dependencies cd backend npm install # Install frontend dependencies cd ../frontend npm install
-
Configure environment variables:
- Copy the example file and rename it:
cp .env.example .env
- Edit
.envin the backend directory and fill in the following variables:MONGODB_URI=your_mongodb_connection_string SECRET_KEY=your_secret_key
- Copy the example file and rename it:
-
Place any shared images in the
images/folder as needed. -
Start the development environment:
# Start backend server cd backend npm run dev # Start frontend server in a new terminal cd ../frontend npm run dev
- Register with your college email or Google account
- Complete your profile details
- Browse listings or create your first listing
- Connect with other students for transactions
- Leave feedback after completed transactions
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userGET /api/auth/google- Google OAuth authenticationGET /api/auth/logout- Logout user
GET /api/listings- Get all listingsGET /api/listings/:id- Get specific listingPOST /api/listings- Create new listingPUT /api/listings/:id- Update listingDELETE /api/listings/:id- Delete listing
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profileGET /api/users/:id/listings- Get user's listingsGET /api/users/:id/reviews- Get user's reviews
We welcome contributions to SwapHub! Please follow these steps:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: SwapHub
Note:
- The
images/folder is for shared assets used across the project. - The
.env.examplefile provides a template for required environment variables. Copy it to.envin the root directory and update values as needed. POST /api/listings- Create new listing

