A modern, full-stack ride-sharing application built specifically for college students to connect and share rides efficiently. Features real-time tracking, chat, secure authentication, and an intuitive user interface.
- π Secure Authentication - Firebase-based user authentication with role-based access
- π Ride Management - Create, search, book, and manage rides
- πΊοΈ Real-time Maps - Interactive maps powered by Mapbox GL JS
- π Live Tracking - Real-time driver location tracking
- π¬ In-Ride Chat - Direct messaging between drivers and passengers
- π Push Notifications - Firebase Cloud Messaging integration
- β Reviews & Ratings - Rate and review drivers and passengers
- π± Responsive Design - Mobile-first, works on all devices
- π Theme Support - Light, dark, and system theme options
- β‘ Fast Development - Vite for lightning-fast HMR
- π― Type Safety - Full TypeScript support with strict mode
- π¨ Modern UI - Tailwind CSS for beautiful, responsive interfaces
- π State Management - Zustand for lightweight, efficient state
- π¦ Code Splitting - Optimized bundle sizes with smart chunking
- π‘οΈ Error Boundaries - Graceful error handling throughout the app
- β Environment Validation - Automatic validation of configuration
- π§ Developer Tools - ESLint, Prettier, TypeScript for code quality
Before you begin, ensure you have the following installed:
- Node.js (v18.0.0 or higher) - Download
- npm (v9.0.0 or higher) or yarn (v1.22.0 or higher)
- Git - Download
You'll also need accounts for:
git clone https://github.com/yourusername/ridefront.git
cd ridefrontnpm install
# or
yarn installCopy the example environment file and update it with your credentials:
cp env.example .envEdit .env and replace the placeholder values:
# Backend API URL
VITE_API_BASE_URL=http://localhost:8000
# Mapbox Token (Get from: https://account.mapbox.com/access-tokens/)
VITE_MAPBOX_TOKEN=your_actual_mapbox_token
# Firebase Configuration (Get from: https://console.firebase.google.com/)
VITE_FIREBASE_API_KEY=your_firebase_api_key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.firebasestorage.app
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
VITE_FIREBASE_APP_ID=your_app_id
VITE_FIREBASE_MEASUREMENT_ID=your_measurement_id
VITE_FIREBASE_VAPID_KEY=your_vapid_keynpm run dev
# or
yarn devThe application will open at http://localhost:3000
| Script | Description |
|---|---|
npm run dev |
Start development server with hot reload |
npm run build |
Build production-ready bundle |
npm run preview |
Preview production build locally |
npm run lint |
Run ESLint to check code quality |
npm run lint:fix |
Auto-fix ESLint errors |
npm run format |
Format code with Prettier |
npm run format:check |
Check if code is properly formatted |
npm run type-check |
Run TypeScript type checking |
npm run validate |
Run all checks (types, lint, format) |
npm run clean |
Remove build artifacts |
ridefront/
βββ public/ # Static assets
β βββ manifest.json # PWA manifest
β βββ icons/ # App icons
βββ src/
β βββ assets/ # Images, fonts, etc.
β βββ components/ # Reusable React components
β β βββ AuthGuard.tsx # Route protection component
β β βββ ErrorBoundary.tsx # Error handling component
β β βββ LoadingSpinner.tsx
β β βββ MapboxMap.tsx
β βββ hooks/ # Custom React hooks
β β βββ useStore.ts # Zustand store
β βββ pages/ # Page components
β β βββ HomePage.tsx
β β βββ LoginPage.tsx
β β βββ RideSearchPage.tsx
β β βββ ...
β βββ services/ # API and external services
β β βββ api.ts # Backend API service
β β βββ auth.ts # Authentication service
β β βββ firebase.ts # Firebase configuration
β β βββ location.ts # Location services
β βββ types/ # TypeScript type definitions
β β βββ index.ts
β βββ utils/ # Utility functions
β β βββ index.ts # Common utilities
β β βββ validateEnv.ts # Environment validation
β βββ App.tsx # Main app component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ .env.example # Environment variables template
βββ .prettierrc # Prettier configuration
βββ eslint.config.js # ESLint configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ package.json # Project dependencies
- Go to Firebase Console
- Create a new project (or select existing)
- Enable Authentication with Email/Password
- Enable Firestore Database
- Enable Cloud Messaging for push notifications
- Get your configuration from Project Settings β General
- Add the configuration to your
.envfile
- Create account at Mapbox
- Go to Access Tokens
- Create a new token with these scopes:
styles:readfonts:readdatasets:readgeocoding:readdirections:read
- Copy the token to your
.envfile
# Build optimized production bundle
npm run build
# Preview production build locally
npm run previewThe production files will be in the dist/ directory, ready for deployment.
# Install Vercel CLI
npm install -g vercel
# Deploy
vercelOr connect your GitHub repository to Vercel for automatic deployments.
# Install Netlify CLI
npm install -g netlify-cli
# Build and deploy
npm run build
netlify deploy --prod --dir=distMake sure to set all environment variables in your hosting platform:
- Vercel: Project Settings β Environment Variables
- Netlify: Site Settings β Build & Deploy β Environment
# Run type checking
npm run type-check
# Run linting
npm run lint
# Check formatting
npm run format:check
# Run all validations
npm run validateThis project uses:
- ESLint for code linting
- Prettier for code formatting
- TypeScript for type safety
To maintain consistency:
# Auto-format code
npm run format
# Auto-fix lint issues
npm run lint:fixWe welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run validations (
npm run validate) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Follow conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
If port 3000 is in use, Vite will automatically use the next available port. You can also specify a port:
npm run dev -- --port 3001- Ensure
.envfile exists in the root directory - Restart the development server
- Check that variables start with
VITE_ - Verify no syntax errors in
.env
# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
# Clear Vite cache
rm -rf node_modules/.vite- Check Firebase configuration in
.env - Ensure Firebase services are enabled in console
- Verify domain is authorized in Firebase Authentication settings
- Verify Mapbox token is valid
- Check token has required scopes
- Ensure token is not restricted to other domains
- APP_FEATURES.md - Complete list of features
- ENVIRONMENT_SETUP.md - Detailed setup guide
- PROJECT_RESEARCH_REFERENCES.md - Research and references
- apidocs.md - API documentation
This project is licensed under the MIT License - see the LICENSE file for details.
- Development Team - [Your Team/Organization]
- Contact - support@rideshare.com
- React - UI framework
- Vite - Build tool
- Firebase - Backend services
- Mapbox - Maps platform
- Tailwind CSS - CSS framework
- Zustand - State management
- Lucide React - Icon library
- π§ Email: support@rideshare.com
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Made with β€οΈ for college students
Happy Ride Sharing! ππ¨