# hanan-alkahwaji/front-end architecture

> Architecture diagram of the GitHub repository hanan-alkahwaji/front-end, 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/hanan-alkahwaji/front-end
- Repository: https://github.com/hanan-alkahwaji/front-end

## Overview

This is a React library-management frontend, not the backend: staff can browse and manage books, create borrowing records, and manage active loans by editing return dates or returning books. The browser entry mounts the routed application; book and borrower pages call a localhost HTTP API, whose server implementation is outside this repository. The graph reflects imports and calls shown in the source index and excerpts; it does not infer backend storage or unsampled behavior.

Main entry points: [`src/pages/BookPage.jsx`](https://github.com/hanan-alkahwaji/front-end/blob/main/src/pages/BookPage.jsx) (Books page), [`src/pages/BorrowPage.jsx`](https://github.com/hanan-alkahwaji/front-end/blob/main/src/pages/BorrowPage.jsx) (Current borrowers), [`src/App.jsx`](https://github.com/hanan-alkahwaji/front-end/blob/main/src/App.jsx) (Route dispatch), [`src/services/api.js`](https://github.com/hanan-alkahwaji/front-end/blob/main/src/services/api.js) (HTTP API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_entry["React entry<br/>[main.jsx]"]
  node_router["Route dispatch<br/>[App.jsx]"]
  node_layout["App layout<br/>[AppLayout.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
  node_api["HTTP API client<br/>[api.js]"]
end

subgraph group_books["Book management"]
  node_bookpage["Books page<br/>[BookPage.jsx]"]
  node_bookform["Book form<br/>[BookForm.jsx]"]
  node_formmodal["Form modal<br/>[FormModal.jsx]"]
  node_confirmmodal["Confirm modal<br/>[ConfirmModal.jsx]"]
  node_statusfilter["Status filter<br/>[StatusFilter.jsx]"]
end

subgraph group_borrowing["Borrowing management"]
  node_borrowpage["Current borrowers<br/>[BorrowPage.jsx]"]
end

subgraph group_ui["Shared interface"]
  node_pageheader["Page header<br/>[PageHeader.jsx]"]
  node_card["Content card<br/>[Card.jsx]"]
  node_badge["Status badge<br/>[StatusBadge.jsx]"]
  node_alert["Error alert<br/>[AlertError.jsx]"]
  node_actions["Action buttons<br/>[ActionButtons.jsx]"]
end

node_user(("Library user"))
node_server["Library API server"]

node_user -.->|"uses"| node_entry
node_entry -->|"mounts"| node_router
node_router -->|"routes"| node_bookpage
node_router -->|"routes"| node_borrowpage
node_router -->|"wraps routes"| node_layout
node_layout -->|"renders"| node_navbar
node_bookpage -->|"loads and mutates"| node_api
node_borrowpage -->|"loads and updates"| node_api
node_api -->|"HTTP requests"| node_server
node_bookpage -->|"renders"| node_bookform
node_bookpage -->|"renders"| node_formmodal
node_bookpage -->|"renders"| node_confirmmodal
node_bookpage -->|"renders"| node_statusfilter
node_bookform -->|"renders"| node_alert
node_bookpage -->|"renders"| node_pageheader
node_bookpage -->|"renders"| node_card
node_bookpage -->|"renders"| node_badge
node_bookpage -->|"renders"| node_alert
node_bookpage -->|"uses"| node_actions
node_borrowpage -->|"renders"| node_pageheader
node_borrowpage -->|"renders"| node_card
node_borrowpage -->|"renders"| node_badge
node_borrowpage -->|"renders"| node_alert

click node_entry "https://github.com/hanan-alkahwaji/front-end/blob/main/src/main.jsx"
click node_router "https://github.com/hanan-alkahwaji/front-end/blob/main/src/App.jsx"
click node_layout "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/layout/AppLayout.jsx"
click node_navbar "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/layout/Navbar.jsx"
click node_bookpage "https://github.com/hanan-alkahwaji/front-end/blob/main/src/pages/BookPage.jsx"
click node_bookform "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/BookForm.jsx"
click node_formmodal "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/FormModal.jsx"
click node_confirmmodal "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ConfirmModal.jsx"
click node_statusfilter "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/StatusFilter.jsx"
click node_borrowpage "https://github.com/hanan-alkahwaji/front-end/blob/main/src/pages/BorrowPage.jsx"
click node_api "https://github.com/hanan-alkahwaji/front-end/blob/main/src/services/api.js"
click node_pageheader "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/layout/PageHeader.jsx"
click node_card "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/Card.jsx"
click node_badge "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/StatusBadge.jsx"
click node_alert "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/AlertError.jsx"
click node_actions "https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/ActionButtons.jsx"

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_entry,node_router,node_layout,node_navbar,node_api,node_user toneBlue
class node_bookpage,node_bookform,node_formmodal,node_confirmmodal,node_statusfilter toneAmber
class node_borrowpage,node_server toneMint
class node_pageheader,node_card,node_badge,node_alert,node_actions toneRose
```

## Components

### Application shell

- [React entry](https://github.com/hanan-alkahwaji/front-end/blob/main/src/main.jsx): `src/main.jsx`
- [Route dispatch](https://github.com/hanan-alkahwaji/front-end/blob/main/src/App.jsx): `src/App.jsx`
- [App layout](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/layout/AppLayout.jsx): `src/components/layout/AppLayout.jsx`
- [Navigation bar](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/layout/Navbar.jsx): `src/components/layout/Navbar.jsx`
- [HTTP API client](https://github.com/hanan-alkahwaji/front-end/blob/main/src/services/api.js): `src/services/api.js`

### Book management

- [Books page](https://github.com/hanan-alkahwaji/front-end/blob/main/src/pages/BookPage.jsx): `src/pages/BookPage.jsx`
- [Book form](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/BookForm.jsx): `src/components/BookForm.jsx`
- [Form modal](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/FormModal.jsx): `src/components/FormModal.jsx`
- [Confirm modal](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ConfirmModal.jsx): `src/components/ConfirmModal.jsx`
- [Status filter](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/StatusFilter.jsx): `src/components/StatusFilter.jsx`

### Borrowing management

- [Current borrowers](https://github.com/hanan-alkahwaji/front-end/blob/main/src/pages/BorrowPage.jsx): `src/pages/BorrowPage.jsx`

### Shared interface

- [Page header](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/layout/PageHeader.jsx): `src/components/layout/PageHeader.jsx`
- [Content card](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/Card.jsx): `src/components/ui/Card.jsx`
- [Status badge](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/StatusBadge.jsx): `src/components/ui/StatusBadge.jsx`
- [Error alert](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/AlertError.jsx): `src/components/ui/AlertError.jsx`
- [Action buttons](https://github.com/hanan-alkahwaji/front-end/blob/main/src/components/ui/ActionButtons.jsx): `src/components/ui/ActionButtons.jsx`

### Other components

- **Library user**
- **Library API server**

## Connections

- Library user → React entry: uses
- React entry → Route dispatch: mounts (evidence: `src/main.jsx`)
- Route dispatch → Books page: routes (evidence: `src/App.jsx`)
- Route dispatch → Current borrowers: routes (evidence: `src/App.jsx`)
- Route dispatch → App layout: wraps routes (evidence: `src/App.jsx`)
- App layout → Navigation bar: renders (evidence: `src/components/layout/AppLayout.jsx`)
- Books page → HTTP API client: loads and mutates (evidence: `src/pages/BookPage.jsx`)
- Current borrowers → HTTP API client: loads and updates (evidence: `src/pages/BorrowPage.jsx`)
- HTTP API client → Library API server: HTTP requests (evidence: `src/services/api.js`)
- Books page → Book form: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Form modal: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Confirm modal: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Status filter: renders (evidence: `src/pages/BookPage.jsx`)
- Book form → Error alert: renders (evidence: `src/components/BookForm.jsx`)
- Books page → Page header: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Content card: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Status badge: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Error alert: renders (evidence: `src/pages/BookPage.jsx`)
- Books page → Action buttons: uses (evidence: `src/pages/BookPage.jsx`)
- Current borrowers → Page header: renders (evidence: `src/pages/BorrowPage.jsx`)
- Current borrowers → Content card: renders (evidence: `src/pages/BorrowPage.jsx`)
- Current borrowers → Status badge: renders (evidence: `src/pages/BorrowPage.jsx`)
- Current borrowers → Error alert: renders (evidence: `src/pages/BorrowPage.jsx`)
