{"id":42273084,"url":"https://github.com/coder7475/ride-booking-system","last_synced_at":"2026-01-27T07:30:40.675Z","repository":{"id":307126729,"uuid":"1028210781","full_name":"coder7475/ride-booking-system","owner":"coder7475","description":"A secure, scalable, and role-based backend API for a ride booking system using Express.js and Mongoose.","archived":false,"fork":false,"pushed_at":"2025-09-20T06:15:02.000Z","size":1464,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-20T07:18:26.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ride.robiulhossain.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coder7475.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-29T07:33:32.000Z","updated_at":"2025-09-20T06:15:05.000Z","dependencies_parsed_at":"2025-08-24T21:07:48.377Z","dependency_job_id":"276de7b5-bbfd-420b-93a1-4c517a8ca5f9","html_url":"https://github.com/coder7475/ride-booking-system","commit_stats":null,"previous_names":["coder7475/ride-booking-system"],"tags_count":1,"template":false,"template_full_name":"coder7475/typescript-monorepo","purl":"pkg:github/coder7475/ride-booking-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder7475%2Fride-booking-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder7475%2Fride-booking-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder7475%2Fride-booking-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder7475%2Fride-booking-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coder7475","download_url":"https://codeload.github.com/coder7475/ride-booking-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coder7475%2Fride-booking-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28808012,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:14:39.408Z","status":"ssl_error","status_checked_at":"2026-01-27T07:14:39.098Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-27T07:30:39.984Z","updated_at":"2026-01-27T07:30:40.668Z","avatar_url":"https://github.com/coder7475.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ride Booking System\n\nA modern, scalable ride-booking platform built with a TypeScript monorepo architecture using Turborepo. This system provides comprehensive functionality for riders, drivers, and administrators similar to popular ride-sharing services like Uber or Lyft.\n\n## 🌟 Features\n\n- **🔐 Role-based Authentication**: Secure JWT-based auth for riders, drivers, and admins\n- **🚗 Ride Management**: Complete ride lifecycle from request to completion\n- **💰 Transaction Processing**: Integrated payment and earnings system\n- **🏗️ Scalable Architecture**: Modular monorepo structure with shared packages\n\n## 🏗️ Architecture\n\nThis monorepo contains the following apps and packages:\n\n### 📱 Applications\n\n- **`backend`**: Express.js REST API with MongoDB integration\n  - User authentication and authorization\n  - Ride management system\n  - Driver and rider functionality\n  - Admin panel APIs\n  - Transaction processing\n- **`frontend`**: React + Vite application for the user interface\n  - Modern Vite build system for fast development\n  - Responsive design with TailwindCSS\n  - Role-based UI components\n  - Redux Toolkit for state management\n  - Real-time updates\n\n### 📦 Shared Packages\n\n- **`@repo/db`**: Database utilities and MongoDB connector with Redis support\n- **`@repo/utils`**: Common utilities including:\n  - JWT token management\n  - Password hashing\n  - Email providers (Gmail, Resend)\n  - OTP generation\n  - Transaction ID generation\n  - URL slug utilities\n- **`@repo/math`**: Mathematical utilities for fare calculations and parsing\n- **`@repo/ui`**: Shared React component library (using Radix UI and TailwindCSS)\n\n### ⚙️ Configuration Packages\n\n- **`@repo/eslint-config`**: ESLint configurations for Next.js and React\n- **`@repo/prettier-config`**: Prettier formatting configurations\n- **`@repo/typescript-config`**: TypeScript configurations for different project types\n\nEach package/app is 100% [TypeScript](https://www.typescriptlang.org/) with strict type checking.\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- **Node.js** \u003e= 18.0.0\n- **pnpm** \u003e= 8.0.0 (recommended package manager)\n- **MongoDB** database\n\n### Installation\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd ride-booking-system\n   ```\n\n2. **Install dependencies:**\n\n   ```bash\n   pnpm install\n   ```\n\n3. **Environment Setup:**\n\n   ```bash\n   # Copy environment files\n   cp apps/backend/.env.example apps/backend/.env\n   cp apps/frontend/.env.example apps/frontend/.env\n   ```\n\n4. **Configure Environment Variables:**\n\n   **Backend (.env):**\n   ```env\n   # Server Configuration\n   PORT=3000\n   HOST=localhost\n   NODE_ENV=development\n   DB_URI=\"mongodb://127.0.0.1:27017/practice\"\n   \n   # JWT Configuration\n   JWT_ACCESS_SECRET=\"access\"\n   JWT_ACCESS_EXPIRES=\"15m\"\n   JWT_REFRESH_SECRET=\"refresh\"\n   JWT_REFRESH_EXPIRES=\"1d\"\n   \n   # Hash Salt\n   PASSWORD_HASH_SALT=12\n   ```\n\n   **Frontend (.env):**\n   ```env\n   VITE_BASE_URL=\"http://localhost:3001/api/v1\"\n   VITE_GEOCODING_API_KEY=\"your_geocoding_api_key_here\"\n   ```\n\n### Development\n\n```bash\n# Run all applications in development mode\npnpm dev\n\n# Run only the backend\npnpm backend\n\n# Run specific app\npnpm dev --filter=frontend\npnpm dev --filter=backend\n```\n\n### Production Build\n\n```bash\n# Build all packages and apps\npnpm build\n\n# Start production server\ncd apps/backend \u0026\u0026 pnpm start\n```\n\n## 📚 API Documentation\n\nThe backend provides a comprehensive REST API with the following endpoints:\n\n### 🔐 **Authentication APIs**\n\n| Method | Endpoint                | Description                     |\n| ------ | ----------------------- | ------------------------------- |\n| POST   | `/auth/register`        | Register a new user             |\n| POST   | `/auth/login`           | Login and receive JWTs          |\n| POST   | `/auth/refresh-token`   | Refresh access token            |\n| POST   | `/auth/logout`          | Invalidate token/logout         |\n| POST   | `/auth/forgot-password` | Request password reset email    |\n| POST   | `/auth/reset-password`  | Reset password with token       |\n| POST   | `/auth/change-password` | Change password (authenticated) |\n\n### 🔑 **OTP APIs**\n\n| Method | Endpoint      | Description                     |\n| ------ | ------------- | ------------------------------- |\n| POST   | `/otp/send`   | Send OTP to email or SMS        |\n| POST   | `/otp/verify` | Verify OTP provided by the user |\n\n### 👤 **User APIs**\n\n| Method | Endpoint    | Description                      |\n| ------ | ----------- | -------------------------------- |\n| GET    | `/user/me`  | Get current user info (self)     |\n| PATCH  | `/user/me`  | Update profile info              |\n| DELETE | `/user/me`  | Deactivate or delete own account |\n| GET    | `/user/:id` | Get public profile of a user     |\n\n### 🚗 **Driver APIs**\n\n| Method | Endpoint               | Description                       |\n| ------ | ---------------------- | --------------------------------- |\n| POST   | `/drivers/apply`       | Apply to become a driver          |\n| GET    | `/drivers/me`          | Get driver profile                |\n| PATCH  | `/drivers/me/status`   | Update online/availability status |\n| GET    | `/drivers/me/earnings` | View earning history              |\n| GET    | `/drivers/:id`         | Get Driver Details by Id          |\n\n### 🚕 Ride Management\n\n| Method | Endpoint                 | Description                                       |\n| ------ | ------------------------ | ------------------------------------------------- |\n| GET    | `/rides/fare`            | Estimate fare of a ride                           |\n| POST   | `/rides/request`         | Rider requests a new ride                         |\n| PATCH  | `/rides/:id/accept`      | Driver accepts ride                               |\n| PATCH  | `/rides/:id/picked`      | Update ride status to PICKED_UP                   |\n| PATCH  | `/rides/:id/transit`     | Update ride status to IN_TRANSIT                  |\n| PATCH  | `/rides/:id/complete`    | Update ride status to COMPLETED                   |\n| PATCH  | `/rides/:id/cancel`      | Cancel ride before pickup                         |\n| GET    | `/rides/me`              | List ride history for current user                |\n| GET    | `/rides/:id`             | Get ride details                                  |\n| GET    | `/rides/requests/nearby` | Get all requested rides near the drivers location |\n| GET    | `/rides/activeRides`     | Get all active ride of driver                     |\n\n### 💰 Transactions\n\n- `PATCH /api/v1/transactions/pay` - Process ride payment\n\n### 👨‍💼 Admin Panel\n\n- `GET /api/v1/admin/users` - List all users\n- `GET /api/v1/admin/drivers` - List all drivers\n- `GET /api/v1/admin/rides` - List all rides\n- `PATCH /api/v1/admin/drivers/:id/approve` - Approve driver application\n- `PATCH /api/v1/admin/users/:id/block` - Block user account\n\nFor detailed API documentation, see [API_Design.md](apps/backend/API_Design.md).\n\n## 🏗️ Project Structure\n\n```\nride-booking-system/\n├── apps/\n│   ├── backend/              # Express.js API server\n│   │   ├── src/\n│   │   │   ├── modules/      # Feature modules (auth, user, ride, etc.)\n│   │   │   ├── middlewares/  # Express middlewares\n│   │   │   ├── utils/        # Utility functions\n│   │   │   ├── types/        # TypeScript type definitions\n│   │   │   └── configs/      # Configuration files\n│   │   └── dist/             # Compiled JavaScript\n│   └── frontend/             # React + Vite application\n│       ├── src/\n│       ├── public/\n│       └── dist/\n├── packages/\n│   ├── db/                   # Database utilities\n│   ├── utils/                # Shared utilities\n│   ├── math/                 # Mathematical functions\n│   └── ui/                   # React components\n├── configs/\n│   ├── eslint-config/        # ESLint configurations\n│   ├── prettier-config/      # Prettier configurations\n│   └── typescript-config/    # TypeScript configurations\n└── turbo.json                # Turborepo configuration\n```\n\n### Utilities\n\nThis Turborepo has some additional tools already setup for you:\n\n- [TypeScript](https://www.typescriptlang.org/) for static type checking\n- [ESLint](https://eslint.org/) for code linting\n- [Prettier](https://prettier.io) for code formatting\n\n## 🚀 Deployment\n\n### Backend Deployment\n\nThe backend is configured for deployment on platforms like Vercel, Railway, or any Node.js hosting service.\n\n```bash\n# Build for production\npnpm build --filter=backend\n\n# Start production server\ncd apps/backend \u0026\u0026 pnpm start\n```\n\n### Frontend Deployment\n\nThe frontend can be deployed to Vercel, Netlify, Cloudflare Pages, or any static hosting service.\n\n```bash\n# Build for production\npnpm build --filter=frontend\n\n# Preview production build locally\npnpm preview --filter=frontend\n\n# Deploy to Cloudflare (if configured)\npnpm deploy --filter=frontend\n```\n\n## 🛠️ Available Scripts\n\n```bash\n# Development\npnpm dev              # Run all apps in development\npnpm backend          # Run only backend\npnpm dev --filter=*   # Run specific app\n\n# Building\npnpm build            # Build all packages and apps\npnpm build --filter=* # Build specific package\n\n# Code Quality\npnpm lint             # Lint all packages\npnpm format           # Format code with Prettier\npnpm check-types      # Type check all packages\n\n# Cleaning\npnpm clean            # Clean all build artifacts\n```\n\n### Remote Caching\n\n\u003e [!TIP]\n\u003e Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk\u0026utm_campaign=free_remote_cache).\n\nTurborepo can use a technique known as [Remote Caching](https://turborepo.com/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.\n\nBy default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup?utm_source=turborepo-examples), then enter the following commands:\n\n```\ncd my-turborepo\n\n# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)\nturbo login\n\n# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager\nnpx turbo login\nyarn exec turbo login\npnpm exec turbo login\n```\n\nThis will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).\n\nNext, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:\n\n```\n# With [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation) installed (recommended)\nturbo link\n\n# Without [global `turbo`](https://turborepo.com/docs/getting-started/installation#global-installation), use your package manager\nnpx turbo link\nyarn exec turbo link\npnpm exec turbo link\n```\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nYou are free to use, modify, and distribute this software in accordance with the terms of the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder7475%2Fride-booking-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoder7475%2Fride-booking-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoder7475%2Fride-booking-system/lists"}