A comprehensive carpooling application designed specifically for university students, providing secure and efficient ride-sharing services within the campus community.
- Overview
- Features
- Technology Stack
- Project Structure
- Quick Start
- API Documentation
- Development
- Deployment
- Testing
- Contributing
- License
UniCarpool is a full-stack mobile application that facilitates carpooling among university students. The platform connects drivers and riders, enabling cost-effective and environmentally friendly transportation solutions for the campus community.
- Cost Reduction: Share transportation costs among students
- Environmental Impact: Reduce carbon footprint through shared rides
- Safety: Built-in emergency protocols and user verification
- Convenience: Easy-to-use mobile interface with real-time notifications
- Community: Connect with fellow students and build campus relationships
- JWT-based secure authentication
- Email verification system
- Password recovery and reset functionality
- Role-based access control (Driver/Rider)
-
For Drivers:
- Create and manage rides
- Set departure times, locations, and conditions
- Accept/reject ride requests
- Update ride status (Active, Completed, Cancelled)
- Manage driver availability for cab bookings
-
For Riders:
- Browse and search available rides
- Request to join rides
- Track booking status
- View ride history
- Intuitive mobile interface built with React Native
- Real-time ride updates and notifications
- Profile management and customization
- Rating and review system for completed rides
- SOS alert system
- Emergency contact management
- Automatic notifications to emergency contacts and drivers
- Safety protocols for ride sharing
- Cab booking system for immediate transportation needs
- Alternative transportation options
- Driver availability management
- Automated email notifications
- Ride status updates
- Emergency alert notifications
- Password recovery emails
- Framework: Spring Boot 3.5.6
- Language: Java 23
- Build Tool: Gradle 8.14.3
- Database: MySQL 8.0.30
- Security: Spring Security + JWT
- Email: Spring Boot Mail + Thymeleaf
- Testing: JUnit 5, Mockito (140 total tests)
- Framework: React Native 0.81.5
- Platform: Expo ~54.0.20
- Navigation: Expo Router ~6.0.13
- Language: TypeScript ~5.9.2
- HTTP Client: Axios ^1.13.1
- UI Components: Custom components + Expo Vector Icons
- Containerization: Docker + Docker Compose
- CI/CD: GitLab CI/CD
- Web Server: Nginx (production)
- SSL: Let's Encrypt certificates
- Process Management: systemd
unicarpool/
βββ unicarpool-backend/ # Spring Boot REST API
β βββ src/main/java/ # Java source code
β β βββ com/asdc/unicarpool/
β β βββ config/ # Configuration classes
β β βββ controller/ # REST controllers
β β βββ dto/ # Data Transfer Objects
β β βββ model/ # JPA entities
β β βββ repository/ # Data repositories
β β βββ service/ # Business logic
β β βββ util/ # Utility classes
β βββ src/test/ # Test classes
β βββ docs/ # Documentation
β βββ docker-compose/ # Docker configurations
β βββ db-migration/ # Database scripts
β βββ ci-cd/ # CI/CD configurations
β
βββ unicarpool-frontend/ # React Native mobile app
β βββ app/ # Screen components (Expo Router)
β β βββ (tabs)/ # Tab navigation screens
β β βββ login.tsx # Authentication screens
β β βββ _layout.tsx # Layout configuration
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ services/ # API services
β β βββ contexts/ # React contexts
β β βββ hooks/ # Custom hooks
β β βββ types/ # TypeScript definitions
β β βββ styles/ # Styling
β βββ assets/ # Static assets
β βββ android/ # Android-specific files
β
βββ README.md # This file
Backend Requirements:
- Java Development Kit (JDK) 23+
- Gradle 8.14.3+
- MySQL 8.0+
- Docker (optional)
Frontend Requirements:
- Node.js 18.0.0+
- npm 9.0.0+ or yarn
- Android Studio (for Android development)
- Xcode (for iOS development, macOS only)
-
Clone the repository
git clone <repository-url> cd unicarpool
-
Backend Setup
cd unicarpool-backend # Set up MySQL database mysql -u root -p CREATE DATABASE unicarpool; CREATE USER 'unicarpool_user'@'localhost' IDENTIFIED BY 'your_password'; GRANT ALL PRIVILEGES ON unicarpool.* TO 'unicarpool_user'@'localhost'; # Run database migration mysql -u unicarpool_user -p unicarpool < db-migration/db_migration.sql # Configure application properties # Edit src/main/resources/application.properties # Build and run ./gradlew bootRun
-
Frontend Setup
cd unicarpool-frontend # Install dependencies npm install # Start development server npm start # Run on specific platform npm run android # For Android npm run ios # For iOS npm run web # For web
# Backend with Docker Compose
cd unicarpool-backend/docker-compose
docker-compose -f main.yml up -d
# The application will be available at http://localhost:8080- Development:
http://localhost:8080
POST /api/v1/auth/login- User loginPOST /api/v1/auth/verification-code- Send email verificationPOST /api/v1/auth/verify-code- Verify emailPOST /api/v1/auth/recover-password- Password recovery
POST /api/v1/user/register- Register new userGET /api/v1/user- Get user profilePOST /api/v1/user/update- Update profilePOST /api/v1/user/add-type- Add user role
POST /api/v1/driver/create-ride- Create new rideGET /api/v1/driver/ride- Get driver's ridesPUT /api/v1/driver/{requestId}/accept- Accept ride requestPUT /api/v1/driver/{requestId}/reject- Reject ride request
GET /api/v1/rider/ride/active- Browse available ridesPOST /api/v1/rider/book-ride- Request to join rideGET /api/v1/rider/my-request- View ride requestsPOST /api/v1/rider/rating- Submit ride rating
POST /api/v1/emergency/add-contact- Add emergency contactGET /api/v1/emergency/sos-alert- Send SOS alert
Complete API Documentation: API_DOCUMENTATION.md
Postman Collection: UniCarpool API Collection
cd unicarpool-backend
# Run tests
./gradlew test
# Build application
./gradlew build
# Run with development profile
./gradlew bootRun --args='--spring.profiles.active=dev'cd unicarpool-frontend
# Start development server
npm start
# Run linting
npm run lint
# Build for production
eas build --platform all --profile production- Backend: 140 comprehensive tests (123 unit + 17 integration)
- Code Coverage: Comprehensive test coverage across all layers
- Code Quality Reports: Available in
unicarpool-backend/reports/quality/ - Design Principles: SOLID principles implementation documented
-
VM Deployment (Recommended)
- Complete guide: VM_DEPLOYMENT.md
- Includes Nginx, SSL, and systemd configuration
-
Docker Deployment
- Guide: DOCKER_DEPLOYMENT.md
- Container orchestration with Docker Compose
-
GitLab CI/CD
- Automated deployment pipeline
- Guide: GITLAB_CICD.md
- Development:
application-dev.properties - Production:
application.properties - Docker: Environment variables in
.envfiles
cd unicarpool-backend
# Run all tests
./gradlew test
# Run specific test class
./gradlew test --tests "AuthServiceTest"
# Generate test report
./gradlew test jacocoTestReportTest Coverage:
- Unit Tests: 123 tests covering service layer, utilities, and components
- Integration Tests: 17 tests covering end-to-end workflows
- Test Categories: Authentication, User Management, Ride Operations, Emergency Protocols
cd unicarpool-frontend
# Run linting
npm run lint
# Type checking
npx tsc --noEmit- Getting Started - Complete setup instructions
- Configuration - Environment and application configuration
- Testing Guide - Testing strategies and best practices
- Design Principles - Architecture and design patterns
- Use Case Scenarios - Real-world usage examples
- TDD Documentation - Test-driven development practices
- API Documentation - Complete REST API reference
- Backend README - Backend-specific documentation
- Frontend README - Frontend-specific documentation
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Implement changes with tests
- Run tests and ensure they pass
- Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Backend: Follow Java naming conventions, use Lombok, write meaningful tests
- Frontend: Follow TypeScript best practices, use consistent component structure
- Documentation: Update relevant documentation for new features
- Testing: Maintain test coverage for new functionality
- All code must pass existing tests
- New features require corresponding tests
- Code review required for all pull requests
- Follow established design patterns and principles
Intellectual Property: Sanif Ali Momin
Version: 1.0.0
Last Updated: January 2025
Status: Active Development