Skip to content

Latest commit

 

History

History
178 lines (145 loc) · 4.27 KB

File metadata and controls

178 lines (145 loc) · 4.27 KB

<<<<<<< HEAD

Carpool Coordination Platform 🚗

A full-stack peer-to-peer carpool coordination website built with React and Node.js.

Features

  • 🔐 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

Tech Stack

Frontend

  • React 18 + Vite
  • React Router v6
  • Axios
  • Socket.io Client
  • Framer Motion
  • React Hook Form
  • React Leaflet (for maps)
  • Recharts (for visualizations)

Backend

  • Node.js + Express
  • MongoDB + Mongoose
  • JWT Authentication
  • Socket.io (real-time chat)
  • Multer (file uploads)
  • Bcrypt (password hashing)

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or MongoDB Atlas)

Installation

  1. Clone the repository
cd c:\dev\carpool
  1. Install Backend Dependencies
cd server
npm install
  1. Install Frontend Dependencies
cd ../client
npm install
  1. 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

Running the Application

  1. Start MongoDB (if running locally)
mongod
  1. Start Backend Server
cd server
npm run dev

Server will run on http://localhost:5000

  1. Start Frontend (in a new terminal)
cd client
npm run dev

Frontend will run on http://localhost:5173

API Endpoints

Authentication

  • POST /api/auth/signup - Register new user
  • POST /api/auth/login - Login user

Users

  • GET /api/users/profile - Get current user profile
  • PUT /api/users/profile - Update profile
  • POST /api/users/upload-picture - Upload profile picture

Rides

  • POST /api/rides - Create ride offer
  • GET /api/rides/search - Search rides by route
  • GET /api/rides/my-rides - Get user's rides
  • DELETE /api/rides/:id - Cancel ride

Carpools

  • POST /api/carpools - Create carpool group
  • GET /api/carpools/my-carpools - Get user's carpools
  • POST /api/carpools/:id/join - Join carpool
  • POST /api/carpools/:id/complete-ride - Mark ride complete
  • GET /api/carpools/:id/chat - Get chat history
  • POST /api/carpools/:id/chat - Send message

Community

  • GET /api/community/leaderboard - Top contributors
  • GET /api/community/popular-routes - Popular routes
  • GET /api/community/stats - Platform statistics

Project Structure

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/

Features Roadmap

  • 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

Contributing

This is a demo project. Feel free to fork and customize!

License

MIT

carpool

A full-stack carpool coordination web application for sustainable commuting and community building

0b8fc366d1050af1d2f58b54517247f5185fbf83