# akhilesh2903/lib architecture

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

- Interactive diagram: https://gitdiagram.com/akhilesh2903/lib
- Repository: https://github.com/akhilesh2903/lib

## Overview

Aster College LMS supports role-based library operations from portal sign-in through catalog, circulation, member services, and reporting. The browser selects role-specific dashboards and operational pages; its API client connects the portal to FastAPI routes, which use shared persistence and authentication services. The README documents additional capabilities such as fines, reservations, notifications, settings, and exports. Those route implementations were not sampled, so their internal calls are not expanded; frontend-to-backend wiring is shown as unverified.

Main entry points: [`frontend/src/app/page.tsx`](https://github.com/akhilesh2903/lib/blob/main/frontend/src/app/page.tsx) (Portal entry), [`backend/main.py`](https://github.com/akhilesh2903/lib/blob/main/backend/main.py) (FastAPI application), [`frontend/src/services/api.ts`](https://github.com/akhilesh2903/lib/blob/main/frontend/src/services/api.ts) (API client), [`backend/app/routes/auth.py`](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/auth.py) (Authentication routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portal["Web Portal"]
  node_portal_entry["Portal entry<br/>[page.tsx]"]
  node_dashboard_layout["Dashboard shell"]
  node_admin_dashboard["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_librarian_dashboard["Librarian dashboard"]
  node_student_dashboard["Student dashboard"]
  node_login_page["Sign-in page<br/>[LoginPage.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
end

subgraph group_identity["Identity &amp; Access"]
  node_auth_routes["Authentication routes<br/>[auth.py]"]
  node_auth_middleware["JWT and role checks<br/>[auth_middleware.py]"]
  node_user_schemas["User schemas<br/>[user.py]"]
  node_security["Password and JWT<br/>[security.py]"]
end

subgraph group_operations["Library Operations"]
  node_catalog_page["Catalog<br/>[CatalogPage.tsx]"]
  node_circulation_page["Circulation"]
  node_members_page["Members<br/>[MembersPage.tsx]"]
  node_librarians_page["Librarian accounts<br/>[LibrariansPage.tsx]"]
  node_reservations_page["Reservations"]
  node_fines_page["Fine settlement<br/>[FinesPage.tsx]"]
  node_settings_page["Library settings<br/>[SettingsPage.tsx]"]
  node_books_routes["Book inventory API<br/>[books.py]"]
  node_circulation_routes["Circulation API<br/>[circulation.py]"]
  node_students_routes["Student accounts API<br/>[students.py]"]
  node_librarians_routes["Librarian accounts API<br/>[librarians.py]"]
  node_reservations_routes["Reservations API<br/>[reservations.py]"]
  node_fines_routes["Fines API<br/>[fines.py]"]
  node_settings_routes["Settings API<br/>[settings.py]"]
end

subgraph group_insights["Insights &amp; Messaging"]
  node_dashboard_routes["Dashboard API<br/>[dashboard.py]"]
  node_reports_page["Reports page<br/>[ReportsPage.tsx]"]
  node_reports_routes["Report export API<br/>[reports.py]"]
  node_report_service["PDF and Excel generation<br/>[report_service.py]"]
  node_activity_page["Activity logs page"]
  node_activity_routes["Activity log API<br/>[activity_logs.py]"]
  node_notifications_routes["Notifications API<br/>[notifications.py]"]
end

subgraph group_platform["API &amp; Persistence"]
  node_backend_main["FastAPI application<br/>[main.py]"]
end

node_library_user(("Library user"))

node_library_user -->|"uses"| node_portal_entry
node_portal_entry -->|"renders when signed out"| node_login_page
node_portal_entry -->|"wraps portal"| node_dashboard_layout
node_portal_entry -->|"renders by role"| node_admin_dashboard
node_portal_entry -->|"renders by role"| node_librarian_dashboard
node_portal_entry -->|"renders by role"| node_student_dashboard
node_portal_entry -->|"renders tab"| node_catalog_page
node_portal_entry -->|"renders tab"| node_circulation_page
node_portal_entry -->|"renders tab"| node_members_page
node_portal_entry -->|"renders tab"| node_librarians_page
node_portal_entry -->|"renders tab"| node_reservations_page
node_portal_entry -->|"renders tab"| node_fines_page
node_portal_entry -->|"renders tab"| node_reports_page
node_portal_entry -->|"renders tab"| node_activity_page
node_api_client -.->|"requests API"| node_auth_routes
node_api_client -.->|"requests API"| node_books_routes
node_api_client -.->|"requests API"| node_circulation_routes
node_api_client -.->|"requests API"| node_dashboard_routes
node_api_client -.->|"requests API"| node_reports_routes
node_api_client -.->|"requests API"| node_reservations_routes
node_api_client -.->|"requests API"| node_fines_routes
node_api_client -.->|"requests API"| node_students_routes
node_api_client -.->|"requests API"| node_librarians_routes
node_api_client -.->|"requests API"| node_settings_routes
node_api_client -.->|"requests API"| node_notifications_routes
node_api_client -.->|"requests API"| node_activity_routes
node_auth_routes -->|"validates registration"| node_user_schemas
node_auth_routes -->|"verifies credentials"| node_security
node_auth_routes -->|"depends on user lookup"| node_auth_middleware
node_auth_middleware -->|"decodes token"| node_security
node_auth_routes -.->|"records activity"| node_activity_routes
node_reports_routes -.->|"generates exports"| node_report_service
node_portal_entry -.->|"renders tab"| node_settings_page
node_portal_entry -.->|"connects to API"| node_backend_main
node_backend_main -->|"mounts routes"| node_books_routes
node_backend_main -->|"mounts routes"| node_circulation_routes
node_backend_main -->|"mounts routes"| node_auth_routes
node_backend_main -->|"mounts routes"| node_dashboard_routes
node_backend_main -->|"mounts routes"| node_students_routes
node_backend_main -->|"mounts routes"| node_librarians_routes
node_backend_main -->|"mounts routes"| node_reservations_routes
node_backend_main -->|"mounts routes"| node_fines_routes
node_backend_main -->|"mounts routes"| node_notifications_routes
node_backend_main -->|"mounts routes"| node_reports_routes
node_backend_main -->|"mounts routes"| node_settings_routes
node_backend_main -->|"mounts routes"| node_activity_routes

click node_portal_entry "https://github.com/akhilesh2903/lib/blob/main/frontend/src/app/page.tsx"
click node_dashboard_layout "https://github.com/akhilesh2903/lib/blob/main/frontend/src/layouts/DashboardLayout.tsx"
click node_admin_dashboard "https://github.com/akhilesh2903/lib/blob/main/frontend/src/dashboards/AdminDashboard.tsx"
click node_librarian_dashboard "https://github.com/akhilesh2903/lib/blob/main/frontend/src/dashboards/LibrarianDashboard.tsx"
click node_student_dashboard "https://github.com/akhilesh2903/lib/blob/main/frontend/src/dashboards/StudentDashboard.tsx"
click node_login_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/LoginPage.tsx"
click node_api_client "https://github.com/akhilesh2903/lib/blob/main/frontend/src/services/api.ts"
click node_catalog_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/CatalogPage.tsx"
click node_circulation_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/CirculationPage.tsx"
click node_members_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/MembersPage.tsx"
click node_librarians_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/LibrariansPage.tsx"
click node_reservations_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/ReservationsPage.tsx"
click node_fines_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/FinesPage.tsx"
click node_settings_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/SettingsPage.tsx"
click node_auth_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/auth.py"
click node_auth_middleware "https://github.com/akhilesh2903/lib/blob/main/backend/app/middleware/auth_middleware.py"
click node_user_schemas "https://github.com/akhilesh2903/lib/blob/main/backend/app/schemas/user.py"
click node_security "https://github.com/akhilesh2903/lib/blob/main/backend/app/utils/security.py"
click node_books_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/books.py"
click node_circulation_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/circulation.py"
click node_students_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/students.py"
click node_librarians_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/librarians.py"
click node_reservations_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/reservations.py"
click node_fines_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/fines.py"
click node_settings_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/settings.py"
click node_dashboard_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/dashboard.py"
click node_reports_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/ReportsPage.tsx"
click node_reports_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/reports.py"
click node_report_service "https://github.com/akhilesh2903/lib/blob/main/backend/app/services/report_service.py"
click node_activity_page "https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/ActivityLogsPage.tsx"
click node_activity_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/activity_logs.py"
click node_notifications_routes "https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/notifications.py"
click node_backend_main "https://github.com/akhilesh2903/lib/blob/main/backend/main.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_portal_entry,node_dashboard_layout,node_admin_dashboard,node_librarian_dashboard,node_student_dashboard,node_login_page,node_api_client,node_library_user toneBlue
class node_auth_routes,node_auth_middleware,node_user_schemas,node_security toneAmber
class node_catalog_page,node_circulation_page,node_members_page,node_librarians_page,node_reservations_page,node_fines_page,node_settings_page,node_books_routes,node_circulation_routes,node_students_routes,node_librarians_routes,node_reservations_routes,node_fines_routes,node_settings_routes toneMint
class node_dashboard_routes,node_reports_page,node_reports_routes,node_report_service,node_activity_page,node_activity_routes,node_notifications_routes toneRose
class node_backend_main toneIndigo
```

## Components

### Web Portal

- [Portal entry](https://github.com/akhilesh2903/lib/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Dashboard shell](https://github.com/akhilesh2903/lib/blob/main/frontend/src/layouts/DashboardLayout.tsx): `frontend/src/layouts/DashboardLayout.tsx`
- [Admin dashboard](https://github.com/akhilesh2903/lib/blob/main/frontend/src/dashboards/AdminDashboard.tsx): `frontend/src/dashboards/AdminDashboard.tsx`
- [Librarian dashboard](https://github.com/akhilesh2903/lib/blob/main/frontend/src/dashboards/LibrarianDashboard.tsx): `frontend/src/dashboards/LibrarianDashboard.tsx`
- [Student dashboard](https://github.com/akhilesh2903/lib/blob/main/frontend/src/dashboards/StudentDashboard.tsx): `frontend/src/dashboards/StudentDashboard.tsx`
- [Sign-in page](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/LoginPage.tsx): `frontend/src/pages/LoginPage.tsx`
- [API client](https://github.com/akhilesh2903/lib/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`

### Identity & Access

- [Authentication routes](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/auth.py): `backend/app/routes/auth.py`
- [JWT and role checks](https://github.com/akhilesh2903/lib/blob/main/backend/app/middleware/auth_middleware.py): `backend/app/middleware/auth_middleware.py`
- [User schemas](https://github.com/akhilesh2903/lib/blob/main/backend/app/schemas/user.py): `backend/app/schemas/user.py`
- [Password and JWT](https://github.com/akhilesh2903/lib/blob/main/backend/app/utils/security.py): `backend/app/utils/security.py`

### Library Operations

- [Catalog](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/CatalogPage.tsx): `frontend/src/pages/CatalogPage.tsx`
- [Circulation](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/CirculationPage.tsx): `frontend/src/pages/CirculationPage.tsx`
- [Members](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/MembersPage.tsx): `frontend/src/pages/MembersPage.tsx`
- [Librarian accounts](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/LibrariansPage.tsx): `frontend/src/pages/LibrariansPage.tsx`
- [Reservations](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/ReservationsPage.tsx): `frontend/src/pages/ReservationsPage.tsx`
- [Fine settlement](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/FinesPage.tsx): `frontend/src/pages/FinesPage.tsx`
- [Library settings](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/SettingsPage.tsx): `frontend/src/pages/SettingsPage.tsx`
- [Book inventory API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/books.py): `backend/app/routes/books.py`
- [Circulation API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/circulation.py): `backend/app/routes/circulation.py`
- [Student accounts API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/students.py): `backend/app/routes/students.py`
- [Librarian accounts API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/librarians.py): `backend/app/routes/librarians.py`
- [Reservations API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/reservations.py): `backend/app/routes/reservations.py`
- [Fines API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/fines.py): `backend/app/routes/fines.py`
- [Settings API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/settings.py): `backend/app/routes/settings.py`

### Insights & Messaging

- [Dashboard API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/dashboard.py): `backend/app/routes/dashboard.py`
- [Reports page](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/ReportsPage.tsx): `frontend/src/pages/ReportsPage.tsx`
- [Report export API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/reports.py): `backend/app/routes/reports.py`
- [PDF and Excel generation](https://github.com/akhilesh2903/lib/blob/main/backend/app/services/report_service.py): `backend/app/services/report_service.py`
- [Activity logs page](https://github.com/akhilesh2903/lib/blob/main/frontend/src/pages/ActivityLogsPage.tsx): `frontend/src/pages/ActivityLogsPage.tsx`
- [Activity log API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/activity_logs.py): `backend/app/routes/activity_logs.py`
- [Notifications API](https://github.com/akhilesh2903/lib/blob/main/backend/app/routes/notifications.py): `backend/app/routes/notifications.py`

### API & Persistence

- [FastAPI application](https://github.com/akhilesh2903/lib/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Library user**

## Connections

- Library user → Portal entry: uses (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Sign-in page: renders when signed out (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Dashboard shell: wraps portal (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Admin dashboard: renders by role (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Librarian dashboard: renders by role (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Student dashboard: renders by role (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Catalog: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Circulation: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Members: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Librarian accounts: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Reservations: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Fine settlement: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Reports page: renders tab (evidence: `frontend/src/app/page.tsx`)
- Portal entry → Activity logs page: renders tab (evidence: `frontend/src/app/page.tsx`)
- API client → Authentication routes: requests API
- API client → Book inventory API: requests API
- API client → Circulation API: requests API
- API client → Dashboard API: requests API
- API client → Report export API: requests API
- API client → Reservations API: requests API
- API client → Fines API: requests API
- API client → Student accounts API: requests API
- API client → Librarian accounts API: requests API
- API client → Settings API: requests API
- API client → Notifications API: requests API
- API client → Activity log API: requests API
- Authentication routes → User schemas: validates registration (evidence: `backend/app/routes/auth.py`)
- Authentication routes → Password and JWT: verifies credentials (evidence: `backend/app/routes/auth.py`)
- Authentication routes → JWT and role checks: depends on user lookup (evidence: `backend/app/routes/auth.py`)
- JWT and role checks → Password and JWT: decodes token (evidence: `backend/app/middleware/auth_middleware.py`)
- Authentication routes → Activity log API: records activity
- Report export API → PDF and Excel generation: generates exports
- Portal entry → Library settings: renders tab
- Portal entry → FastAPI application: connects to API
- FastAPI application → Book inventory API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Circulation API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Authentication routes: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Dashboard API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Student accounts API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Librarian accounts API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Reservations API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Fines API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Notifications API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Report export API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Settings API: mounts routes (evidence: `backend/main.py`)
- FastAPI application → Activity log API: mounts routes (evidence: `backend/main.py`)
