A modern, secure, and user-friendly carpooling platform built with React and Node.js.
- π Secure Authentication - JWT tokens, Google OAuth, password hashing
- π¨ Modern UI/UX - Responsive design with Tailwind CSS and Framer Motion
- βΏ Accessibility - WCAG compliant with proper ARIA labels and keyboard navigation
- π Performance Optimized - Code splitting, lazy loading, and optimized bundles
- π SEO Ready - Meta tags, OpenGraph, and structured data
- π± Mobile First - Fully responsive design for all devices
- π‘οΈ Security First - Rate limiting, input validation, and XSS protection
- π PWA Ready - Service worker and offline capabilities
- React 19 - Latest React with concurrent features
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- Framer Motion - Smooth animations and transitions
- React Router - Client-side routing
- React Hook Form - Form validation and handling
- Axios - HTTP client with interceptors
- Sonner - Toast notifications
- Zod - Schema validation
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - ODM for MongoDB
- JWT - JSON Web Tokens for authentication
- Passport.js - Authentication middleware
- Helmet - Security headers
- Express Rate Limit - Rate limiting
- Bcrypt - Password hashing
- Node.js 18+
- MongoDB 4.4+
- Git
- Clone the repository
git clone https://github.com/your-username/cogo-carpooling.git
cd cogo-carpooling- Install root dependencies
npm install- Set up Backend
cd backend
npm install
# Create environment file
cp .env.example .env
# Edit .env with your MongoDB URI and other settings- Set up Frontend
cd ../frontend
npm install
# Create environment file
cp .env.example .env
# Edit .env with your API URL and other settings- Start Development Servers
Backend (Terminal 1):
cd backend
npm run devFrontend (Terminal 2):
cd frontend
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
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
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:5173Frontend (.env)
VITE_API_URL=http://localhost:5000/api
VITE_APP_NAME=CoGo
VITE_GOOGLE_CLIENT_ID=your-google-client-id# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test# Build frontend
cd frontend
npm run build
# Build and start backend
cd backend
npm run build
npm start- Build Docker images
# Backend
cd backend
docker build -t cogo-backend .
# Frontend
cd frontend
docker build -t cogo-frontend .- Run with Docker Compose
docker-compose up -d- Deploy Backend (e.g., on Heroku, Railway, or DigitalOcean)
- Deploy Frontend (e.g., on Vercel, Netlify, or Cloudflare Pages)
- Set up MongoDB (MongoDB Atlas recommended)
- Configure environment variables on your hosting platform
- 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
- 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
- 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
- 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
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the development team
- Real-time chat between riders and drivers
- Push notifications for ride updates
- Payment integration
- Route optimization
- Admin dashboard
- Mobile app (React Native)
- Multi-language support
Built with β€οΈ by the CoGo Team+ Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
If you are developing a production application, we recommend using TypeScript with type-aware lint rules enabled. Check out the TS template for information on how to integrate TypeScript and typescript-eslint in your project.