How malikhassaan513-jpg/fyp works
This is a FastAPI backend for an AI-assisted complaint and provider-booking service. The main customer journey is account access, Urdu complaint analysis and submission, location capture, provider matching and booking, OTP-verified completion, then rating. Admin, notification, and maintenance capabilities extend that journey. The excerpts and source index establish several router-to-service and service-to-service links; unsampled routes are retained as subsystems, but their internal calls are not inferred.
Main entry points: booking_service.py Booking Lifecycle · router.py API Router · main.py Application Entry · matching_service.py Provider Matching
Components 27
HTTP API
- API Router
Backend/app/api/v1/router.py - Authentication API
Backend/app/api/v1/auth.py - Complaints API
Backend/app/api/v1/complaints.py - Bookings API
Backend/app/api/v1/bookings.py - Providers API
Backend/app/api/v1/providers.py - Other APIs
Backend/app/api/v1
Identity and Core
- Application Entry
Backend/app/main.py - Authentication Service
Backend/app/services/auth_service.py - Token Security
Backend/app/core/security.py - Core Runtime
Backend/app/core - Relational Database
Backend/app/core/database.py - Account Models
Backend/app/models/user.py
Complaint Handling
- Complaint Service
Backend/app/services/complaint_service.py - Complaint Classification
Backend/app/services/ml_service.py - Model Preprocessing
Model Training/preprocess.py - Complaint Records
Backend/app/models/complaint.py
Provider Fulfillment
- Booking Lifecycle
Backend/app/services/booking_service.py - Provider Matching
Backend/app/services/matching_service.py - Provider Service
Backend/app/services/provider_service.py - Provider Records
Backend/app/models/provider.py - Service Requests
Backend/app/models/service_request.py - Completion OTP
Backend/app/services/otp_service.py - Ratings
Backend/app/services/rating_service.py
Operations
- Administration
Backend/app/services/admin_service.py - Notifications
Backend/app/services/notification_service.py - Maintenance
Backend/app/services/maintenance_service.py
Other components
- Customer
Connections 32
- Customer → API Router: uses API
- API Router → Authentication API: registers
Backend/app/api/v1/router.py - API Router → Complaints API: registers
Backend/app/api/v1/router.py - API Router → Bookings API: registers
Backend/app/api/v1/router.py - API Router → Providers API: registers
Backend/app/api/v1/router.py - API Router → Other APIs: registers
Backend/app/api/v1/router.py - Application Entry → API Router: mounts
Backend/app/main.py - Application Entry → Relational Database: initializes
Backend/app/main.py - Application Entry → Complaint Classification: loads model
Backend/app/main.py - Relational Database → Core Runtime: reads settings
Backend/app/core/database.py - Authentication API → Authentication Service: delegates
Backend/app/api/v1/auth.py - Authentication Service → Token Security: uses tokens
Backend/app/services/auth_service.py - Authentication Service → Account Models: reads and writes
Backend/app/services/auth_service.py - Complaints API → Complaint Service: delegates
- Complaint Service → Complaint Classification: classifies text
Backend/app/services/complaint_service.py - Complaint Classification → Model Preprocessing: reuses pipeline
- Complaint Service → Complaint Records: creates complaints
Backend/app/services/complaint_service.py - Bookings API → Booking Lifecycle: delegates
Backend/app/api/v1/bookings.py - Providers API → Provider Service: delegates
Backend/app/api/v1/providers.py - Providers API → Booking Lifecycle: delegates
Backend/app/api/v1/providers.py - Booking Lifecycle → Provider Matching: ranks providers
Backend/app/services/booking_service.py - Booking Lifecycle → Provider Service: uses provider logic
Backend/app/services/booking_service.py - Booking Lifecycle → Notifications: sends notices
Backend/app/services/booking_service.py - Booking Lifecycle → Completion OTP: uses OTP
Backend/app/services/booking_service.py - Booking Lifecycle → Core Runtime: validates transitions
Backend/app/services/booking_service.py - Provider Matching → Provider Records: filters providers
Backend/app/services/matching_service.py - Provider Matching → Service Requests: reads requests
Backend/app/services/matching_service.py - Completion OTP → Notifications: dispatches notices
Backend/app/services/otp_service.py - Completion OTP → Ratings: enables completion rating
- Administration → Booking Lifecycle: uses booking logic
Backend/app/services/admin_service.py - Administration → Provider Matching: uses matching
Backend/app/services/admin_service.py - Application Entry → Maintenance: starts maintenance
Backend/app/main.py