How afaqcreate/-smart_query_routing_and_email_automation_system works
Query UNI is a university inquiry and workflow platform: students authenticate, submit and track queries or leave applications, while department staff, HODs, and admins handle routing, resolution, approvals, and broadcasts. The FastAPI application mounts the feature routers; query handling uses service logic and shared PostgreSQL-backed models. The README describes role dashboards and capabilities beyond the sampled implementation. Dashed links mark documented or plausible integration points where the excerpts do not show the runtime call.
Main entry points: main.py FastAPI Gateway · query.py Query and Messages API · automation.py AI Query Automation · leave.py Leave Workflow API
Components 30
Role Portals
- Google Login
Final year project/Frontend/AllScreens/01_Login/01_login.js - Student Portal
Final year project/Frontend/AllScreens/02_Student/02_student.js - HOD Portal
Final year project/Frontend/AllScreens/04_HOD/04_hod.js - Department Portal
Final year project/Frontend/AllScreens/05_Department/05_department.js - Admin Portal
Final year project/Frontend/AllScreens/06_Admin/06_admin.js
API Workflows
- FastAPI Gateway
Final year project/Backend/app/main.py - OAuth Authentication
Final year project/Backend/app/api/routes/auth.py - Query and Messages API
Final year project/Backend/app/api/routes/query.py - AI Query Automation
Final year project/Backend/app/api/routes/automation.py - Leave Workflow API
Final year project/Backend/app/api/routes/leave.py - Announcements API
Final year project/Backend/app/api/routes/announcement.py - Escalation API
Final year project/Backend/app/api/routes/escalation.py - Administration API
Final year project/Backend/app/api/routes/admin.py
Domain Services
- Query Lifecycle
Final year project/Backend/app/services/query.py - Department Routing
Final year project/Backend/app/services/AiQueryRoute.py - Leave Auto Replies
Final year project/Backend/app/services/leave_ai.py - Admin Management
Final year project/Backend/app/services/admin.py - User Management
Final year project/Backend/app/services/user.py - Route Management
Final year project/Backend/app/services/route.py - Escalation Handling
Final year project/Backend/app/services/escalation.py
Persistence and AI
- Domain Models
Final year project/Backend/app/models/table.py - Request and Response Schemas
Final year project/Backend/app/schemas/subschemas.py - Database Sessions
Final year project/Backend/app/database/connection.py
Other components
- Student
- Department Officer
- HOD
- System Admin
- PostgreSQL Database
- Gemini AI
- Google OAuth
Connections 32
- Student → Google Login: signs in
README.md - Student → Student Portal: submits and tracks
README.md - Department Officer → Department Portal: resolves tickets
README.md - HOD → HOD Portal: reviews leave
README.md - System Admin → Admin Portal: manages campus
README.md - Google Login → OAuth Authentication: starts login
- OAuth Authentication → Google OAuth: exchanges credentials
Final year project/Backend/app/api/routes/auth.py - FastAPI Gateway → OAuth Authentication: mounts router
Final year project/Backend/app/main.py - FastAPI Gateway → Query and Messages API: mounts router
Final year project/Backend/app/main.py - FastAPI Gateway → AI Query Automation: mounts router
Final year project/Backend/app/main.py - FastAPI Gateway → Leave Workflow API: mounts router
Final year project/Backend/app/main.py - FastAPI Gateway → Announcements API: mounts router
Final year project/Backend/app/main.py - FastAPI Gateway → Escalation API: mounts router
Final year project/Backend/app/main.py - FastAPI Gateway → Administration API: mounts router
Final year project/Backend/app/main.py - Query and Messages API → Query Lifecycle: calls lifecycle
Final year project/Backend/app/api/routes/query.py - AI Query Automation → Department Routing: routes query
Final year project/Backend/app/api/routes/automation.py - Query Lifecycle → Leave Auto Replies: generates reply
Final year project/Backend/app/services/query.py - Department Routing → Leave Auto Replies: generates reply
Final year project/Backend/app/services/AiQueryRoute.py - AI Query Automation → Gemini AI: classifies and drafts
Final year project/Backend/app/api/routes/automation.py - Leave Workflow API → Gemini AI: generates drafts
- Administration API → Admin Management: delegates management
Final year project/Backend/app/api/routes/admin.py - Administration API → User Management: delegates users
- FastAPI Gateway → Route Management: mounts route API
Final year project/Backend/app/main.py - FastAPI Gateway → User Management: mounts user API
Final year project/Backend/app/main.py - FastAPI Gateway → Escalation Handling: mounts escalation API
Final year project/Backend/app/main.py - Query Lifecycle → Domain Models: reads and writes
Final year project/Backend/app/services/query.py - Department Routing → Domain Models: creates tickets
Final year project/Backend/app/services/AiQueryRoute.py - Query and Messages API → Request and Response Schemas: validates payloads
Final year project/Backend/app/api/routes/query.py - FastAPI Gateway → Database Sessions: initializes tables
Final year project/Backend/app/main.py - Database Sessions → PostgreSQL Database: connects
Final year project/Backend/app/database/connection.py - Announcements API → PostgreSQL Database: persists broadcasts
- Leave Workflow API → PostgreSQL Database: persists leave status