{"id":28909137,"url":"https://github.com/codewithismail/ride-sharing-system","last_synced_at":"2026-02-08T00:31:36.562Z","repository":{"id":293976986,"uuid":"985658219","full_name":"CodeWithIsmail/Ride-Sharing-System","owner":"CodeWithIsmail","description":"Ride Sharing System || SE 606 - Software Design \u0026 Analysis course project","archived":false,"fork":false,"pushed_at":"2025-08-09T04:18:26.000Z","size":68,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T06:12:29.114Z","etag":null,"topics":["ride-sharing-service","software-design-and-architecture","system-design","system-design-project"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/CodeWithIsmail.png","metadata":{"files":{"readme":"README-Docker.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}},"created_at":"2025-05-18T08:48:26.000Z","updated_at":"2025-08-09T04:18:30.000Z","dependencies_parsed_at":"2025-05-18T10:22:51.594Z","dependency_job_id":"10f7800c-254e-4426-8a12-272fb1db3781","html_url":"https://github.com/CodeWithIsmail/Ride-Sharing-System","commit_stats":null,"previous_names":["codewithismail/ride-sharing-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/CodeWithIsmail/Ride-Sharing-System","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithIsmail%2FRide-Sharing-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithIsmail%2FRide-Sharing-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithIsmail%2FRide-Sharing-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithIsmail%2FRide-Sharing-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CodeWithIsmail","download_url":"https://codeload.github.com/CodeWithIsmail/Ride-Sharing-System/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CodeWithIsmail%2FRide-Sharing-System/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29214394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T00:10:47.190Z","status":"ssl_error","status_checked_at":"2026-02-08T00:10:43.589Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["ride-sharing-service","software-design-and-architecture","system-design","system-design-project"],"created_at":"2025-06-21T17:07:32.960Z","updated_at":"2026-02-08T00:31:36.557Z","avatar_url":"https://github.com/CodeWithIsmail.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ride Sharing System - Docker Setup\n\nA complete microservice-based ride-sharing application with Docker containerization.\n\n## 🐳 Quick Start with Docker\n\n### Prerequisites\n\n- **Docker** (v20.10 or higher)\n- **Docker Compose** (v2.0 or higher)\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd Ride-Sharing-System\n   ```\n\n2. **Run the Docker setup script**\n   ```bash\n   npm run docker:setup\n   ```\n   \n   Or manually:\n   ```bash\n   chmod +x docker-setup.sh\n   ./docker-setup.sh\n   ```\n\n3. **Access the application**\n   - Frontend: http://localhost:3000\n   - User Service: http://localhost:3001\n   - Ride Service: http://localhost:3002\n   - Payment Service: http://localhost:3003\n   - Admin Service: http://localhost:3004\n\n## 🏗️ Architecture\n\nThe application runs in 6 containers:\n\n| Service | Port | Description |\n|---------|------|-------------|\n| **MongoDB** | 27017 | Database with authentication |\n| **User Service** | 3001 | Authentication \u0026 user management |\n| **Ride Service** | 3002 | Ride requests \u0026 applications |\n| **Payment Service** | 3003 | Payment processing |\n| **Admin Service** | 3004 | Admin dashboard |\n| **Frontend** | 3000 | React application |\n\n## 🚀 Docker Commands\n\n### Basic Operations\n\n```bash\n# Start all services\nnpm run docker:up\n\n# Stop all services\nnpm run docker:down\n\n# Build and start (force rebuild)\nnpm run docker:build\n\n# View logs\nnpm run docker:logs\n\n# Clean up everything (including volumes)\nnpm run docker:clean\n```\n\n### Manual Docker Commands\n\n```bash\n# Start services in background\ndocker-compose up -d\n\n# Start services with logs\ndocker-compose up\n\n# Stop services\ndocker-compose down\n\n# Rebuild and start\ndocker-compose up --build -d\n\n# View service status\ndocker-compose ps\n\n# View logs for specific service\ndocker-compose logs -f user-service\n\n# Execute commands in container\ndocker-compose exec user-service sh\n```\n\n## 🗄️ Database Setup\n\nMongoDB is automatically initialized with:\n\n- **Authentication**: `admin/password123`\n- **Databases**: \n  - `ride-sharing-users`\n  - `ride-sharing-rides`\n  - `ride-sharing-payments`\n  - `ride-sharing-admin`\n- **Collections**: Automatically created with proper indexes\n- **Test Admin User**: `admin@ridesystem.com` / `admin123`\n\n## 🔧 Environment Variables\n\nAll environment variables are configured in `docker-compose.yml`:\n\n### MongoDB\n```yaml\nMONGO_INITDB_ROOT_USERNAME: admin\nMONGO_INITDB_ROOT_PASSWORD: password123\n```\n\n### User Service\n```yaml\nMONGODB_URI: mongodb://admin:password123@mongodb:27017/ride-sharing-users?authSource=admin\nJWT_SECRET: your-super-secret-jwt-key-change-in-production\n```\n\n### Ride Service\n```yaml\nMONGODB_URI: mongodb://admin:password123@mongodb:27017/ride-sharing-rides?authSource=admin\nUSER_SERVICE_URL: http://user-service:3001\n```\n\n### Payment Service\n```yaml\nMONGODB_URI: mongodb://admin:password123@mongodb:27017/ride-sharing-payments?authSource=admin\nRIDE_SERVICE_URL: http://ride-service:3002\nUSER_SERVICE_URL: http://user-service:3001\n```\n\n### Admin Service\n```yaml\nMONGODB_URI: mongodb://admin:password123@mongodb:27017/ride-sharing-admin?authSource=admin\nUSER_SERVICE_URL: http://user-service:3001\nRIDE_SERVICE_URL: http://ride-service:3002\n```\n\n## 📊 Database Schema\n\n### Users Collection\n```json\n{\n  \"_id\": ObjectId,\n  \"email\": String,\n  \"password\": String,\n  \"name\": String,\n  \"role\": String,\n  \"phone\": String,\n  \"isActive\": Boolean,\n  \"createdAt\": Date\n}\n```\n\n### RideRequests Collection\n```json\n{\n  \"_id\": ObjectId,\n  \"passengerId\": ObjectId,\n  \"pickupLocation\": String,\n  \"dropoffLocation\": String,\n  \"targetTime\": Date,\n  \"desiredFare\": Number,\n  \"status\": String,\n  \"driverId\": ObjectId,\n  \"createdAt\": Date\n}\n```\n\n### RideApplications Collection\n```json\n{\n  \"_id\": ObjectId,\n  \"rideRequestId\": ObjectId,\n  \"driverId\": ObjectId,\n  \"appliedAt\": Date\n}\n```\n\n### Payments Collection\n```json\n{\n  \"_id\": ObjectId,\n  \"rideRequestId\": ObjectId,\n  \"amount\": Number,\n  \"paymentMethod\": String,\n  \"status\": String,\n  \"receiptSentAt\": Date,\n  \"createdAt\": Date\n}\n```\n\n## 🔍 Troubleshooting\n\n### Common Issues\n\n1. **Port already in use**\n   ```bash\n   # Check what's using the port\n   lsof -i :3000\n   \n   # Stop conflicting services\n   docker-compose down\n   ```\n\n2. **MongoDB connection issues**\n   ```bash\n   # Check MongoDB logs\n   docker-compose logs mongodb\n   \n   # Restart MongoDB\n   docker-compose restart mongodb\n   ```\n\n3. **Service not starting**\n   ```bash\n   # Check all logs\n   docker-compose logs\n   \n   # Rebuild specific service\n   docker-compose up --build user-service\n   ```\n\n4. **Permission issues (Linux/Mac)**\n   ```bash\n   # Make setup script executable\n   chmod +x docker-setup.sh\n   ```\n\n### Health Checks\n\nEach service includes health checks. Check status with:\n\n```bash\ndocker-compose ps\n```\n\n### Logs\n\n```bash\n# All services\ndocker-compose logs -f\n\n# Specific service\ndocker-compose logs -f user-service\n\n# Last 100 lines\ndocker-compose logs --tail=100\n```\n\n## 🧪 Testing\n\n### API Testing\n\nTest the services using curl:\n\n```bash\n# Health check\ncurl http://localhost:3001/health\n\n# Register user\ncurl -X POST http://localhost:3001/api/users/register \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"test@example.com\",\"password\":\"password123\",\"name\":\"Test User\",\"role\":\"passenger\"}'\n\n# Login\ncurl -X POST http://localhost:3001/api/users/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"email\":\"test@example.com\",\"password\":\"password123\"}'\n```\n\n### Database Access\n\n```bash\n# Connect to MongoDB\ndocker-compose exec mongodb mongosh -u admin -p password123\n\n# List databases\nshow dbs\n\n# Use specific database\nuse ride-sharing-users\n\n# Show collections\nshow collections\n```\n\n## 🚀 Production Deployment\n\nFor production deployment:\n\n1. **Update environment variables** in `docker-compose.yml`\n2. **Use production MongoDB** (MongoDB Atlas recommended)\n3. **Set proper JWT secrets**\n4. **Configure reverse proxy** (nginx/traefik)\n5. **Set up monitoring** (Prometheus/Grafana)\n6. **Use Docker secrets** for sensitive data\n\n### Production Docker Compose Example\n\n```yaml\nversion: '3.8'\nservices:\n  mongodb:\n    image: mongo:6.0\n    environment:\n      MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}\n      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}\n    volumes:\n      - mongodb_data:/data/db\n    networks:\n      - app-network\n\n  user-service:\n    build: ./backend/user-service\n    environment:\n      MONGODB_URI: ${MONGODB_URI}\n      JWT_SECRET: ${JWT_SECRET}\n    networks:\n      - app-network\n    depends_on:\n      - mongodb\n```\n\n## 📝 Development\n\n### Adding New Services\n\n1. Create service directory in `backend/`\n2. Add Dockerfile\n3. Update `docker-compose.yml`\n4. Add service to npm scripts\n\n### Modifying Services\n\n```bash\n# Rebuild specific service\ndocker-compose up --build user-service\n\n# View service logs\ndocker-compose logs -f user-service\n\n# Execute commands in service\ndocker-compose exec user-service sh\n```\n\n## 🎯 Next Steps\n\n- [ ] Add Redis for caching\n- [ ] Implement message queues (RabbitMQ)\n- [ ] Add monitoring and logging\n- [ ] Set up CI/CD pipeline\n- [ ] Add automated testing\n- [ ] Implement rate limiting\n- [ ] Add API documentation (Swagger)\n\n## 📞 Support\n\nFor issues and questions:\n1. Check the troubleshooting section\n2. Review service logs\n3. Open an issue in the repository ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithismail%2Fride-sharing-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodewithismail%2Fride-sharing-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodewithismail%2Fride-sharing-system/lists"}