A modern, intelligent carpooling application that connects drivers and passengers through AI-powered matching and schedule optimization.
- AI-Powered Recommendations: Intelligent algorithm matches riders with compatible drivers based on schedules, locations, and preferences
- Real-time Route Optimization: Google Maps integration for optimal route planning and distance calculations
- Schedule Compatibility: Advanced time-slot matching with configurable time flexibility
- Manual Schedule Entry: Create detailed weekly schedules with specific time slots and locations
- AI Schedule Upload: Upload schedule screenshots and let AI extract your availability automatically
- Multi-location Support: Set different start and end locations for each time slot
- Weekly Templates: Easily replicate schedules across multiple weeks
- NextAuth.js Integration: Secure authentication with email/password
- User Profiles: Comprehensive user management with vehicle information
- Privacy Controls: Granular privacy settings for personal information
- Google Maps Integration: Interactive map selection for pickup and drop-off locations
- Places Autocomplete: Smart location search with address suggestions
- Distance Calculations: Haversine distance calculations for accurate matching
- Route Visualization: Visual route display with estimated times and distances
- Ride Requests: Send and receive ride requests with instant notifications
- Request Tracking: Monitor incoming, outgoing, and public ride requests
- Acceptance/Rejection: Simple workflow for managing ride requests
- Public Ride Board: Browse and claim public ride requests
- Vehicle Information: Track vehicle details, seating capacity, and availability
- Seat Management: Automatic calculation of available seats per ride
- Multi-passenger Support: Handle multiple passengers per vehicle
- Framework: Next.js 15.5.4 with App Router
- Language: TypeScript 5
- Styling: Tailwind CSS 4 with custom components
- UI Components: Radix UI primitives
- Maps: Google Maps API with React integration
- Icons: Heroicons & Lucide React
- Runtime: Node.js with Next.js API Routes
- Database: MongoDB Atlas with Mongoose ODM
- Authentication: NextAuth.js with JWT tokens
- File Upload: Multipart form handling
- AI Integration: Google Gemini API for schedule extraction
- Type Safety: Full TypeScript coverage with strict mode
- Linting: ESLint with Next.js configuration
- Package Manager: PNPM with workspace support
- Build System: Next.js optimized builds
- Node.js 18+ and PNPM
- MongoDB Atlas account
- Google Maps API key
- Google Gemini API key (optional, for AI features)
# Clone the repository
git clone https://github.com/morallyearlgrey/carpool.git
cd carpool
# Install dependencies
pnpm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local with your configurationCreate a .env.local file with the following variables:
# Database
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/carpool
# Authentication
NEXTAUTH_SECRET=your_nextauth_secret_key
NEXTAUTH_URL=http://localhost:3000
# Google Services
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your_google_maps_api_key
GEMINI_API_KEY=your_gemini_api_keyThe application uses MongoDB with Mongoose. Database collections and schemas are automatically created on first run.
Core Collections:
users- User profiles and authenticationschedules- User availability schedulesrides- Active ride offersrequests- Ride requests and matches
# Start the development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm start
# Run linting for error and warning checker (Don't worry! We are warning and error free!!)
pnpm lintOpen http://localhost:3000 to view the application.
- Register with email and password
- Complete your profile with vehicle information
- Set up your weekly availability schedule
- Manual Entry: Use the schedule builder to set specific time slots
- AI Upload: Take a screenshot of your schedule and let AI extract the data
- Weekly Planning: Set recurring schedules with flexible time slots
- Browse the dashboard for recommended matches
- Use the map interface to set pickup and destination points
- Submit ride requests to compatible drivers
- Post your available rides with capacity and timing
- Review and manage incoming ride requests
- Accept compatible passengers based on your preferences
- Incoming: Review and respond to ride requests from other users
- Outgoing: Track your submitted ride requests
- Public: Browse and claim publicly available ride requests
POST /api/auth/signin- User loginPOST /api/register- User registration
GET /api/schedule- Retrieve user schedulePOST /api/schedule- Create/update schedulePOST /api/upload- AI-powered schedule upload
GET /api/recommendations- Get ride recommendationsPOST /api/offers- Create ride offerGET /api/requests/incoming- Get incoming requestsGET /api/requests/outgoing- Get outgoing requestsPOST /api/requests/[id]/respond- Accept/reject requests
GET /api/users- Get user informationGET /api/rides/mine- Get user's rides
src/
βββ app/ # Next.js App Router pages
β βββ api/ # API routes
β βββ auth/ # Authentication pages
β βββ dashboard/ # Main dashboard
β βββ schedule/ # Schedule management
β βββ carpool/ # Legacy carpool interface
βββ components/ # Reusable React components
β βββ ui/ # Base UI components
β βββ [feature]/ # Feature-specific components
βββ lib/ # Utilities and configurations
β βββ models/ # Mongoose schemas
β βββ auth.ts # NextAuth configuration
β βββ mongodb.ts # Database connection
β βββ utils.ts # Helper functions
βββ types/ # TypeScript type definitions
We welcome contributions! Please see our Contributing Guidelines for details.
- Follow TypeScript best practices
- Use ESLint configuration provided
- Write meaningful commit messages
- Test thoroughly before submitting PRs
- Use TypeScript for all new code
- Follow the existing component structure
- Use Tailwind CSS for styling
- Implement proper error handling
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js Team for the amazing framework
- Google Maps Platform for location services
- MongoDB for robust database solutions
- Vercel for seamless deployment platform
For support and questions:
- Create an issue
- Join our discussions
- Contact the maintainers
Built with β€οΈ for sustainable transportation