Skip to content

Nishant-0203/carpooling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš— CoGo - Smart Carpooling Platform

License: MIT Node.js Version React Version PRs Welcome

A modern, secure, and user-friendly carpooling platform built with React and Node.js

Features β€’ Demo β€’ Quick Start β€’ Documentation β€’ Contributing

🎯 Demo

Live Application: https://carpooling-app-chl.vercel.app

API Backend: https://backend-kohl-six-71.vercel.app

πŸš€ The application is deployed on Vercel with separate deployments for frontend and backend.

✨ Features

πŸ” Authentication & Security

  • Multi-provider Authentication - JWT tokens, Google OAuth integration
  • Password Security - Bcrypt hashing with configurable salt rounds
  • Rate Limiting - Protection against brute force attacks
  • Input Validation - Server-side validation and sanitization
  • XSS Protection - Security headers and content security policies

🎨 User Experience

  • Modern UI/UX - Intuitive design with Tailwind CSS
  • Smooth Animations - Framer Motion for delightful interactions
  • Responsive Design - Optimized for all screen sizes (mobile-first)
  • Accessibility - WCAG 2.1 AA compliant with ARIA labels
  • Dark Mode Ready - Theme support (coming soon)

πŸš€ Performance & SEO

  • Blazing Fast - Code splitting and lazy loading
  • Optimized Bundles - Tree shaking and minification
  • SEO Optimized - Meta tags, OpenGraph, and structured data
  • PWA Support - Service worker and offline capabilities
  • CDN Ready - Static assets optimized for edge delivery

πŸ› οΈ Tech Stack

🎨 Frontend

Technology Purpose
React 19 UI library with concurrent features
Vite Build tool & dev server
Tailwind CSS Utility-first styling
Framer Motion Animations & transitions
React Router v6 Client-side routing
React Hook Form Form management
Axios HTTP client with interceptors
Sonner Toast notifications
Zod Runtime type validation
Shadcn/ui Accessible component system

βš™οΈ Backend

Technology Purpose
Node.js 18+ JavaScript runtime
Express.js Web framework
MongoDB NoSQL database
Mongoose MongoDB ODM
JWT Token-based auth
Passport.js Auth strategies
Helmet Security headers
Express Rate Limit API protection
Bcrypt Password hashing
Express Validator Input validation

πŸš€ Quick Start

πŸ“‹ Prerequisites

Before you begin, ensure you have the following installed:

Requirement Version Download
Node.js 18.0.0+ Download
MongoDB 4.4+ Download
Git Latest Download
npm/yarn Latest Included with Node.js

Installation

  1. Clone the repository
git clone https://github.com/your-username/cogo-carpooling.git
cd cogo-carpooling
  1. Install root dependencies
npm install
  1. Set up Backend
cd backend
npm install

# Create environment file
cp .env.example .env
# Edit .env with your MongoDB URI and other settings
  1. Set up Frontend
cd ../frontend
npm install

# Create environment file
cp .env.example .env
# Edit .env with your API URL and other settings
  1. Start Development Servers

Backend (Terminal 1):

cd backend
npm run dev

Frontend (Terminal 2):

cd frontend
npm run dev

The application will be available at:

πŸ“ Project Structure

cogo-carpooling/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/         # Database and app configuration
β”‚   β”‚   β”œβ”€β”€ controllers/    # Route handlers
β”‚   β”‚   β”œβ”€β”€ middleware/     # Custom middleware
β”‚   β”‚   β”œβ”€β”€ models/         # Database models
β”‚   β”‚   └── routes/         # API routes
β”‚   β”œβ”€β”€ server.js          # Server entry point
β”‚   └── package.json
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/            # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/    # Reusable components
β”‚   β”‚   β”œβ”€β”€ pages/         # Page components
β”‚   β”‚   β”œβ”€β”€ services/      # API services
β”‚   β”‚   β”œβ”€β”€ hooks/         # Custom hooks
β”‚   β”‚   β”œβ”€β”€ utils/         # Utility functions
β”‚   β”‚   └── assets/        # Images, icons, etc.
β”‚   β”œβ”€β”€ index.html
β”‚   └── package.json
└── README.md

