EPL342 – University of Cyprus Team Project – Phase B Implementation
This project implements the backend database system and a simple web interface for OSRH (One-Stop Ride-Hail), a next-generation ride-hailing & logistics platform as defined in the official course specifications. All business logic, validation, routing logic, dynamic pricing, dispatch workflows, reports, and data transformations are implemented entirely inside Microsoft SQL Server 2022 (functions, stored procedures, triggers, views).
The backend (Flask) acts strictly as a thin API wrapper to expose SQL features to the frontend. No backend-side processing is done — only parameter extraction, validation, and forwarding to the appropriate stored procedure.
The frontend is implemented in React + TypeScript, providing the operator, inspector, driver, and passenger user flows.
A Python seeding pipeline generates synthetic data (thousands of users, drivers, vehicles, ride requests, legs, dispatch offers, rides, payments, documents) in accordance with project requirements.
-
Microsoft SQL Server 2022
-
Hosted locally through Podman on Fedora Linux
-
Heavy use of:
- Stored Procedures
- Functions
- Views
- Triggers
- Custom indexing
- Referential actions
-
Schema and logic follow the EPL342 project specification
-
Python 3 + Flask API
-
Backend job:
- Accept request body / query params
- Call corresponding SQL stored procedure
- Return results (JSON)
-
No business logic in Python.
-
React + TypeScript
-
Provides:
- Operator dashboard (analytics reports, documents & enrollments approvals, service & ride types addition)
- Inspector workflows (vehicle tests)
- Driver & Passenger flows (documents, availability, ride requests)
- Admin dashboard (approve new Operators)
-
Python seeder scripts:
- Generate thousands of entities
- Insert bulk data efficiently
- Ensure valid documents, vehicles, ride requests, dispatch flows
EPL342-Project/
├── data/
│ └── ... # Synthetic dataset inputs (zones, bridges, etc.)
├── sources/
│ ├── backend/
│ │ └── ... # Flask API source code
│ ├── frontend/
│ │ └── ... # React + TypeScript frontend
│ ├── point_seeder.py
│ ├── run_all_sql.py # Script that creates all sprocs, triggers etc.
│ └── seeder.py # Main DB data seeding script
├── sql/ # SQL scripts
│ ├── functions/
│ ├── indexes/
│ ├── reports/
│ ├── sproc/
│ ├── triggers/
│ └── views/
│ │
│ ├── availability_change.sql
│ ├── create_test_rides_offers.sql
│ ├── DB_definition.sql # Full schema
│ ├── deploy_role_based_restrictions.sql
│ ├── driver_photo.sql
│ ├── gdpr_alter.sql
│ ├── vehicle_image_types_migration.sql
│ ├── vehicle_pricing_migration.sql
│ └── with_check_no_check.sql
│
├── .env
├── .gitignore
├── README.md
├── Referential_Actions.md
└── requirements.txtThe backend is intentionally minimal. Responsibilities:
Example flow:
HTTP Request → Flask → Call sproc → ResultSet → JSON → Frontend
-
DB Definition (tables, PK/FK, constraints)
-
Stored Procedures
- User signup/login
- Document submission & review
- Vehicle registration and compliance
- Route generation with intermediate legs
- Dispatch offer creation
- Ride acceptance workflow
- Payments, ratings, messaging
- Full reporting module
-
Triggers
- GDPR right-to-be-forgotten logging
- Document state changes
-
Functions
- Price calculation
- Distance / geofence checking
-
Views
- Reporting views and sprocs
We implemented indexing based on expected bottlenecks, query frequency, and join patterns. Indexes were added only after query-plan analysis to meet the <1s execution rule for 10k rows.
Simple interface offering:
- Document review (driver & vehicle)
- User enrollment management
- GDPR requests
- Reporting dashboards
- Document upload
- Vehicle management
- Availability scheduling
- Ride acceptance
- Ride request creation
- Multi-segment route selection
- Payment & rating
- Vehicle technical tests
- Validate new Operator accounts
The seeder.py file generates:
- Thousands of users (Operators, Inspectors, Drivers, Company Reps, Passengers)
- Vehicles (with photos, documents, compliance)
- Driver documents
- Availability slots
- Ride Requests
- Itinerary Legs
- Dispatch Offers (ensuring at least one per leg)
- Rides
- Payments
- Ratings
- Messaging examples
Helpers:
point_seeder.py→ zone/bridge seedingrun_all_sql.py→ sequential DB deployment
podman run -e "ACCEPT_EULA=Y" \
-e "SA_PASSWORD=Password123!" \
-p 1433:1433 \
--name mssql \
-d mcr.microsoft.com/mssql/server:2022-latestpip install -r requirements.txtpython sources/run_all_sql.pypython sources/point_seeder.py
python sources/seeder.pypython sources/backend/app.pycd sources/frontend
npm install
npm run devThis implementation follows the full specifications of the official EPL342 Database Systems course assignment. Project structure complies with required deliverables: sources/, sql/, data/, doc/.