A full-stack ride-sharing platform built with Spring Boot backend and React frontends, implementing enterprise-level design patterns and modern software architecture.
SwiftRide is a comprehensive ride-sharing system that manages customers, drivers, employees, trips, payments, and complaints. The application demonstrates professional software engineering practices with clean architecture, design patterns, and scalable solutions.
Implemented for flexible trip pricing with add-on features:
- BaseTripDecorator: Core trip fare wrapper
- PremiumTripDecorator: Adds +$25 for premium service
- ChildSeatTripDecorator: Adds +$15 for child seat option
This allows dynamic fare calculation by stacking decorators on top of the base trip fare.
Multiple payment methods with unified interface:
- CashPaymentStrategy: Cash payment processing
- CreditCardPaymentStrategy: Credit card transactions
- WalletPaymentStrategy: Digital wallet payments
Each strategy implements PaymentStrategy interface for consistent payment handling.
PaymentFactory dynamically selects the appropriate payment strategy based on payment type, with automatic dependency injection of all available strategies.
Clean separation between entities and API responses:
- Mappers: CarMapper, CustomerMapper, DriverMapper, TripMapper, PaymentMapper, ComplaintMapper, EmployeeMapper
- DTOs: Prevent over-exposure of entity data and provide API-specific views
DAO interfaces for each entity with JPA implementation:
- CarDAO, CustomerDAO, DriverDAO, TripDAO, PaymentDAO, ComplaintDAO, EmployeeDAO
- Clean abstraction over database operations
Separation of concerns with dedicated service classes:
- Business logic isolated from controllers
- Transactional management
- Reusable service methods
- Three User Roles: Customer, Driver, Employee
- Profile Management: Photo upload, personal information
- Secure Authentication: Role-based access control
- Trip Lifecycle: Request β Pending β Accepted β Completed/Cancelled
- Real-time Updates: Trip status tracking
- Driver Assignment: Automatic driver matching
- Location Services: Pickup and destination management
- Scheduled Trips: Support for future trip scheduling
- Multiple Payment Methods: Cash, Credit Card, Wallet
- Dynamic Fare Calculation: Base fare + decorators (premium, child seat)
- Payment Tracking: Complete payment history
- Flexible Pricing: Extensible decorator pattern for new pricing features
- Customer Complaints: Submit and track issues
- Employee Management: Review and resolve complaints
- Status Tracking: Pending β Resolved
- Email Notifications: Trip confirmations and updates via SMTP
- RabbitMQ Integration: Asynchronous message processing
- Event-Driven Architecture: EmailEvent and EmailListener for decoupled communication
- Profile Photo Upload: Image storage and retrieval
- Static File Serving: Uploaded files accessible via API
- Spring Boot 3.3.5 - Core framework
- Java 17/21 - Programming language
- MySQL - Relational database
- Spring Data JPA - ORM and data access
- Spring Security - Authentication & authorization
- RabbitMQ - Message queue for async processing
- Spring Mail - Email notifications (SMTP)
- Maven - Build and dependency management
- React - UI framework
- Vite - Build tool
- React Router - Navigation
- Axios - HTTP client
- Tailwind CSS - Styling
- Dark Mode - Theme toggle support
- Java 17 or 21
- MySQL Server
- RabbitMQ Server
- Node.js & npm
- Maven
This project is fully containerized using Docker Compose.
- Docker & Docker Compose
- Local MySQL Server (running on port 3306)
- Clone the repository:
git clone https://github.com/SeifHesham2/SwiftRide.git cd SwiftRide - Start the application:
Note: The application is configured to connect to your local MySQL database via
docker-compose up --build
host.docker.internal.
- Customer/Driver Frontend: http://localhost:3002
- Employee Portal: http://localhost:3003
- Backend API: http://localhost:8081
- RabbitMQ Dashboard: http://localhost:15672 (User/Pass: guest/guest)
./mvnw clean install
./mvnw spring-boot:runBackend runs on: http://localhost:8080
cd frontend
npm install
npm run devcd employee-portal
npm install
npm run devSwiftRide/
βββ src/main/java/com/luv2code/springboot/cruddemo/
β βββ controllers/ # REST API endpoints
β βββ service/ # Business logic layer
β βββ dao/ # Data access layer
β βββ entities/ # JPA entities
β βββ dto/ # Data transfer objects
β βββ mapper/ # Entity-DTO mappers
β βββ decorator/ # Decorator pattern (fare calculation)
β βββ strategy/ # Strategy pattern (payment methods)
β βββ factories/ # Factory pattern (payment factory)
β βββ messaging/ # RabbitMQ event handling
β βββ exception/ # Custom exceptions
β βββ handler/ # Global exception handler
β βββ config/ # Spring configuration
β βββ util/ # Utility classes
βββ frontend/ # Customer/Driver React app
βββ employee-portal/ # Employee React app
βββ sql-scripts/ # Database scripts
βββ uploads/ # User uploaded files
- UserBase: Base class for Customer, Driver, Employee (inheritance)
- Trip: Ride information with status tracking
- Car: Vehicle details linked to drivers
- Payment: Payment records with method and status
- Complaint: Customer complaint management
- Enums: TripStatus, PaymentMethod, PaymentStatus, ComplaintStatus, Role
- Spring Security configuration
- Role-based access control (Customer, Driver, Employee)
- Secure password handling
- CORS configuration for frontend integration
Automated email notifications for:
- Trip acceptance confirmation
- Trip status updates
- Driver assignment details
- Responsive Design: Mobile-friendly interface
- Dark Mode: System-wide theme toggle
- Real-time Updates: Live trip status
- Location Autocomplete: Nominatim API integration
- Profile Management: Photo upload and user info
- Toast Notifications: User feedback system
- Inline Validation: Form error handling
Frontend: Vibe coding by Antigravity β¨