# kage-damn/buklat-aklat architecture

> Architecture diagram of the GitHub repository kage-damn/buklat-aklat, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kage-damn/buklat-aklat
- Repository: https://github.com/kage-damn/buklat-aklat

## Overview

Buklat-Aklat is a session-only library management application with console and Swing entry points. In the console workflow, students and librarians log in through Main, which dispatches role-specific actions to Library; Library applies catalog and loan rules against in-memory arrays. Borrowing creates dated records, and returns update both record status and book availability. Librarians also manage books, students, account confirmation, and master lists. The README describes the console product, while the source index and GUI excerpt show a separate Swing interface. Relationships are limited to calls and references shown in the excerpts or documented in the README.

Main entry points: [`Library.java`](https://github.com/kage-damn/buklat-aklat/blob/main/Library.java) (Library rules), [`Main.java`](https://github.com/kage-damn/buklat-aklat/blob/main/Main.java) (Console workflow), [`Student.java`](https://github.com/kage-damn/buklat-aklat/blob/main/Student.java) (Student account), [`Librarian.java`](https://github.com/kage-damn/buklat-aklat/blob/main/Librarian.java) (Librarian account)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_console_app["Console workflow<br/>[Main.java]"]
  node_swing_app["Swing interface<br/>[LibraryGUI.java]"]
end

subgraph group_library_ops["Library operations"]
  node_library["Library rules<br/>[Library.java]"]
  node_rule_errors["Rule errors"]
end

subgraph group_domain_models["Domain models"]
  node_book["Catalog book<br/>[Book.java]"]
  node_borrow_record["Loan record<br/>[BorrowRecord.java]"]
  node_user["User base<br/>[User.java]"]
  node_student["Student account<br/>[Student.java]"]
  node_librarian["Librarian account<br/>[Librarian.java]"]
end

node_student_actor(("Student"))
node_librarian_actor(("Librarian"))

node_student_actor -->|"uses"| node_console_app
node_librarian_actor -->|"uses"| node_console_app
node_console_app -->|"authenticates and manages"| node_library
node_console_app -->|"dispatches session"| node_student
node_console_app -->|"dispatches session"| node_librarian
node_student -->|"requests loans"| node_library
node_librarian -->|"views master list"| node_library
node_library -->|"stores and updates"| node_book
node_library -->|"creates and updates"| node_borrow_record
node_library -->|"stores and checks"| node_student
node_library -->|"stores and authenticates"| node_librarian
node_library -->|"raises"| node_rule_errors
node_student -->|"extends"| node_user
node_librarian -->|"extends"| node_user
node_swing_app -->|"uses"| node_library

click node_console_app "https://github.com/kage-damn/buklat-aklat/blob/main/Main.java"
click node_swing_app "https://github.com/kage-damn/buklat-aklat/blob/main/LibraryGUI.java"
click node_library "https://github.com/kage-damn/buklat-aklat/blob/main/Library.java"
click node_rule_errors "https://github.com/kage-damn/buklat-aklat/blob/main/LibraryException.java"
click node_book "https://github.com/kage-damn/buklat-aklat/blob/main/Book.java"
click node_borrow_record "https://github.com/kage-damn/buklat-aklat/blob/main/BorrowRecord.java"
click node_user "https://github.com/kage-damn/buklat-aklat/blob/main/User.java"
click node_student "https://github.com/kage-damn/buklat-aklat/blob/main/Student.java"
click node_librarian "https://github.com/kage-damn/buklat-aklat/blob/main/Librarian.java"

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_console_app,node_swing_app toneBlue
class node_library,node_rule_errors toneAmber
class node_book,node_borrow_record,node_user,node_student,node_librarian toneMint
class node_student_actor,node_librarian_actor toneIndigo
```

## Components

### User interfaces

- [Console workflow](https://github.com/kage-damn/buklat-aklat/blob/main/Main.java): `Main.java`
- [Swing interface](https://github.com/kage-damn/buklat-aklat/blob/main/LibraryGUI.java): `LibraryGUI.java`

### Library operations

- [Library rules](https://github.com/kage-damn/buklat-aklat/blob/main/Library.java): `Library.java`
- [Rule errors](https://github.com/kage-damn/buklat-aklat/blob/main/LibraryException.java): `LibraryException.java`

### Domain models

- [Catalog book](https://github.com/kage-damn/buklat-aklat/blob/main/Book.java): `Book.java`
- [Loan record](https://github.com/kage-damn/buklat-aklat/blob/main/BorrowRecord.java): `BorrowRecord.java`
- [User base](https://github.com/kage-damn/buklat-aklat/blob/main/User.java): `User.java`
- [Student account](https://github.com/kage-damn/buklat-aklat/blob/main/Student.java): `Student.java`
- [Librarian account](https://github.com/kage-damn/buklat-aklat/blob/main/Librarian.java): `Librarian.java`

### Other components

- **Student**
- **Librarian**

## Connections

- Student → Console workflow: uses (evidence: `README.md`)
- Librarian → Console workflow: uses (evidence: `README.md`)
- Console workflow → Library rules: authenticates and manages (evidence: `Main.java`)
- Console workflow → Student account: dispatches session (evidence: `Main.java`)
- Console workflow → Librarian account: dispatches session (evidence: `Main.java`)
- Student account → Library rules: requests loans (evidence: `Student.java`)
- Librarian account → Library rules: views master list (evidence: `Librarian.java`)
- Library rules → Catalog book: stores and updates (evidence: `Library.java`)
- Library rules → Loan record: creates and updates (evidence: `Library.java`)
- Library rules → Student account: stores and checks (evidence: `Library.java`)
- Library rules → Librarian account: stores and authenticates (evidence: `Library.java`)
- Library rules → Rule errors: raises (evidence: `Library.java`)
- Student account → User base: extends (evidence: `Student.java`)
- Librarian account → User base: extends (evidence: `Librarian.java`)
- Swing interface → Library rules: uses (evidence: `LibraryGUI.java`)
