How amitkumar945/major-project- works
This is a campus grievance-management API: users authenticate, submit complaints with optional evidence, and follow them through assignment, escalation, resolution, feedback, and reporting. The Flask application registers domain routes; complaint handling delegates lifecycle work to services, with AI-assisted categorization and prioritization, MongoDB persistence, audit, and notifications. Authentication, chatbot, device, and analytics capabilities are distinct branches. The source index supports several service relationships, but unsampled route and service implementations limit visibility into some runtime links.
Main entry points: database.py Database Access · app.py Flask Application · ai_service.py AI Analysis Service · complaint_service.py Complaint Lifecycle
Components 28
API Entry
- Flask Application
backend/app.py - Authentication Routes
backend/routes/auth_routes.py - Complaint Routes
backend/routes/complaint_routes.py - AI Routes
backend/routes/ai_routes.py - Chatbot Routes
backend/routes/chatbot_routes.py - Other API Routes
backend/routes
Grievance Workflows
- Account Service
backend/services/auth_service.py - Complaint Lifecycle
backend/services/complaint_service.py - Assignment Service
backend/services/assignment_service.py - Audit Service
backend/services/audit_service.py - Notifications
backend/services/notification_service.py - Email Delivery
backend/services/email_service.py - Chatbot Service
backend/services/chatbot_service.py
AI and Reporting
- AI Analysis Service
backend/services/ai_service.py - Text Processing
backend/ai/nlp_processor.py - Complaint Classifier
backend/ai/classifier.py - Priority Analysis
backend/ai/priority.py - Evidence OCR
backend/ai/ocr_processor.py - Duplicate Detection
backend/ai/duplicate_detection.py - Analytics Service
backend/services/analytics_service.py
Shared Services
- Database Access
backend/database.py - Runtime Configuration
backend/config.py - JWT Authorization
backend/utils/jwt_utils.py - Rate Limiting
backend/utils/rate_limit.py - Request Validation
backend/utils/validators.py - API Responses
backend/utils/responses.py
Other components
- API Client
- MongoDB
Connections 46
- API Client → Flask Application: sends requests
- Flask Application → Runtime Configuration: loads settings
backend/app.py - Flask Application → Database Access: initializes database
backend/app.py - Flask Application → Authentication Routes: registers routes
backend/app.py - Flask Application → Complaint Routes: registers routes
backend/app.py - Flask Application → AI Routes: registers routes
backend/app.py - Flask Application → Chatbot Routes: registers routes
backend/app.py - Flask Application → Other API Routes: registers routes
backend/app.py - Authentication Routes → Account Service: delegates account work
backend/routes/auth_routes.py - Authentication Routes → JWT Authorization: checks tokens
backend/routes/auth_routes.py - Authentication Routes → Request Validation: validates input
backend/routes/auth_routes.py - Authentication Routes → API Responses: formats responses
backend/routes/auth_routes.py - Complaint Routes → Request Validation: validates complaints
backend/routes/complaint_routes.py - Complaint Routes → Complaint Lifecycle: handles lifecycle
backend/routes/complaint_routes.py - Complaint Routes → AI Analysis Service: requests analysis
backend/routes/complaint_routes.py - Complaint Routes → Assignment Service: requests assignment
backend/routes/complaint_routes.py - AI Routes → Evidence OCR: processes evidence
backend/routes/ai_routes.py - AI Routes → Text Processing: processes text
backend/routes/ai_routes.py - AI Routes → AI Analysis Service: requests analysis
backend/routes/ai_routes.py - Chatbot Routes → Chatbot Service: delegates conversation
backend/routes/chatbot_routes.py - Chatbot Service → AI Analysis Service: uses analysis
backend/services/chatbot_service.py - Chatbot Service → Complaint Lifecycle: uses complaint workflows
backend/services/chatbot_service.py - Chatbot Service → Notifications: requests notifications
backend/services/chatbot_service.py - Complaint Lifecycle → AI Analysis Service: requests analysis
backend/services/complaint_service.py - Complaint Lifecycle → Assignment Service: delegates assignment
backend/services/complaint_service.py - Complaint Lifecycle → Audit Service: records actions
backend/services/complaint_service.py - Complaint Lifecycle → Notifications: requests notifications
backend/services/complaint_service.py - AI Analysis Service → Complaint Classifier: classifies complaints
backend/services/ai_service.py - AI Analysis Service → Duplicate Detection: checks duplicates
backend/services/ai_service.py - AI Analysis Service → Priority Analysis: scores priority
backend/services/ai_service.py - AI Analysis Service → Text Processing: processes text
backend/services/ai_service.py - Complaint Classifier → Text Processing: uses text features
backend/ai/classifier.py - Priority Analysis → Text Processing: uses text features
backend/ai/priority.py - Evidence OCR → Complaint Classifier: uses classification
backend/ai/ocr_processor.py - Evidence OCR → Priority Analysis: uses prioritization
backend/ai/ocr_processor.py - Evidence OCR → Text Processing: uses text processing
backend/ai/ocr_processor.py - Notifications → Email Delivery: sends email
backend/services/notification_service.py - Account Service → Database Access: reads and writes
backend/services/auth_service.py - Database Access → MongoDB: connects
backend/database.py - Database Access → Runtime Configuration: reads connection settings
backend/database.py - JWT Authorization → Database Access: loads user account
backend/utils/jwt_utils.py - Complaint Lifecycle → Database Access: reads and writes
backend/services/complaint_service.py - Assignment Service → Database Access: reads and writes
backend/services/assignment_service.py - Audit Service → Database Access: writes audit records
backend/services/audit_service.py - Notifications → Database Access: reads and writes
backend/services/notification_service.py - Analytics Service → Database Access: queries reporting data