How sohan1saha/hosteliq works
HostelIQ is a FastAPI hostel resource-monitoring and grievance-analytics application. Its main user-to-result paths are logging water/electricity usage and querying SQL analytics, or submitting and retrieving complaints backed by MongoDB (with an in-memory fallback). The graph also shows student/room registration, the dashboard, validation models, and database configuration. README capabilities include complaint timelines, maintenance assignments, and feedback; the shown implementation seeds and stores those document fields, but does not expose update workflows in the sampled routes.
Main entry points: main.py FastAPI application · sql_manager.py SQL operations · resources.py Resource endpoints · nosql_manager.py Complaint operations
Components 15
User interface
- FastAPI application
app/main.py - HTML dashboard
app/templates/index.html
API workflows
- Resource endpoints
app/routers/resources.py - Complaint endpoints
app/routers/complaints.py - Analytics endpoints
app/routers/analytics.py
Request models
- Student validation
app/models/student.py - Usage validation
app/models/resource.py - Complaint validation
app/models/complaint.py
Data and analytics
- Application settings
app/config.py - SQL operations
app/database/sql_manager.py - Relational schema
database_scripts/schema.sql - SQL database
- Complaint operations
app/database/nosql_manager.py - MongoDB complaints
Other components
- Hostel user
Connections 17
- Hostel user → FastAPI application: sends requests
README.md - FastAPI application → HTML dashboard: renders dashboard
app/main.py - FastAPI application → Resource endpoints: registers router
app/main.py - FastAPI application → Complaint endpoints: registers router
app/main.py - FastAPI application → Analytics endpoints: registers router
app/main.py - Resource endpoints → Student validation: validates payload
app/routers/resources.py - Resource endpoints → Usage validation: validates payload
app/routers/resources.py - Resource endpoints → SQL operations: writes records
app/routers/resources.py - Complaint endpoints → Complaint validation: validates payload
app/routers/complaints.py - Complaint endpoints → Complaint operations: creates and reads
app/routers/complaints.py - Analytics endpoints → SQL operations: runs SQL queries
app/routers/analytics.py - Analytics endpoints → Complaint operations: runs aggregation
app/routers/analytics.py - SQL operations → Application settings: loads settings
app/database/sql_manager.py - Complaint operations → Application settings: loads settings
app/database/nosql_manager.py - SQL operations → Relational schema: loads schema
app/database/sql_manager.py - SQL operations → SQL database: queries and writes
app/database/sql_manager.py - Complaint operations → MongoDB complaints: stores documents
app/database/nosql_manager.py