A full-stack smart ride-sharing platform built for campus communities.
CampusPool helps students create, discover, join, and manage rides within their campus β making everyday transportation more affordable, convenient, and community-driven.
Coming soon
Coming soon
Students often travel between hostels, academic buildings, railway stations, markets, and other locations around campus.
When students travel individually:
- Transportation costs increase.
- Fuel is wasted.
- Available seats in private vehicles go unused.
- Students have no centralized way to coordinate rides.
- Finding people travelling in the same direction becomes difficult.
CampusPool addresses this problem by providing a centralized platform where students can create and discover shared rides, join available seats, and coordinate their campus transportation.
The goal is simple:
Travel together. Save money. Reduce unnecessary trips. Build a better campus community.
- User Registration
- User Login
- User Logout
- Passport-based authentication
- Session-based authentication
- Current-user endpoint (
/auth/me) - Protected backend routes
- Create a ride
- View ride details
- Edit your rides
- Cancel your rides
- Delete your rides
- View available rides
- Date and time based ride information
- Join an available ride
- Leave a joined ride
- Automatic passenger tracking
- Automatic seat availability
- Full ride detection
- Prevent duplicate joining
- Prevent ride owners from joining their own ride
- View rides
- Total ride count
- Active ride count
- Ride management
- Ride status information
CampusPool dynamically handles ride states such as:
- Available
- Joined
- Full
- Cancelled
The interface updates available actions based on the current user's relationship with the ride.
- React
- Vite
- React Router
- Tailwind CSS
- Axios
- React Hook Form
- Zod
- Lucide React
- Framer Motion
- Node.js
- Express.js
- Passport.js
- Express Session
- Mongoose
- MongoDB
- MongoDB Atlas
CampusPool follows a full-stack client-server architecture.
βββββββββββββββββββββββ
β CampusPool β
β React Client β
ββββββββββββ¬βββββββββββ
β
β HTTP / Axios
βΌ
βββββββββββββββββββββββ
β Express Server β
β REST API β
ββββββββββββ¬βββββββββββ
β
ββββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
Authentication Ride APIs Dashboard
Passport/Session Create/Join/ Ride Management
Leave/Edit/Delete
β
βΌ
βββββββββββββββββββββββ
β MongoDB Atlas β
β Users & Rides β
βββββββββββββββββββββββ
The project is divided into separate frontend and backend responsibilities.
CampusPool/
β
βββ frontend/
β βββ src/
β β βββ components/
β β βββ context/
β β βββ pages/
β β βββ hooks/
β β βββ utils/
β β βββ App.jsx
β β
β βββ public/
β βββ package.json
β βββ vite.config.js
β
βββ backend/
β βββ Controller/
β β βββ auth.js
β β βββ dashboard.js
β β
β βββ models/
β β βββ userSchema.js
β β βββ rideSchema.js
β β
β βββ Routes/
β β βββ auth.js
β β βββ dashboard.js
β β
β βββ utils/
β β βββ ExpressError.js
β β βββ wrapAsync.js
β β
β βββ middlewares.js
β βββ schema.js
β βββ index.js
β
βββ README.md
CampusPool uses Passport.js with session-based authentication.
User Login
β
βΌ
React Frontend
β
β POST /auth/login
βΌ
Express Backend
β
βΌ
Passport Authentication
β
βΌ
Session Created
β
βΌ
Authenticated User
The frontend can restore the current authenticated user through:
GET /auth/me
This allows the React application to maintain the user's authentication state even after a page refresh.
A ride can move through different states depending on its availability and owner's actions.
ββββββββββββββββ
β Available β
ββββββββ¬ββββββββ
β
Last seat occupied
β
βΌ
ββββββββββββββββ
β Full β
ββββββββββββββββ
Available / Full
β
β Owner cancels
βΌ
ββββββββββββββββ
β Cancelled β
ββββββββββββββββ
Any ride
β
β Owner deletes
βΌ
Removed from database
The owner can:
- Edit the ride
- Cancel the ride
- Delete the ride
Users can:
- Join an available ride
- Leave a ride they joined
- View ride information
The UI dynamically changes according to:
- Current user
- Ride ownership
- Passenger status
- Available seats
- Ride status
git clone https://github.com/your-username/CampusPool.gitcd CampusPoolInstall dependencies for both frontend and backend according to their respective package.json files.
Create a .env file in the backend and configure the required environment variables.
MONGO_URL=your_mongodb_connection_string
SECRET=your_session_secretnodemon index.jsnpm run devThe frontend will then be available through the Vite development server.
CampusPool is currently evolving beyond its initial release.
Planned improvements include:
- π Real-time notifications
- π¬ In-app chat
- πΊοΈ Google Maps integration
- π Location-based ride discovery
- β Ride and user rating system
- π³ Payment integration
- π Real-time ride updates using Socket.IO
- π± Improved mobile experience
The application separates frontend UI protection from backend authorization.
Backend authentication and authorization are enforced through middleware, while the frontend maintains the current authentication state through the AuthContext and /auth/me endpoint.
Sensitive environment variables such as database credentials and session secrets are never committed to the repository.
Initial stable release featuring:
- Authentication
- Ride creation
- Ride discovery
- Ride joining
- Ride leaving
- Ride editing
- Ride cancellation
- Ride deletion
- Passenger management
- Seat availability tracking
- Dashboard
- Session persistence
Subhranil Mandal
CSE Student
JNU, New Delhi
CampusPool is built around a simple idea:
Why travel alone when someone nearby is going the same way?
CampusPool aims to make campus transportation smarter, more affordable, and more connected β one shared ride at a time.