# teja-13/e2e architecture

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

- Interactive diagram: https://gitdiagram.com/teja-13/e2e
- Repository: https://github.com/teja-13/e2e

## Overview

Smart Library Management System is a role-based web app for students, librarians, and administrators. Users enter through the routed React client, then use role-specific journeys: students search and request books, librarians manage circulation and reservations, and admins oversee accounts and analytics. Signup requests and approvals connect onboarding to account administration. The Express API owns these workflows and persists library records in MongoDB; the Axios client attaches JWTs to API requests. README capability claims include overdue detection, fine calculation, and daily notifications, but excerpts do not expose their exact runtime wiring.

Main entry points: [`frontend/src/App.tsx`](https://github.com/teja-13/e2e/blob/main/frontend/src/App.tsx) (Role routing), [`frontend/src/services/api.ts`](https://github.com/teja-13/e2e/blob/main/frontend/src/services/api.ts) (API client), [`backend/mockAuthServer.js`](https://github.com/teja-13/e2e/blob/main/backend/mockAuthServer.js) (Express API), [`frontend/src/pages/admin/AdminAnalytics.tsx`](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/AdminAnalytics.tsx) (Analytics dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Role routing<br/>[App.tsx]"]
  node_student["Student portal<br/>[StudentLayout.tsx]"]
  node_student_settings["Student settings<br/>[Settings.tsx]"]
  node_librarian["Librarian portal"]
  node_admin["Admin portal<br/>[AdminLayout.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_ops["Library operations"]
  node_student_search["Book search<br/>[BookSearch.tsx]"]
  node_student_books["My books<br/>[MyBooks.tsx]"]
  node_circulation["Borrow and return<br/>[Borrowed.tsx]"]
  node_reservations["Reservations<br/>[Reservations.tsx]"]
  node_catalog_admin["Catalog management<br/>[ManageBooks.tsx]"]
  node_admin_catalog["Admin catalog<br/>[ManageBooks.tsx]"]
end

subgraph group_identity["Access administration"]
  node_student_admin["Student management<br/>[ManageStudents.tsx]"]
  node_user_admin["User approvals<br/>[ManageUsers.tsx]"]
  node_signup["Signup requests"]
  node_librarian_signup["Librarian signup"]
end

subgraph group_records["Library records"]
  node_api_server["Express API<br/>[mockAuthServer.js]"]
  node_book_search_api["Book catalog API<br/>[mockAuthServer.js]"]
  node_borrow_store[("Borrow records<br/>[Borrow.js]")]
  node_book_store[("Book records<br/>[Book.js]")]
  node_student_store[("Student records<br/>[Student.js]")]
  node_registration_store[("Signup records<br/>[Registration.js]")]
  node_reservation_store[("Reservation records<br/>[Reservation.js]")]
  node_notification_store[("Notifications<br/>[Notification.js]")]
  node_user_store[("Staff accounts<br/>[User.js]")]
end

subgraph group_insights["Analytics"]
  node_analytics["Analytics dashboard<br/>[AdminAnalytics.tsx]"]
end

node_people(("Library users"))

node_people -->|"use"| node_app
node_app -->|"routes"| node_student
node_app -->|"routes"| node_librarian
node_app -->|"routes"| node_admin
node_app -->|"routes"| node_student_search
node_app -->|"routes"| node_circulation
node_app -->|"routes"| node_reservations
node_app -->|"routes"| node_catalog_admin
node_app -->|"routes"| node_student_admin
node_app -->|"routes"| node_user_admin
node_app -->|"routes"| node_admin_catalog
node_app -->|"routes"| node_analytics
node_app -->|"routes"| node_signup
node_app -->|"routes"| node_librarian_signup
node_student -->|"fetches notices"| node_api_client
node_student_search -->|"requests books"| node_api_client
node_student_books -->|"loads loans"| node_api_client
node_student_settings -.->|"uses"| node_api_client
node_circulation -->|"marks returned"| node_api_client
node_reservations -.->|"uses"| node_api_client
node_catalog_admin -->|"uses"| node_api_client
node_student_admin -->|"uses"| node_api_client
node_user_admin -->|"approves users"| node_api_client
node_admin_catalog -->|"uses"| node_api_client
node_analytics -->|"loads reports"| node_api_client
node_signup -->|"submits request"| node_api_client
node_librarian_signup -->|"submits request"| node_api_client
node_api_client -.->|"HTTP requests"| node_api_server
node_api_server -->|"serves routes"| node_book_search_api
node_book_search_api -->|"reads books"| node_book_store
node_api_server -->|"creates and approves"| node_registration_store
node_api_server -->|"reads and updates"| node_student_store
node_api_server -.->|"uses loans"| node_borrow_store
node_api_server -->|"uses reservations"| node_reservation_store
node_api_server -.->|"uses notices"| node_notification_store
node_api_server -->|"uses accounts"| node_user_store
node_api_server -.->|"provides analytics"| node_analytics

click node_app "https://github.com/teja-13/e2e/blob/main/frontend/src/App.tsx"
click node_student "https://github.com/teja-13/e2e/blob/main/frontend/src/components/student/StudentLayout.tsx"
click node_student_search "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/student/BookSearch.tsx"
click node_student_books "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/student/MyBooks.tsx"
click node_student_settings "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/student/settings/Settings.tsx"
click node_librarian "https://github.com/teja-13/e2e/blob/main/frontend/src/components/librarian/LibrarianLayout.tsx"
click node_circulation "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/Borrowed.tsx"
click node_reservations "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/Reservations.tsx"
click node_catalog_admin "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/ManageBooks.tsx"
click node_student_admin "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/ManageStudents.tsx"
click node_admin "https://github.com/teja-13/e2e/blob/main/frontend/src/components/admin/AdminLayout.tsx"
click node_user_admin "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/ManageUsers.tsx"
click node_admin_catalog "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/ManageBooks.tsx"
click node_signup "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/public/StudentSignupRequest.tsx"
click node_librarian_signup "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/LibrarianSignupRequest.tsx"
click node_analytics "https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/AdminAnalytics.tsx"
click node_api_client "https://github.com/teja-13/e2e/blob/main/frontend/src/services/api.ts"
click node_api_server "https://github.com/teja-13/e2e/blob/main/backend/mockAuthServer.js"
click node_book_search_api "https://github.com/teja-13/e2e/blob/main/backend/mockAuthServer.js"
click node_borrow_store "https://github.com/teja-13/e2e/blob/main/backend/models/Borrow.js"
click node_book_store "https://github.com/teja-13/e2e/blob/main/backend/models/Book.js"
click node_student_store "https://github.com/teja-13/e2e/blob/main/backend/models/Student.js"
click node_registration_store "https://github.com/teja-13/e2e/blob/main/backend/models/Registration.js"
click node_reservation_store "https://github.com/teja-13/e2e/blob/main/backend/models/Reservation.js"
click node_notification_store "https://github.com/teja-13/e2e/blob/main/backend/models/Notification.js"
click node_user_store "https://github.com/teja-13/e2e/blob/main/backend/models/User.js"

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_student,node_student_settings,node_librarian,node_admin,node_api_client,node_people toneBlue
class node_student_search,node_student_books,node_circulation,node_reservations,node_catalog_admin,node_admin_catalog toneAmber
class node_student_admin,node_user_admin,node_signup,node_librarian_signup toneMint
class node_api_server,node_book_search_api,node_borrow_store,node_book_store,node_student_store,node_registration_store,node_reservation_store,node_notification_store,node_user_store toneRose
class node_analytics toneIndigo
```

## Components

### Web client

- [Role routing](https://github.com/teja-13/e2e/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Student portal](https://github.com/teja-13/e2e/blob/main/frontend/src/components/student/StudentLayout.tsx): `frontend/src/components/student/StudentLayout.tsx`
- [Student settings](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/student/settings/Settings.tsx): `frontend/src/pages/student/settings/Settings.tsx`
- [Librarian portal](https://github.com/teja-13/e2e/blob/main/frontend/src/components/librarian/LibrarianLayout.tsx): `frontend/src/components/librarian/LibrarianLayout.tsx`
- [Admin portal](https://github.com/teja-13/e2e/blob/main/frontend/src/components/admin/AdminLayout.tsx): `frontend/src/components/admin/AdminLayout.tsx`
- [API client](https://github.com/teja-13/e2e/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Library operations

- [Book search](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/student/BookSearch.tsx): `frontend/src/pages/student/BookSearch.tsx`
- [My books](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/student/MyBooks.tsx): `frontend/src/pages/student/MyBooks.tsx`
- [Borrow and return](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/Borrowed.tsx): `frontend/src/pages/librarian/Borrowed.tsx`
- [Reservations](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/Reservations.tsx): `frontend/src/pages/librarian/Reservations.tsx`
- [Catalog management](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/ManageBooks.tsx): `frontend/src/pages/librarian/ManageBooks.tsx`
- [Admin catalog](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/ManageBooks.tsx): `frontend/src/pages/admin/ManageBooks.tsx`

### Access administration

- [Student management](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/ManageStudents.tsx): `frontend/src/pages/librarian/ManageStudents.tsx`
- [User approvals](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/ManageUsers.tsx): `frontend/src/pages/admin/ManageUsers.tsx`
- [Signup requests](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/public/StudentSignupRequest.tsx): `frontend/src/pages/public/StudentSignupRequest.tsx`
- [Librarian signup](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/librarian/LibrarianSignupRequest.tsx): `frontend/src/pages/librarian/LibrarianSignupRequest.tsx`

### Library records

- [Express API](https://github.com/teja-13/e2e/blob/main/backend/mockAuthServer.js): `backend/mockAuthServer.js`
- [Book catalog API](https://github.com/teja-13/e2e/blob/main/backend/mockAuthServer.js): `backend/mockAuthServer.js`
- [Borrow records](https://github.com/teja-13/e2e/blob/main/backend/models/Borrow.js): `backend/models/Borrow.js`
- [Book records](https://github.com/teja-13/e2e/blob/main/backend/models/Book.js): `backend/models/Book.js`
- [Student records](https://github.com/teja-13/e2e/blob/main/backend/models/Student.js): `backend/models/Student.js`
- [Signup records](https://github.com/teja-13/e2e/blob/main/backend/models/Registration.js): `backend/models/Registration.js`
- [Reservation records](https://github.com/teja-13/e2e/blob/main/backend/models/Reservation.js): `backend/models/Reservation.js`
- [Notifications](https://github.com/teja-13/e2e/blob/main/backend/models/Notification.js): `backend/models/Notification.js`
- [Staff accounts](https://github.com/teja-13/e2e/blob/main/backend/models/User.js): `backend/models/User.js`

### Analytics

- [Analytics dashboard](https://github.com/teja-13/e2e/blob/main/frontend/src/pages/admin/AdminAnalytics.tsx): `frontend/src/pages/admin/AdminAnalytics.tsx`

### Other components

- **Library users**

## Connections

- Library users → Role routing: use (evidence: `frontend/src/App.tsx`)
- Role routing → Student portal: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Librarian portal: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Admin portal: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Book search: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Borrow and return: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Reservations: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Catalog management: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Student management: routes (evidence: `frontend/src/App.tsx`)
- Role routing → User approvals: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Admin catalog: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Analytics dashboard: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Signup requests: routes (evidence: `frontend/src/App.tsx`)
- Role routing → Librarian signup: routes (evidence: `frontend/src/App.tsx`)
- Student portal → API client: fetches notices (evidence: `frontend/src/components/student/StudentLayout.tsx`)
- Book search → API client: requests books (evidence: `frontend/src/pages/student/BookSearch.tsx`)
- My books → API client: loads loans (evidence: `frontend/src/pages/student/MyBooks.tsx`)
- Student settings → API client: uses
- Borrow and return → API client: marks returned (evidence: `frontend/src/pages/librarian/Borrowed.tsx`)
- Reservations → API client: uses
- Catalog management → API client: uses (evidence: `frontend/src/pages/librarian/ManageBooks.tsx`)
- Student management → API client: uses (evidence: `frontend/src/pages/librarian/ManageStudents.tsx`)
- User approvals → API client: approves users (evidence: `frontend/src/pages/admin/ManageUsers.tsx`)
- Admin catalog → API client: uses (evidence: `frontend/src/pages/admin/ManageBooks.tsx`)
- Analytics dashboard → API client: loads reports (evidence: `frontend/src/pages/admin/AdminAnalytics.tsx`)
- Signup requests → API client: submits request (evidence: `frontend/src/pages/public/StudentSignupRequest.tsx`)
- Librarian signup → API client: submits request (evidence: `frontend/src/pages/librarian/LibrarianSignupRequest.tsx`)
- API client → Express API: HTTP requests
- Express API → Book catalog API: serves routes (evidence: `backend/mockAuthServer.js`)
- Book catalog API → Book records: reads books (evidence: `backend/mockAuthServer.js`)
- Express API → Signup records: creates and approves (evidence: `backend/mockAuthServer.js`)
- Express API → Student records: reads and updates (evidence: `backend/mockAuthServer.js`)
- Express API → Borrow records: uses loans (evidence: `backend/mockAuthServer.js`)
- Express API → Reservation records: uses reservations (evidence: `backend/mockAuthServer.js`)
- Express API → Notifications: uses notices (evidence: `backend/mockAuthServer.js`)
- Express API → Staff accounts: uses accounts (evidence: `backend/mockAuthServer.js`)
- Express API → Analytics dashboard: provides analytics
