How skveer1902/student-information-chatbot works
This is a role-aware university information chatbot: users log in, ask questions in the React chat, and receive information retrieved through role-specific API endpoints. The backend asks OpenAI to select an endpoint, calls that endpoint, and formats its response. The routers query MySQL through SQLAlchemy. The README also describes natural-language-to-SQL capability, but the sampled chat path uses endpoint dispatch instead; its implementation is not connected by the available evidence. Frontend component imports beyond App.js were not shown, so some UI relationships are omitted.
Main entry points: main.py FastAPI entry · database.py SQLAlchemy access · App.js Chat application · student.py Student endpoints
Components 16
Web interface
- Chat application
chatbot-env/frontend/src/App.js - Role login
chatbot-env/frontend/src/component/Auth/LoginPage.js - Chat views
chatbot-env/frontend/src/component/Chat - Profile and help panels
chatbot-env/frontend/src/component/Panels
API and conversation
- FastAPI entry
chatbot-env/backend/app/main.py - Session and login
chatbot-env/backend/app/main.py - GPT endpoint dispatch
chatbot-env/backend/app/main.py
Role information
- Student endpoints
chatbot-env/backend/app/routers/student.py - Faculty endpoints
chatbot-env/backend/app/routers/faculty.py - Admin endpoints
chatbot-env/backend/app/routers/admin.py - NL-to-SQL logic
chatbot-env/backend/app/nl_to_sql.py
Persistence
- SQLAlchemy access
chatbot-env/backend/app/database.py - Information schema
chatbot-env/backend/app/models.py
Other components
- Student or staff
- OpenAI service
- MySQL database
Connections 25
- Student or staff → Role login: submits credentials
chatbot-env/frontend/src/component/Auth/LoginPage.js - Role login → FastAPI entry: posts login
chatbot-env/frontend/src/component/Auth/LoginPage.js - Chat application → Role login: renders
chatbot-env/frontend/src/App.js - Chat application → Chat views: renders
chatbot-env/frontend/src/App.js - Chat application → Profile and help panels: renders
chatbot-env/frontend/src/App.js - Student or staff → Chat views: asks question
- Chat application → FastAPI entry: posts chat
chatbot-env/frontend/src/App.js - FastAPI entry → Session and login: handles login
chatbot-env/backend/app/main.py - FastAPI entry → GPT endpoint dispatch: handles chat
chatbot-env/backend/app/main.py - GPT endpoint dispatch → OpenAI service: requests endpoint
chatbot-env/backend/app/main.py - GPT endpoint dispatch → Student endpoints: calls selected route
chatbot-env/backend/app/main.py - GPT endpoint dispatch → Faculty endpoints: calls selected route
chatbot-env/backend/app/main.py - GPT endpoint dispatch → Admin endpoints: calls selected route
chatbot-env/backend/app/main.py - FastAPI entry → Student endpoints: registers router
chatbot-env/backend/app/main.py - FastAPI entry → Faculty endpoints: registers router
chatbot-env/backend/app/main.py - FastAPI entry → Admin endpoints: registers router
chatbot-env/backend/app/main.py - Session and login → SQLAlchemy access: queries credentials
chatbot-env/backend/app/main.py - Student endpoints → SQLAlchemy access: gets sessions
chatbot-env/backend/app/routers/student.py - Faculty endpoints → SQLAlchemy access: gets sessions
chatbot-env/backend/app/routers/faculty.py - Admin endpoints → SQLAlchemy access: gets sessions
chatbot-env/backend/app/routers/admin.py - SQLAlchemy access → MySQL database: connects
chatbot-env/backend/app/database.py - Student endpoints → Information schema: queries models
chatbot-env/backend/app/routers/student.py - Faculty endpoints → Information schema: queries models
chatbot-env/backend/app/routers/faculty.py - Admin endpoints → Information schema: queries models
chatbot-env/backend/app/routers/admin.py - Information schema → MySQL database: maps tables