# sheethaljoshi/late_night_check architecture

> Architecture diagram of the GitHub repository sheethaljoshi/late_night_check, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sheethaljoshi/late_night_check
- Repository: https://github.com/sheethaljoshi/late_night_check

## Overview

LateCheck is a hostel late-entry and warden-management application. Students scan a QR code, submit late-entry information, and can communicate with wardens and receive notices; wardens review requests and student records and view analytics. The tree contains a large Python file alongside a Next.js frontend, while the README describes a FastAPI backend and additional AI, notification, and location capabilities. Backend internals and several UI modules were not excerpted, so those documented relationships are shown at a high level rather than as verified implementation calls.

Main entry points: [`connect2.py`](https://github.com/sheethaljoshi/late_night_check/blob/main/connect2.py) (Backend API), [`sampleone/src/app/dashboard/student-messages/page.tsx`](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-messages/page.tsx) (Student messages), [`sampleone/src/app/chat/page.tsx`](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/chat/page.tsx) (Student chat), [`sampleone/src/app/notify/page.tsx`](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notify/page.tsx) (Student notices)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student experience"]
  node_qrpage["QR scanner page<br/>[page.tsx]"]
  node_qrreader["QR reader<br/>[Qrreader.tsx]"]
  node_requestform["Late entry form<br/>[page.tsx]"]
  node_home["Student home<br/>[page.tsx]"]
  node_studentchat["Student chat<br/>[page.tsx]"]
  node_studentmessages["Student messages<br/>[page.tsx]"]
  node_inbox["Message inbox<br/>[Inbox.tsx]"]
  node_chatcomponent["Chat component<br/>[Chat.tsx]"]
  node_notifications["Student notices<br/>[page.tsx]"]
  node_profile["Student profile<br/>[page.tsx]"]
  node_chatpagecomponent["Chat route page<br/>[page.tsx]"]
end

subgraph group_warden["Warden operations"]
  node_analytics["Analytics dashboard<br/>[page.tsx]"]
  node_requestreview["Request review<br/>[Request.tsx]"]
  node_requestpage["Request page<br/>[page.tsx]"]
  node_studentdetail["Student details<br/>[Detail.tsx]"]
  node_detailpage["Student detail page<br/>[page.tsx]"]
  node_wardenmessages["Warden messages<br/>[page.tsx]"]
  node_notificationcenter["Notification center"]
  node_notificationpage["Warden notices page<br/>[page.tsx]"]
  node_lateentrytable["Late entry table<br/>[LateEntryTable.tsx]"]
  node_pendingtable["Pending table<br/>[PendingTable.tsx]"]
  node_studentrequesttable["Request table"]
  node_studentdetailtable["Detail table"]
  node_tableentry["Table entry view<br/>[TableEntry.tsx]"]
  node_sidebar["Warden sidebar<br/>[sidebar.tsx]"]
end

subgraph group_shared["Shared UI and location"]
  node_menu["Student navigation<br/>[menubutton.tsx]"]
  node_hostelinfo["Hostel information<br/>[Abouthostel.tsx]"]
  node_locations["Hostel locations<br/>[Locations.tsx]"]
  node_timer["Gate timer<br/>[timer.jsx]"]
  node_chatbubble["Chat bubble<br/>[Chatbubble.tsx]"]
  node_timeformat["Time formatting<br/>[formattime.ts]"]
end

subgraph group_backend["Backend and intelligence"]
  node_api["Backend API<br/>[connect2.py]"]
end

node_student(("Student"))
node_warden(("Warden"))

node_student -->|"opens scanner"| node_qrpage
node_qrpage -->|"renders"| node_qrreader
node_student -.->|"submits request"| node_requestform
node_requestform -->|"posts entry history"| node_api
node_student -.->|"opens chat"| node_studentchat
node_studentchat -->|"fetches and sends messages"| node_api
node_studentchat -->|"renders"| node_chatbubble
node_student -.->|"opens inbox"| node_studentmessages
node_studentmessages -->|"loads inbox and websocket"| node_api
node_studentmessages -->|"renders"| node_inbox
node_studentmessages -->|"renders"| node_chatcomponent
node_chatcomponent -->|"uses"| node_chatbubble
node_student -.->|"views notices"| node_notifications
node_notifications -->|"polls notices"| node_api
node_notifications -->|"formats dates"| node_timeformat
node_home -->|"renders"| node_hostelinfo
node_home -->|"renders"| node_timer
node_hostelinfo -->|"renders map"| node_locations
node_warden -.->|"views insights"| node_analytics
node_warden -.->|"reviews requests"| node_requestpage
node_requestpage -->|"renders"| node_requestreview
node_requestreview -.->|"manages requests"| node_api
node_warden -.->|"views student records"| node_detailpage
node_detailpage -->|"renders"| node_studentdetail
node_warden -.->|"views notifications"| node_notificationpage
node_notificationpage -->|"renders"| node_notificationcenter
node_warden -.->|"communicates"| node_wardenmessages
node_notificationcenter -.->|"handles notifications"| node_api
node_api -.->|"supports behavior analysis"| node_analytics
node_student -->|"views account"| node_profile
node_requestreview -.->|"uses"| node_pendingtable
node_pendingtable -->|"uses"| node_tableentry
node_lateentrytable -->|"uses"| node_tableentry
node_studentdetail -.->|"uses"| node_studentdetailtable
node_studentdetail -.->|"uses"| node_studentrequesttable
node_studentmessages -.->|"uses navigation"| node_sidebar
node_student -.->|"navigates"| node_menu
node_studentchat -->|"renders navigation"| node_menu

click node_qrpage "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/qrscanner/page.tsx"
click node_qrreader "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Qrreader.tsx"
click node_requestform "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/late-entry-form/page.tsx"
click node_home "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/home/page.tsx"
click node_studentchat "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/chat/page.tsx"
click node_studentmessages "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-messages/page.tsx"
click node_inbox "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Inbox.tsx"
click node_chatcomponent "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Chat.tsx"
click node_notifications "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notify/page.tsx"
click node_profile "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/profile/page.tsx"
click node_analytics "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/analytics/page.tsx"
click node_requestreview "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-request/Request.tsx"
click node_requestpage "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-request/page.tsx"
click node_studentdetail "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/studentdetail/Detail.tsx"
click node_detailpage "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/studentdetail/page.tsx"
click node_wardenmessages "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-messages/page.tsx"
click node_notificationcenter "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notifications/NotificationCentre.tsx"
click node_notificationpage "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notifications/page.tsx"
click node_lateentrytable "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/LateEntryTable.tsx"
click node_pendingtable "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/PendingTable.tsx"
click node_studentrequesttable "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Tablecomponent/StudentRequestTable.tsx"
click node_studentdetailtable "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Tablecomponent/StudentDetailTable.tsx"
click node_tableentry "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Tablecomponent/TableEntry.tsx"
click node_sidebar "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/sidebar.tsx"
click node_menu "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/menubutton.tsx"
click node_hostelinfo "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/Abouthostel.tsx"
click node_locations "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/Locations.tsx"
click node_timer "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/timer.jsx"
click node_chatbubble "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/Chatbubble.tsx"
click node_timeformat "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/utils/formattime.ts"
click node_chatpagecomponent "https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/chat/page.tsx"
click node_api "https://github.com/sheethaljoshi/late_night_check/blob/main/connect2.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_qrpage,node_qrreader,node_requestform,node_home,node_studentchat,node_studentmessages,node_inbox,node_chatcomponent,node_notifications,node_profile,node_chatpagecomponent toneBlue
class node_analytics,node_requestreview,node_requestpage,node_studentdetail,node_detailpage,node_wardenmessages,node_notificationcenter,node_notificationpage,node_lateentrytable,node_pendingtable,node_studentrequesttable,node_studentdetailtable,node_tableentry,node_sidebar toneAmber
class node_menu,node_hostelinfo,node_locations,node_timer,node_chatbubble,node_timeformat toneMint
class node_api toneRose
class node_student,node_warden toneIndigo
```

## Components

### Student experience

- [QR scanner page](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/qrscanner/page.tsx): `sampleone/src/app/qrscanner/page.tsx`
- [QR reader](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Qrreader.tsx): `sampleone/src/app/components/Qrreader.tsx`
- [Late entry form](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/late-entry-form/page.tsx): `sampleone/src/app/late-entry-form/page.tsx`
- [Student home](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/home/page.tsx): `sampleone/src/app/home/page.tsx`
- [Student chat](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/chat/page.tsx): `sampleone/src/app/chat/page.tsx`
- [Student messages](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-messages/page.tsx): `sampleone/src/app/dashboard/student-messages/page.tsx`
- [Message inbox](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Inbox.tsx): `sampleone/src/app/components/Inbox.tsx`
- [Chat component](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Chat.tsx): `sampleone/src/app/components/Chat.tsx`
- [Student notices](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notify/page.tsx): `sampleone/src/app/notify/page.tsx`
- [Student profile](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/profile/page.tsx): `sampleone/src/app/profile/page.tsx`
- [Chat route page](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/chat/page.tsx): `sampleone/src/app/chat/page.tsx`

### Warden operations

- [Analytics dashboard](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/analytics/page.tsx): `sampleone/src/app/dashboard/analytics/page.tsx`
- [Request review](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-request/Request.tsx): `sampleone/src/app/dashboard/student-request/Request.tsx`
- [Request page](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-request/page.tsx): `sampleone/src/app/dashboard/student-request/page.tsx`
- [Student details](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/studentdetail/Detail.tsx): `sampleone/src/app/studentdetail/Detail.tsx`
- [Student detail page](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/studentdetail/page.tsx): `sampleone/src/app/studentdetail/page.tsx`
- [Warden messages](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/dashboard/student-messages/page.tsx): `sampleone/src/app/dashboard/student-messages/page.tsx`
- [Notification center](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notifications/NotificationCentre.tsx): `sampleone/src/app/notifications/NotificationCentre.tsx`
- [Warden notices page](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/notifications/page.tsx): `sampleone/src/app/notifications/page.tsx`
- [Late entry table](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/LateEntryTable.tsx): `sampleone/src/app/components/LateEntryTable.tsx`
- [Pending table](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/PendingTable.tsx): `sampleone/src/app/components/PendingTable.tsx`
- [Request table](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Tablecomponent/StudentRequestTable.tsx): `sampleone/src/app/components/Tablecomponent/StudentRequestTable.tsx`
- [Detail table](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Tablecomponent/StudentDetailTable.tsx): `sampleone/src/app/components/Tablecomponent/StudentDetailTable.tsx`
- [Table entry view](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/Tablecomponent/TableEntry.tsx): `sampleone/src/app/components/Tablecomponent/TableEntry.tsx`
- [Warden sidebar](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/sidebar.tsx): `sampleone/src/app/components/sidebar.tsx`

### Shared UI and location

- [Student navigation](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/menubutton.tsx): `sampleone/src/app/components/user/menubutton.tsx`
- [Hostel information](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/Abouthostel.tsx): `sampleone/src/app/components/user/Abouthostel.tsx`
- [Hostel locations](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/Locations.tsx): `sampleone/src/app/components/user/Locations.tsx`
- [Gate timer](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/timer.jsx): `sampleone/src/app/components/user/timer.jsx`
- [Chat bubble](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/app/components/user/Chatbubble.tsx): `sampleone/src/app/components/user/Chatbubble.tsx`
- [Time formatting](https://github.com/sheethaljoshi/late_night_check/blob/main/sampleone/src/utils/formattime.ts): `sampleone/src/utils/formattime.ts`

### Backend and intelligence

- [Backend API](https://github.com/sheethaljoshi/late_night_check/blob/main/connect2.py): `connect2.py`

### Other components

- **Student**
- **Warden**

## Connections

- Student → QR scanner page: opens scanner (evidence: `sampleone/src/app/qrscanner/page.tsx`)
- QR scanner page → QR reader: renders (evidence: `sampleone/src/app/qrscanner/page.tsx`)
- Student → Late entry form: submits request
- Late entry form → Backend API: posts entry history (evidence: `sampleone/src/app/late-entry-form/page.tsx`)
- Student → Student chat: opens chat
- Student chat → Backend API: fetches and sends messages (evidence: `sampleone/src/app/chat/page.tsx`)
- Student chat → Chat bubble: renders (evidence: `sampleone/src/app/chat/page.tsx`)
- Student → Student messages: opens inbox
- Student messages → Backend API: loads inbox and websocket (evidence: `sampleone/src/app/dashboard/student-messages/page.tsx`)
- Student messages → Message inbox: renders (evidence: `sampleone/src/app/dashboard/student-messages/page.tsx`)
- Student messages → Chat component: renders (evidence: `sampleone/src/app/dashboard/student-messages/page.tsx`)
- Chat component → Chat bubble: uses (evidence: `sampleone/src/app/components/Chat.tsx`)
- Student → Student notices: views notices
- Student notices → Backend API: polls notices (evidence: `sampleone/src/app/notify/page.tsx`)
- Student notices → Time formatting: formats dates (evidence: `sampleone/src/app/notify/page.tsx`)
- Student home → Hostel information: renders (evidence: `sampleone/src/app/home/page.tsx`)
- Student home → Gate timer: renders (evidence: `sampleone/src/app/home/page.tsx`)
- Hostel information → Hostel locations: renders map (evidence: `sampleone/src/app/components/user/Abouthostel.tsx`)
- Warden → Analytics dashboard: views insights
- Warden → Request page: reviews requests
- Request page → Request review: renders (evidence: `sampleone/src/app/dashboard/student-request/page.tsx`)
- Request review → Backend API: manages requests
- Warden → Student detail page: views student records
- Student detail page → Student details: renders (evidence: `sampleone/src/app/studentdetail/page.tsx`)
- Warden → Warden notices page: views notifications
- Warden notices page → Notification center: renders (evidence: `sampleone/src/app/notifications/page.tsx`)
- Warden → Warden messages: communicates
- Notification center → Backend API: handles notifications
- Backend API → Analytics dashboard: supports behavior analysis
- Student → Student profile: views account (evidence: `sampleone/src/app/profile/page.tsx`)
- Request review → Pending table: uses
- Pending table → Table entry view: uses (evidence: `sampleone/src/app/components/PendingTable.tsx`)
- Late entry table → Table entry view: uses (evidence: `sampleone/src/app/components/LateEntryTable.tsx`)
- Student details → Detail table: uses
- Student details → Request table: uses
- Student messages → Warden sidebar: uses navigation
- Student → Student navigation: navigates
- Student chat → Student navigation: renders navigation (evidence: `sampleone/src/app/chat/page.tsx`)
