<<<<<<< HEAD
A full-stack peer-to-peer carpool coordination website built with React and Node.js.
- 🔐 Authentication: JWT-based signup/login
- 🔍 Smart Matching: Route-based ride matching using geospatial algorithms
- 👥 Carpool Groups: Create and manage carpool communities
- 💬 Real-time Chat: Socket.io powered group messaging
- 📊 Impact Dashboard: Track carbon savings and statistics
- 🌙 Dark Mode: Theme toggle support
- 🎨 Modern UI: Vibrant design with Framer Motion animations
- React 18 + Vite
- React Router v6
- Axios
- Socket.io Client
- Framer Motion
- React Hook Form
- React Leaflet (for maps)
- Recharts (for visualizations)
- Node.js + Express
- MongoDB + Mongoose
- JWT Authentication
- Socket.io (real-time chat)
- Multer (file uploads)
- Bcrypt (password hashing)
- Node.js (v16 or higher)
- MongoDB (local or MongoDB Atlas)
- Clone the repository
cd c:\dev\carpool- Install Backend Dependencies
cd server
npm install- Install Frontend Dependencies
cd ../client
npm install- Configure Environment Variables
Backend (.env in /server):
PORT=5000
MONGODB_URI=mongodb://localhost:27017/carpool
JWT_SECRET=your_secret_key
JWT_EXPIRE=7d
FRONTEND_URL=http://localhost:5173
Frontend (.env in /client):
VITE_API_URL=http://localhost:5000/api
VITE_SOCKET_URL=http://localhost:5000
- Start MongoDB (if running locally)
mongod- Start Backend Server
cd server
npm run devServer will run on http://localhost:5000
- Start Frontend (in a new terminal)
cd client
npm run devFrontend will run on http://localhost:5173
POST /api/auth/signup- Register new userPOST /api/auth/login- Login user
GET /api/users/profile- Get current user profilePUT /api/users/profile- Update profilePOST /api/users/upload-picture- Upload profile picture
POST /api/rides- Create ride offerGET /api/rides/search- Search rides by routeGET /api/rides/my-rides- Get user's ridesDELETE /api/rides/:id- Cancel ride
POST /api/carpools- Create carpool groupGET /api/carpools/my-carpools- Get user's carpoolsPOST /api/carpools/:id/join- Join carpoolPOST /api/carpools/:id/complete-ride- Mark ride completeGET /api/carpools/:id/chat- Get chat historyPOST /api/carpools/:id/chat- Send message
GET /api/community/leaderboard- Top contributorsGET /api/community/popular-routes- Popular routesGET /api/community/stats- Platform statistics
carpool/
├── server/ # Backend
│ ├── config/ # Database & auth config
│ ├── models/ # Mongoose models
│ ├── routes/ # API routes
│ ├── middleware/ # Auth middleware
│ ├── utils/ # Utilities (matching, email)
│ └── server.js # Express server
│
└── client/ # Frontend
├── src/
│ ├── components/ # Reusable components
│ ├── pages/ # Page components
│ ├── context/ # React Context
│ ├── services/ # API services
│ ├── App.jsx # Main app component
│ └── index.css # Global styles
└── public/
- Backend API with MongoDB
- JWT Authentication
- React Frontend with Router
- Landing, Login, Signup pages
- Find Ride with map integration
- Offer Ride form
- Dashboard with user stats
- Carpool Group with real-time chat
- Community leaderboard
- Impact dashboard with charts
- File upload for profile pictures
- Email verification
- Payment integration
This is a demo project. Feel free to fork and customize!
A full-stack carpool coordination web application for sustainable commuting and community building
0b8fc366d1050af1d2f58b54517247f5185fbf83