# riskidwiputra/jaskitafe architecture

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

- Interactive diagram: https://gitdiagram.com/riskidwiputra/jaskitafe
- Repository: https://github.com/riskidwiputra/jaskitafe

## Overview

Sewa Jas Web is a rental-business management frontend. Users log in, then manage inventory, renters, rental transactions and returns, fines, expenses, and view dashboard and report summaries. Pages call a shared API client, which sends requests to the separately run backend; session tokens are stored in browser local storage. The README also describes a cash-book feature, but no corresponding page or source path appears in the supplied tree, so it is not mapped here. Several page and component relationships rely on the SOURCE INDEX; unsampled behavior is not inferred.

Main entry points: [`lib/api.js`](https://github.com/riskidwiputra/jaskitafe/blob/master/lib/api.js) (API client), [`app/transaksi/page.js`](https://github.com/riskidwiputra/jaskitafe/blob/master/app/transaksi/page.js) (Rental transactions), [`components/Form.js`](https://github.com/riskidwiputra/jaskitafe/blob/master/components/Form.js) (Form controls), [`components/Modal.js`](https://github.com/riskidwiputra/jaskitafe/blob/master/components/Modal.js) (Modal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Login<br/>[page.js]"]
  node_session["Session storage<br/>[auth.js]"]
  node_protected["Protected layout<br/>[ProtectedLayout.js]"]
  node_sidebar["Sidebar<br/>[Sidebar.js]"]
end

subgraph group_rental["Rental operations"]
  node_inventory["Inventory<br/>[page.js]"]
  node_barangtable["Inventory table<br/>[BarangTable.js]"]
  node_renters["Renter records<br/>[page.js]"]
  node_transactions["Rental transactions<br/>[page.js]"]
  node_transtable["Transaction table<br/>[TransaksiTable.js]"]
  node_picker["Item picker<br/>[BarangPicker.js]"]
  node_photo["Photo input<br/>[PhotoInput.js]"]
end

subgraph group_finance["Finance and reporting"]
  node_fines["Fines<br/>[page.js]"]
  node_expenses["Expenses<br/>[page.js]"]
  node_dashboard["Dashboard<br/>[page.js]"]
  node_reports["Reports<br/>[page.js]"]
end

subgraph group_shared["Shared frontend and API"]
  node_api["API client<br/>[api.js]"]
  node_form["Form controls<br/>[Form.js]"]
  node_modal["Modal<br/>[Modal.js]"]
  node_status["Status badge<br/>[StatusBadge.js]"]
  node_rowactions["Row actions<br/>[RowActions.js]"]
end

node_user(("Business user"))
node_backend{{"Rental backend"}}

node_user -->|"signs in"| node_login
node_login -->|"submits credentials"| node_api
node_login -->|"stores session"| node_session
node_protected -->|"checks token"| node_session
node_protected -->|"renders"| node_sidebar
node_inventory -->|"manages inventory"| node_api
node_inventory -->|"renders"| node_barangtable
node_inventory -->|"uses controls"| node_form
node_inventory -->|"opens forms"| node_modal
node_renters -->|"manages renters"| node_api
node_renters -->|"uses controls"| node_form
node_renters -->|"opens forms"| node_modal
node_transactions -->|"manages rentals"| node_api
node_transactions -->|"renders"| node_transtable
node_transactions -->|"selects items"| node_picker
node_transactions -->|"captures photos"| node_photo
node_transactions -->|"uses controls"| node_form
node_transactions -->|"opens forms"| node_modal
node_barangtable -->|"shows status"| node_status
node_barangtable -->|"renders actions"| node_rowactions
node_transtable -->|"shows status"| node_status
node_fines -->|"manages fines"| node_api
node_fines -->|"uses controls"| node_form
node_fines -->|"opens forms"| node_modal
node_expenses -->|"manages expenses"| node_api
node_expenses -->|"uses controls"| node_form
node_expenses -->|"opens forms"| node_modal
node_dashboard -->|"loads summaries"| node_api
node_dashboard -->|"shows status"| node_status
node_reports -->|"loads reports"| node_api
node_api -->|"reads token"| node_session
node_api -->|"sends requests"| node_backend

click node_login "https://github.com/riskidwiputra/jaskitafe/blob/master/app/login/page.js"
click node_session "https://github.com/riskidwiputra/jaskitafe/blob/master/lib/auth.js"
click node_protected "https://github.com/riskidwiputra/jaskitafe/blob/master/components/ProtectedLayout.js"
click node_sidebar "https://github.com/riskidwiputra/jaskitafe/blob/master/components/Sidebar.js"
click node_inventory "https://github.com/riskidwiputra/jaskitafe/blob/master/app/barang/page.js"
click node_barangtable "https://github.com/riskidwiputra/jaskitafe/blob/master/components/BarangTable.js"
click node_renters "https://github.com/riskidwiputra/jaskitafe/blob/master/app/penyewa/page.js"
click node_transactions "https://github.com/riskidwiputra/jaskitafe/blob/master/app/transaksi/page.js"
click node_transtable "https://github.com/riskidwiputra/jaskitafe/blob/master/components/TransaksiTable.js"
click node_picker "https://github.com/riskidwiputra/jaskitafe/blob/master/components/BarangPicker.js"
click node_photo "https://github.com/riskidwiputra/jaskitafe/blob/master/components/PhotoInput.js"
click node_fines "https://github.com/riskidwiputra/jaskitafe/blob/master/app/denda/page.js"
click node_expenses "https://github.com/riskidwiputra/jaskitafe/blob/master/app/pengeluaran/page.js"
click node_dashboard "https://github.com/riskidwiputra/jaskitafe/blob/master/app/dashboard/page.js"
click node_reports "https://github.com/riskidwiputra/jaskitafe/blob/master/app/laporan/page.js"
click node_api "https://github.com/riskidwiputra/jaskitafe/blob/master/lib/api.js"
click node_form "https://github.com/riskidwiputra/jaskitafe/blob/master/components/Form.js"
click node_modal "https://github.com/riskidwiputra/jaskitafe/blob/master/components/Modal.js"
click node_status "https://github.com/riskidwiputra/jaskitafe/blob/master/components/StatusBadge.js"
click node_rowactions "https://github.com/riskidwiputra/jaskitafe/blob/master/components/RowActions.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_login,node_session,node_protected,node_sidebar,node_user toneBlue
class node_inventory,node_barangtable,node_renters,node_transactions,node_transtable,node_picker,node_photo toneAmber
class node_fines,node_expenses,node_dashboard,node_reports toneMint
class node_api,node_form,node_modal,node_status,node_rowactions toneRose
class node_backend toneIndigo
```

## Components

### Access and navigation

- [Login](https://github.com/riskidwiputra/jaskitafe/blob/master/app/login/page.js): `app/login/page.js`
- [Session storage](https://github.com/riskidwiputra/jaskitafe/blob/master/lib/auth.js): `lib/auth.js`
- [Protected layout](https://github.com/riskidwiputra/jaskitafe/blob/master/components/ProtectedLayout.js): `components/ProtectedLayout.js`
- [Sidebar](https://github.com/riskidwiputra/jaskitafe/blob/master/components/Sidebar.js): `components/Sidebar.js`

### Rental operations

- [Inventory](https://github.com/riskidwiputra/jaskitafe/blob/master/app/barang/page.js): `app/barang/page.js`
- [Inventory table](https://github.com/riskidwiputra/jaskitafe/blob/master/components/BarangTable.js): `components/BarangTable.js`
- [Renter records](https://github.com/riskidwiputra/jaskitafe/blob/master/app/penyewa/page.js): `app/penyewa/page.js`
- [Rental transactions](https://github.com/riskidwiputra/jaskitafe/blob/master/app/transaksi/page.js): `app/transaksi/page.js`
- [Transaction table](https://github.com/riskidwiputra/jaskitafe/blob/master/components/TransaksiTable.js): `components/TransaksiTable.js`
- [Item picker](https://github.com/riskidwiputra/jaskitafe/blob/master/components/BarangPicker.js): `components/BarangPicker.js`
- [Photo input](https://github.com/riskidwiputra/jaskitafe/blob/master/components/PhotoInput.js): `components/PhotoInput.js`

### Finance and reporting

- [Fines](https://github.com/riskidwiputra/jaskitafe/blob/master/app/denda/page.js): `app/denda/page.js`
- [Expenses](https://github.com/riskidwiputra/jaskitafe/blob/master/app/pengeluaran/page.js): `app/pengeluaran/page.js`
- [Dashboard](https://github.com/riskidwiputra/jaskitafe/blob/master/app/dashboard/page.js): `app/dashboard/page.js`
- [Reports](https://github.com/riskidwiputra/jaskitafe/blob/master/app/laporan/page.js): `app/laporan/page.js`

### Shared frontend and API

- [API client](https://github.com/riskidwiputra/jaskitafe/blob/master/lib/api.js): `lib/api.js`
- [Form controls](https://github.com/riskidwiputra/jaskitafe/blob/master/components/Form.js): `components/Form.js`
- [Modal](https://github.com/riskidwiputra/jaskitafe/blob/master/components/Modal.js): `components/Modal.js`
- [Status badge](https://github.com/riskidwiputra/jaskitafe/blob/master/components/StatusBadge.js): `components/StatusBadge.js`
- [Row actions](https://github.com/riskidwiputra/jaskitafe/blob/master/components/RowActions.js): `components/RowActions.js`

### Other components

- **Business user**
- **Rental backend**

## Connections

- Business user → Login: signs in (evidence: `README.md`)
- Login → API client: submits credentials (evidence: `app/login/page.js`)
- Login → Session storage: stores session (evidence: `app/login/page.js`)
- Protected layout → Session storage: checks token (evidence: `components/ProtectedLayout.js`)
- Protected layout → Sidebar: renders (evidence: `components/ProtectedLayout.js`)
- Inventory → API client: manages inventory (evidence: `app/barang/page.js`)
- Inventory → Inventory table: renders (evidence: `app/barang/page.js`)
- Inventory → Form controls: uses controls (evidence: `app/barang/page.js`)
- Inventory → Modal: opens forms (evidence: `app/barang/page.js`)
- Renter records → API client: manages renters (evidence: `app/penyewa/page.js`)
- Renter records → Form controls: uses controls (evidence: `app/penyewa/page.js`)
- Renter records → Modal: opens forms (evidence: `app/penyewa/page.js`)
- Rental transactions → API client: manages rentals (evidence: `app/transaksi/page.js`)
- Rental transactions → Transaction table: renders (evidence: `app/transaksi/page.js`)
- Rental transactions → Item picker: selects items (evidence: `app/transaksi/page.js`)
- Rental transactions → Photo input: captures photos (evidence: `app/transaksi/page.js`)
- Rental transactions → Form controls: uses controls (evidence: `app/transaksi/page.js`)
- Rental transactions → Modal: opens forms (evidence: `app/transaksi/page.js`)
- Inventory table → Status badge: shows status (evidence: `components/BarangTable.js`)
- Inventory table → Row actions: renders actions (evidence: `components/BarangTable.js`)
- Transaction table → Status badge: shows status (evidence: `components/TransaksiTable.js`)
- Fines → API client: manages fines (evidence: `app/denda/page.js`)
- Fines → Form controls: uses controls (evidence: `app/denda/page.js`)
- Fines → Modal: opens forms (evidence: `app/denda/page.js`)
- Expenses → API client: manages expenses (evidence: `app/pengeluaran/page.js`)
- Expenses → Form controls: uses controls (evidence: `app/pengeluaran/page.js`)
- Expenses → Modal: opens forms (evidence: `app/pengeluaran/page.js`)
- Dashboard → API client: loads summaries (evidence: `app/dashboard/page.js`)
- Dashboard → Status badge: shows status (evidence: `app/dashboard/page.js`)
- Reports → API client: loads reports (evidence: `app/laporan/page.js`)
- API client → Session storage: reads token (evidence: `lib/api.js`)
- API client → Rental backend: sends requests (evidence: `lib/api.js`)
