# code-mkumar/project architecture

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

- Interactive diagram: https://gitdiagram.com/code-mkumar/project
- Repository: https://github.com/code-mkumar/project

## Overview

This is a Streamlit university portal with guest information and AI-assisted Q&A, plus login and role-specific student, staff, and administrator pages. The main flow is a visitor entering through the guest page or login, then—after role lookup and credential verification—being routed to the appropriate page. Guest Q&A retrieves text context before generating an answer; staff and admin pages manage academic records through database operations. MFA components and QR/OTP helpers are present. The README provides no feature overview, and several page implementations are unsampled, so those capabilities and links are shown only where supported by the tree or source index.

Main entry points: [`app.py`](https://github.com/code-mkumar/project/blob/main/app.py) (Page router), [`components/guest.py`](https://github.com/code-mkumar/project/blob/main/components/guest.py) (Guest Q&A), [`components/staff.py`](https://github.com/code-mkumar/project/blob/main/components/staff.py) (Staff portal), [`operation/dboperation.py`](https://github.com/code-mkumar/project/blob/main/operation/dboperation.py) (Database operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App and access"]
  node_app["Page router<br/>[app.py]"]
  node_login["Login<br/>[login.py]"]
  node_qr_setup["QR setup<br/>[qrsetupp.py]"]
  node_otp_verify["OTP verification<br/>[otpVerify.py]"]
end

subgraph group_guest["Guest information"]
  node_guest_page["Guest Q&amp;A<br/>[guest.py]"]
  node_document_corpus["College documents"]
end

subgraph group_academic["Academic operations"]
  node_student_page["Student portal<br/>[student.py]"]
  node_staff_page["Staff portal<br/>[staff.py]"]
  node_admin_page["Admin portal<br/>[admin.py]"]
end

subgraph group_services["Internal services"]
  node_db_ops["Database operations<br/>[dboperation.py]"]
  node_university_db[("University records<br/>[university.db]")]
  node_file_ops["File operations<br/>[fileoperations.py]"]
  node_preprocessing["Text retrieval<br/>[preprocessing.py]"]
  node_gemini["Gemini generation<br/>[gemini.py]"]
  node_portal_helpers["Guest content helpers<br/>[otheroperation.py]"]
  node_qr_helpers["QR and OTP helpers<br/>[qrsetter.py]"]
end

node_visitor(("Visitor or user"))
node_google_ai{{"Google Generative AI"}}

node_visitor -->|"uses"| node_app
node_app -->|"routes to"| node_guest_page
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_qr_setup
node_app -->|"routes to"| node_otp_verify
node_app -->|"routes to"| node_student_page
node_app -->|"routes to"| node_staff_page
node_app -->|"routes to"| node_admin_page
node_login -->|"checks credentials"| node_db_ops
node_otp_verify -->|"uses OTP"| node_qr_helpers
node_guest_page -->|"gets greeting and facts"| node_portal_helpers
node_guest_page -->|"stores feedback"| node_db_ops
node_guest_page -->|"reads prompt files"| node_file_ops
node_file_ops -.->|"reads documents"| node_document_corpus
node_guest_page -->|"ranks text chunks"| node_preprocessing
node_guest_page -->|"generates answer"| node_gemini
node_staff_page -->|"builds prompt"| node_preprocessing
node_staff_page -->|"requests response"| node_gemini
node_staff_page -->|"manages records"| node_db_ops
node_staff_page -.->|"uses file operations"| node_file_ops
node_staff_page -->|"verifies OTP"| node_qr_helpers
node_admin_page -->|"manages records"| node_db_ops
node_gemini -->|"generates content"| node_google_ai
node_db_ops -->|"reads and writes"| node_university_db

click node_app "https://github.com/code-mkumar/project/blob/main/app.py"
click node_guest_page "https://github.com/code-mkumar/project/blob/main/components/guest.py"
click node_login "https://github.com/code-mkumar/project/blob/main/components/login.py"
click node_qr_setup "https://github.com/code-mkumar/project/blob/main/components/qrsetupp.py"
click node_otp_verify "https://github.com/code-mkumar/project/blob/main/components/otpVerify.py"
click node_student_page "https://github.com/code-mkumar/project/blob/main/components/student.py"
click node_staff_page "https://github.com/code-mkumar/project/blob/main/components/staff.py"
click node_admin_page "https://github.com/code-mkumar/project/blob/main/components/admin.py"
click node_db_ops "https://github.com/code-mkumar/project/blob/main/operation/dboperation.py"
click node_university_db "https://github.com/code-mkumar/project/blob/main/dbs/university.db"
click node_file_ops "https://github.com/code-mkumar/project/blob/main/operation/fileoperations.py"
click node_document_corpus "https://github.com/code-mkumar/project/tree/main/files"
click node_preprocessing "https://github.com/code-mkumar/project/blob/main/operation/preprocessing.py"
click node_gemini "https://github.com/code-mkumar/project/blob/main/genai/gemini.py"
click node_portal_helpers "https://github.com/code-mkumar/project/blob/main/operation/otheroperation.py"
click node_qr_helpers "https://github.com/code-mkumar/project/blob/main/operation/qrsetter.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_app,node_login,node_qr_setup,node_otp_verify,node_visitor toneBlue
class node_guest_page,node_document_corpus toneAmber
class node_student_page,node_staff_page,node_admin_page toneMint
class node_db_ops,node_university_db,node_file_ops,node_preprocessing,node_gemini,node_portal_helpers,node_qr_helpers toneRose
class node_google_ai toneIndigo
```

## Components

### App and access

- [Page router](https://github.com/code-mkumar/project/blob/main/app.py): `app.py`
- [Login](https://github.com/code-mkumar/project/blob/main/components/login.py): `components/login.py`
- [QR setup](https://github.com/code-mkumar/project/blob/main/components/qrsetupp.py): `components/qrsetupp.py`
- [OTP verification](https://github.com/code-mkumar/project/blob/main/components/otpVerify.py): `components/otpVerify.py`

### Guest information

- [Guest Q&A](https://github.com/code-mkumar/project/blob/main/components/guest.py): `components/guest.py`
- [College documents](https://github.com/code-mkumar/project/tree/main/files): `files`

### Academic operations

- [Student portal](https://github.com/code-mkumar/project/blob/main/components/student.py): `components/student.py`
- [Staff portal](https://github.com/code-mkumar/project/blob/main/components/staff.py): `components/staff.py`
- [Admin portal](https://github.com/code-mkumar/project/blob/main/components/admin.py): `components/admin.py`

### Internal services

- [Database operations](https://github.com/code-mkumar/project/blob/main/operation/dboperation.py): `operation/dboperation.py`
- [University records](https://github.com/code-mkumar/project/blob/main/dbs/university.db): `dbs/university.db`
- [File operations](https://github.com/code-mkumar/project/blob/main/operation/fileoperations.py): `operation/fileoperations.py`
- [Text retrieval](https://github.com/code-mkumar/project/blob/main/operation/preprocessing.py): `operation/preprocessing.py`
- [Gemini generation](https://github.com/code-mkumar/project/blob/main/genai/gemini.py): `genai/gemini.py`
- [Guest content helpers](https://github.com/code-mkumar/project/blob/main/operation/otheroperation.py): `operation/otheroperation.py`
- [QR and OTP helpers](https://github.com/code-mkumar/project/blob/main/operation/qrsetter.py): `operation/qrsetter.py`

### Other components

- **Visitor or user**
- **Google Generative AI**

## Connections

- Visitor or user → Page router: uses (evidence: `app.py`)
- Page router → Guest Q&A: routes to (evidence: `app.py`)
- Page router → Login: routes to (evidence: `app.py`)
- Page router → QR setup: routes to (evidence: `app.py`)
- Page router → OTP verification: routes to (evidence: `app.py`)
- Page router → Student portal: routes to (evidence: `app.py`)
- Page router → Staff portal: routes to (evidence: `app.py`)
- Page router → Admin portal: routes to (evidence: `app.py`)
- Login → Database operations: checks credentials (evidence: `components/login.py`)
- OTP verification → QR and OTP helpers: uses OTP (evidence: `components/otpVerify.py`)
- Guest Q&A → Guest content helpers: gets greeting and facts (evidence: `components/guest.py`)
- Guest Q&A → Database operations: stores feedback (evidence: `components/guest.py`)
- Guest Q&A → File operations: reads prompt files (evidence: `components/guest.py`)
- File operations → College documents: reads documents
- Guest Q&A → Text retrieval: ranks text chunks (evidence: `components/guest.py`)
- Guest Q&A → Gemini generation: generates answer (evidence: `components/guest.py`)
- Staff portal → Text retrieval: builds prompt (evidence: `components/staff.py`)
- Staff portal → Gemini generation: requests response (evidence: `components/staff.py`)
- Staff portal → Database operations: manages records (evidence: `components/staff.py`)
- Staff portal → File operations: uses file operations (evidence: `components/staff.py`)
- Staff portal → QR and OTP helpers: verifies OTP (evidence: `components/staff.py`)
- Admin portal → Database operations: manages records (evidence: `components/admin.py`)
- Gemini generation → Google Generative AI: generates content (evidence: `genai/gemini.py`)
- Database operations → University records: reads and writes (evidence: `operation/dboperation.py`)
