How subiksha1705/kec-hostel works
This is a multi-role college and hostel management portal: administrators and members maintain student records, while students and members use dashboards and request workflows; guests can view public college information. The sampled student-management flow runs from a role-specific page through the shared API client to a route that checks session, permissions and scope before accessing Prisma. The tree also shows announcements, complaints, leave management, roles, hostel information and chatbot capabilities. Several of those paths were not sampled, so their internal wiring is not asserted.
Main entry points: route.ts Student records API · prisma.ts Prisma access · complaints Complaints · leaves Leave management
Components 25
Portal experience
- Admin portal
app/admin - Member portal
app/member - Student portal
app/student - Guest views
app/guest - Student management
app/admin/students/page.tsx - Member student view
app/member/students/page.tsx
Domain services
- Announcements
app/api/announcements - Complaints
app/api/complaints - Leave management
app/api/leaves - Chatbot
app/api/chatbot - Knowledge processing
lib/chatbot - Student records API
app/api/students/route.ts
Shared runtime
- API client
lib/api/client.ts - API responses
lib/api/response.ts - Cached fetching
lib/cache/useCachedFetch.ts - Client cache
lib/cache/store.ts
Identity and data
- Session verification
lib/auth/session.ts - JWT verification
lib/auth/jwt.ts - Role permissions
lib/rbac.ts - Record scoping
lib/scope.ts - Phone validation
lib/validation/phone.ts - Prisma access
lib/prisma.ts - Token refresh route
app/api/auth/refresh/route.ts
Other components
- Portal user
- Application database
Connections 37
- Portal user → Admin portal: uses
- Portal user → Member portal: uses
- Portal user → Student portal: uses
- Portal user → Guest views: visits
- Admin portal → Student management: opens
- Member portal → Member student view: opens
- Student management → API client: calls
app/admin/students/page.tsx - Member student view → API client: calls
app/member/students/page.tsx - Student management → Student records API: requests
app/admin/students/page.tsx - Member student view → Student records API: requests
app/member/students/page.tsx - API client → Token refresh route: refreshes token
lib/api/client.ts - Cached fetching → API client: fetches through
lib/cache/useCachedFetch.ts - Cached fetching → Client cache: reads and writes
lib/cache/useCachedFetch.ts - Student records API → Session verification: verifies session
app/api/students/route.ts - Student records API → Role permissions: checks permissions
app/api/students/route.ts - Student records API → Record scoping: scopes records
app/api/students/route.ts - Student records API → Phone validation: validates numbers
app/api/students/route.ts - Student records API → Prisma access: queries records
app/api/students/route.ts - Student records API → API responses: formats result
app/api/students/route.ts - Session verification → JWT verification: verifies token
lib/auth/session.ts - Role permissions → Prisma access: loads permissions
lib/rbac.ts - Prisma access → Application database: accesses
- Announcements → Session verification: checks session
app/api/announcements/route.ts - Announcements → Role permissions: checks permissions
app/api/announcements/route.ts - Announcements → Prisma access: queries records
app/api/announcements/route.ts - Announcements → API responses: formats result
app/api/announcements/route.ts - Complaints → Session verification: checks session
app/api/complaints/route.ts - Complaints → Role permissions: checks permissions
app/api/complaints/route.ts - Complaints → Record scoping: scopes records
app/api/complaints/route.ts - Complaints → Prisma access: queries records
app/api/complaints/route.ts - Complaints → API responses: formats result
app/api/complaints/route.ts - Leave management → Session verification: checks session
app/api/leaves/route.ts - Leave management → Role permissions: checks permissions
app/api/leaves/route.ts - Leave management → Record scoping: scopes records
app/api/leaves/route.ts - Leave management → Prisma access: queries records
app/api/leaves/route.ts - Leave management → API responses: formats result
app/api/leaves/route.ts - Chatbot → Knowledge processing: uses knowledge tools