Front-End For the Taxi Management System. It provides real-time updates on driver and trip statuses, detailed trip information, and includes a robust dashboard with insights.
- Real-Time Google Map Updates: Real-time location updates of the taxi on Google Maps based on WebSocket data.
- Driver Details: View driver’s current status, location, and trip history.
- Trip Details: Comprehensive trip information, including current passenger, trip path, and live location updates.
| Package | Description |
|---|---|
axios |
Promise-based HTTP client for API requests and handling responses. |
recharts |
Library for building charts for the dashboard analytics and insights. |
swr |
Data fetching library for caching and updating data, enhancing UX. |
@biomejs/biome |
Code linter and formatter for consistent code style and error checking. |
@tanstack/react-router |
Advanced routing for dynamic pages like driver and trip details. |
@vis.gl/react-google-maps |
Provides efficient interaction with Google Maps and mapping functionalities. |
@react-google-maps/api |
Enables integration of Google Maps into the app, supporting map components. |
src
├── assets # Static assets (e.g., CSS)
├── components # Reusable UI components and pages
│ ├── extra # Extra components (e.g., Login, SVGLibrary)
│ ├── pages # Page components organized by domain
│ │ ├── dashboard # Dashboard pages with trip and driver insights
│ │ ├── drivers # Components for driver info and status display
│ │ ├── trips # Trip-related components (e.g., CurrentLocation, TripInfo)
│ ├── shared # Shared UI components (e.g., Sidebar, ThemeChanger)
│ └── ui # UI-specific components and libraries
├── hooks # Custom hooks (e.g., `useDrivers`, `useTrips`)
├── lib # Utility functions and axios interceptor
├── providers # Context providers (e.g., `IntentProvider`, `ThemeProviders`)
├── routes # Route definitions and lazy-loaded routes
├── services # API service modules
└── vite-env.d.ts # Type definitions
- Dashboard Components (
components/pages/dashboard): IncludesDriversStatus,EarningsInsights, andRecentTrips. - Driver Components (
components/pages/drivers): Includes driver status and map components likeCurrentStatusandMapLocationComponent. - Trip Components (
components/pages/trips): ProvidesCurrentLocation,CurrentPassenger, andTripInfofor trip details. - Shared Components (
components/shared): Common components likeSidebar,ThemeChanger, and loading skeletons.
- Node.js (version 20.x or above)
- Yarn or npm
-
Clone the Repository
git clonehttps://github.com/a4arpon/ryder-web.git cd ryder-web -
Install Dependencies
yarn install # or with npm npm install -
Environment Variables Create a
.envfile in the root directory and add the following:VITE_GOOGLE_API_KEY=your_google_maps_api_key VITE_API_URL=http://127.0.0.1:8000/api -
Start Development Server
yarn dev # or with npm npm run dev
- Real-Time Map Updates: The
CurrentLocationcomponent uses Google Maps API to display real-time updates on the taxi's location. - WebSocket Connection: The app utilizes WebSocket at
ws://127.0.0.1:8000/ws/trip_updates/for live updates on the taxi’s current location.
-
Components:
CurrentLocation: Displays the current location of the taxi on Google Maps.DriversStatusandPendingDashboard: Dashboard components that show driver and trip statuses.TripInfoandCurrentPassenger: Show detailed trip and passenger info.
-
Hooks:
useDrivers: Fetches driver data and manages driver state.useTrips: Fetches trip data and manages trip information.
- Netlify Link