A secure, full-stack marketplace designed exclusively for students.
CampusSwap is a robust web platform that enables students to buy, sell, or trade items and services within their university community. By leveraging a hybrid database architecture, it provides the flexibility of NoSQL for real-time features and the reliability of relational data for core transactions.
- Secure Authentication: JWT-based user login and registration with student email verification.
- Hybrid Database Architecture: * PostgreSQL: Handles structured relational data (Users, Listings, Transactions).
- MongoDB: Manages flexible, high-speed data (Real-time Chat, Notifications).
- Real-Time Messaging: Instant buyer-seller communication powered by Socket.io.
- Robust Search & Filters: Filter by category, price range, or item condition.
- Dynamic Listings: Easily upload, edit, and manage your items with image support.
| Layer | Technology |
|---|---|
| Frontend | React.js |
| Backend | Express.js |
| Databases | PostgreSQL, MongoDB |
| Real-time | Socket.io |
| Auth | JSON Web Tokens (JWT) & Bcrypt |
The application follows a modular architecture to ensure scalability:
- Client: A responsive React SPA.
- Server: A Node/Express API acting as a bridge.
- Data Layer: PostgreSQL ensures ACID compliance for financial/user records.
- MongoDB stores chat history for horizontal scaling.
- Node.js (v16+)
- PostgreSQL & MongoDB installed locally or via cloud (Atlas/Supabase)
- NPM or Yarn
- Clone the repository
git clone [https://github.com/raymondoyondi/CampusSwap.git](https://github.com/raymondoyondi/CampusSwap.git) cd CampusSwap - Install dependencies
For Backend:
cd server
yarn
For Frontend:
cd client
yarn
- Environment Variables: Create a .env file in the root directory and add:
For Backend:
MYPORT=4000
RANDOM=123
MONGO_URI=<MONGODB_URL>
SECRET=<SECRET_PHRASE>
DATABASE_URL=<POSTGRESSQL_URL>
FRONTEND_URL=<FRONTEND_URL>For Frontend:
VITE_APP_BACKEND_URL=<BACKEND_URL>- From the root directory (runs both client and server)
yarn run dev
Open your browser and navigate to http://localhost:5173 to view the application.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature). - Commit your Changes (
git commit -m 'Add some AmazingFeature). - Push to the Branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Please ensure your code follows the project's styling guidelines and includes relevant tests where applicable.
Distributed under the MIT License. See LICENSE for more information.