πŸ”§ Configuration

Environment Variables

Backend (.env)

NODE_ENV=development
PORT=5000
MONGO_URI=mongodb://localhost:27017/cogo
JWT_SECRET=your-super-secret-jwt-key
SESSION_SECRET=your-session-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
CLIENT_URL=http://localhost:5173

Frontend (.env)

VITE_API_URL=http://localhost:5000/api
VITE_APP_NAME=CoGo
VITE_GOOGLE_CLIENT_ID=your-google-client-id

πŸ§ͺ Testing

# Backend tests
cd backend
npm test

# Frontend tests
cd frontend
npm test

πŸ—οΈ Building for Production

# Build frontend
cd frontend
npm run build

# Build and start backend
cd backend
npm run build
npm start

πŸš€ Deployment

Docker Deployment

  1. Build Docker images
# Backend
cd backend
docker build -t cogo-backend .

# Frontend
cd frontend
docker build -t cogo-frontend .
  1. Run with Docker Compose
docker-compose up -d

Manual Deployment

  1. Deploy Backend (e.g., on Heroku, Railway, or DigitalOcean)
  2. Deploy Frontend (e.g., on Vercel, Netlify, or Cloudflare Pages)
  3. Set up MongoDB (MongoDB Atlas recommended)
  4. Configure environment variables on your hosting platform

πŸ“Š Performance Optimizations

  • Code Splitting - Dynamic imports for route-based splitting
  • Lazy Loading - Images and components loaded on demand
  • Bundle Optimization - Tree shaking and minification
  • Caching - Browser caching with proper headers
  • CDN Ready - Static assets optimized for CDN delivery

πŸ”’ Security Features

  • Input Validation - Server-side validation with express-validator
  • Rate Limiting - API rate limiting to prevent abuse
  • CORS Configuration - Proper cross-origin resource sharing
  • Security Headers - Helmet.js for security headers
  • Data Sanitization - Protection against NoSQL injection
  • Password Security - Bcrypt hashing with salt rounds

β™Ώ Accessibility Features

  • ARIA Labels - Proper labeling for screen readers
  • Keyboard Navigation - Full keyboard accessibility
  • Focus Management - Proper focus indication and trapping
  • Color Contrast - WCAG AA compliant color ratios
  • Screen Reader Support - Semantic HTML and proper structure

πŸ“± Progressive Web App

  • Service Worker - Offline functionality and caching
  • Web App Manifest - App-like experience on mobile
  • Push Notifications - Real-time updates (coming soon)
  • Install Prompt - Add to home screen functionality

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ†˜ Support

If you encounter any issues or have questions:

  1. Check the Issues page
  2. Create a new issue with detailed information
  3. Contact the development team

πŸ—ΊοΈ Roadmap

Phase 1 - Core Features βœ…

  • User authentication and authorization
  • Ride booking system
  • Driver registration
  • Basic search functionality

Phase 2 - Enhanced Features 🚧

  • Real-time chat between riders and drivers
  • Push notifications for ride updates
  • Advanced search filters
  • Ride history and receipts
  • Rating and review system

Phase 3 - Advanced Features πŸ“…

  • Payment integration (Stripe/PayPal)
  • Route optimization with Google Maps
  • Admin dashboard with analytics
  • Mobile app (React Native)
  • Multi-language support (i18n)
  • Automated ride matching
  • Carbon footprint tracking

πŸ‘₯ Contributors

Thanks to all the amazing people who have contributed to this project!

πŸ“ž Contact & Support

⭐ Star History

If you find this project useful, please consider giving it a star!

Star History Chart

πŸ“œ Acknowledgments


Built with ❀️ by the CoGo Team

If you like this project, please consider giving it a ⭐!

Back to Top

About

Modern, secure carpooling platform built with React, Node.js, and MongoDB. Features real-time ride matching, Google OAuth, and PWA capabilities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages