How majd-ba15/otw-backend works
OTW is a campus ride-sharing API. Riders and drivers authenticate, maintain profiles, publish or find rides, and book or fulfil trips; a separate demand path matches rider requests against driver availability. Trip completion supports ratings, while messaging, location updates, notifications, and administrative review support the ride lifecycle. Controller and service excerpts are partial, so several feature branches are represented by their exact paths and domain names; their internal call wiring is not asserted where source was not sampled.
Main entry points: AppDbContext.cs Application database · BookingsController.cs Bookings · UsersController.cs User profiles · DemandController.cs Demand matching
Components 25
Identity and profiles
- Authentication
Controllers/AuthController.cs - Auth service
Services/AuthService.cs - User profiles
Controllers/UsersController.cs - File storage
Services/FileService.cs
Ride lifecycle
- Ride discovery
Controllers/RidesController.cs - Bookings
Controllers/BookingsController.cs - Demand matching
Controllers/DemandController.cs - Location updates
Controllers/LocationController.cs
Trip engagement
- Messaging
Controllers/MessagesController.cs - Live chat
Hubs/ChatHub.cs - Ratings
Controllers/RatingsController.cs - Notifications
Services/NotificationService.cs - Notification API
Controllers/NotificationsController.cs - Email delivery
Services/EmailService.cs - AI assistance
Controllers/ChatAIController.cs - AI service
Services/AIService.cs
Operations and insights
- Reports
Controllers/ReportsController.cs - Administration
Controllers/AdminController.cs - Demand insights
Controllers/DemandController.cs - Ride reminders
Services/RideReminderService.cs
API and persistence
- Application database
Data/AppDbContext.cs
Other components
- Rider
- Driver
- Admin
- SMTP service
Connections 47
- Rider → Authentication: register or sign in
- Driver → Authentication: register or sign in
- Authentication → Auth service: delegates
- Auth service → Application database: reads and writes users
- Auth service → Email delivery: sends OTP or reset
- Rider → User profiles: manage profile
- Driver → User profiles: manage profile and car
- User profiles → Application database: reads and writes
- User profiles → File storage: saves uploads
- Rider → Ride discovery: find rides
- Driver → Ride discovery: publish and manage rides
- Ride discovery → Application database: reads and writes rides
- Rider → Bookings: request or manage booking
- Driver → Bookings: accept or decline
- Bookings → Application database: reads and writes bookings
- Bookings → Notifications: creates notifications
- Bookings → Email delivery: sends booking emails
- Rider → Demand matching: request a ride
- Driver → Demand matching: offer availability
- Admin → Demand matching: notify matching drivers
- Demand matching → Application database: reads and writes requests and availability
- Admin → Demand insights: view demand insights
- Demand insights → Application database: reads demand and supply
- Driver → Location updates: send location
- Rider → Location updates: view trip location
- Location updates → Application database: reads and writes location history
- Rider → Messaging: send trip message
- Driver → Messaging: send trip message
- Messaging → Application database: reads and writes messages
- Rider → Live chat: connect to live chat
- Driver → Live chat: connect to live chat
- Rider → Ratings: rate trip
- Driver → Ratings: rate trip
- Ratings → Application database: reads and writes ratings
- Rider → Notification API: view notifications
- Notification API → Application database: reads notifications
- Notifications → Application database: writes notifications
- AI assistance → AI service: requests assistance
- AI service → Application database: reads and writes chat logs
- Admin → Administration: manage platform
- Administration → Application database: reads and writes platform records
- Rider → Reports: submit report
- Driver → Reports: submit report
- Reports → Application database: reads and writes reports
- Ride reminders → Application database: queries upcoming rides
- Ride reminders → Email delivery: sends ride reminders
- Email delivery → SMTP service: sends email