# moladev20/rentalps architecture

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

- Interactive diagram: https://gitdiagram.com/moladev20/rentalps
- Repository: https://github.com/moladev20/rentalps

## Overview

Rental POS is an administrator-facing PlayStation rental system. Its main workflow is to select an available unit, create a timed rental with optional FnB, manage the active order, take cash or QRIS payment, then review transaction and financial reports. The Vue client calls an Express API whose controllers implement rental, catalog, payment, authentication, and reporting behavior against Prisma-backed data; QRIS uses Midtrans. Sampled controller code supports the order, payment, and reporting links shown. Other documented capabilities are represented by their exact enclosing source paths where implementation was not sampled.

Main entry points: [`api/src/routes/index.ts`](https://github.com/moladev20/rentalps/blob/master/api/src/routes/index.ts) (API routes), [`api/src/lib/prisma.ts`](https://github.com/moladev20/rentalps/blob/master/api/src/lib/prisma.ts) (Prisma client), [`client/src/App.vue`](https://github.com/moladev20/rentalps/blob/master/client/src/App.vue) (Rental POS UI), [`api/src/controllers/transaction/payment.controller.ts`](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/payment.controller.ts) (Payment processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Administrator client"]
  node_webapp["Rental POS UI<br/>[App.vue]"]
  node_rentalui["Create rental<br/>[index.vue]"]
  node_sessiondraft["Session draft"]
  node_detailui["Active rental detail<br/>[index.vue]"]
  node_reportui["Reports UI"]
  node_axios["HTTP client<br/>[axios.ts]"]
end

subgraph group_api["API runtime"]
  node_app["Express app<br/>[app.ts]"]
  node_routes["API routes<br/>[index.ts]"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("Rental database")]
end

subgraph group_domain["Rental operations"]
  node_units["Unit management<br/>[unit.controller.ts]"]
  node_fnb["FnB catalog<br/>[fnb.controller.ts]"]
  node_orders["Rental orders"]
  node_fnborders["Order FnB"]
  node_payments["Payment processing"]
end

subgraph group_insights["Access and reports"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_history["Transaction history"]
  node_financials["Financial statements"]
end

node_admin(("Administrator"))
node_midtrans["Midtrans Snap"]

node_admin -->|"uses"| node_webapp
node_webapp -->|"opens"| node_rentalui
node_webapp -->|"opens"| node_detailui
node_webapp -->|"opens"| node_reportui
node_rentalui -->|"collects inputs"| node_sessiondraft
node_sessiondraft -->|"posts order"| node_axios
node_detailui -->|"manages order"| node_axios
node_reportui -->|"requests reports"| node_axios
node_axios -->|"HTTP requests"| node_app
node_app -->|"dispatches"| node_routes
node_routes -->|"routes auth"| node_auth
node_routes -->|"routes units"| node_units
node_routes -->|"routes catalog"| node_fnb
node_routes -->|"routes rentals"| node_orders
node_routes -->|"routes FnB orders"| node_fnborders
node_routes -->|"routes payments"| node_payments
node_routes -->|"routes history"| node_history
node_routes -->|"routes reports"| node_financials
node_auth -->|"reads/writes tokens"| node_prisma
node_units -->|"reads/writes units"| node_prisma
node_fnb -->|"reads/writes catalog"| node_prisma
node_orders -->|"creates rental"| node_prisma
node_fnborders -->|"updates order items"| node_prisma
node_payments -->|"records payment"| node_prisma
node_payments -.->|"creates QRIS"| node_midtrans
node_midtrans -.->|"sends notification"| node_payments
node_history -->|"reads history"| node_prisma
node_financials -->|"queries totals"| node_prisma
node_prisma -->|"queries data"| node_database

click node_webapp "https://github.com/moladev20/rentalps/blob/master/client/src/App.vue"
click node_rentalui "https://github.com/moladev20/rentalps/blob/master/client/src/pages/new-rental/index.vue"
click node_sessiondraft "https://github.com/moladev20/rentalps/blob/master/client/src/pages/new-rental/composables/usePlaySessionDraft.ts"
click node_detailui "https://github.com/moladev20/rentalps/blob/master/client/src/pages/rental-detail/index.vue"
click node_reportui "https://github.com/moladev20/rentalps/blob/master/client/src/pages/FinancialStatements.vue"
click node_axios "https://github.com/moladev20/rentalps/blob/master/client/src/helper/axios.ts"
click node_app "https://github.com/moladev20/rentalps/blob/master/api/src/app.ts"
click node_routes "https://github.com/moladev20/rentalps/blob/master/api/src/routes/index.ts"
click node_auth "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/auth.controller.ts"
click node_units "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/unit.controller.ts"
click node_fnb "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/fnb.controller.ts"
click node_orders "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/orders/order.controller.ts"
click node_fnborders "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/orders/orderedFnB.controller.ts"
click node_payments "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/payment.controller.ts"
click node_history "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/transaction.controller.ts"
click node_financials "https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/transactionReport.controller.ts"
click node_prisma "https://github.com/moladev20/rentalps/blob/master/api/src/lib/prisma.ts"

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_webapp,node_rentalui,node_sessiondraft,node_detailui,node_reportui,node_axios toneBlue
class node_app,node_routes,node_prisma,node_database toneAmber
class node_units,node_fnb,node_orders,node_fnborders,node_payments toneMint
class node_auth,node_history,node_financials toneRose
class node_admin,node_midtrans toneIndigo
```

## Components

### Administrator client

- [Rental POS UI](https://github.com/moladev20/rentalps/blob/master/client/src/App.vue): `client/src/App.vue`
- [Create rental](https://github.com/moladev20/rentalps/blob/master/client/src/pages/new-rental/index.vue): `client/src/pages/new-rental/index.vue`
- [Session draft](https://github.com/moladev20/rentalps/blob/master/client/src/pages/new-rental/composables/usePlaySessionDraft.ts): `client/src/pages/new-rental/composables/usePlaySessionDraft.ts`
- [Active rental detail](https://github.com/moladev20/rentalps/blob/master/client/src/pages/rental-detail/index.vue): `client/src/pages/rental-detail/index.vue`
- [Reports UI](https://github.com/moladev20/rentalps/blob/master/client/src/pages/FinancialStatements.vue): `client/src/pages/FinancialStatements.vue`
- [HTTP client](https://github.com/moladev20/rentalps/blob/master/client/src/helper/axios.ts): `client/src/helper/axios.ts`

### API runtime

- [Express app](https://github.com/moladev20/rentalps/blob/master/api/src/app.ts): `api/src/app.ts`
- [API routes](https://github.com/moladev20/rentalps/blob/master/api/src/routes/index.ts): `api/src/routes/index.ts`
- [Prisma client](https://github.com/moladev20/rentalps/blob/master/api/src/lib/prisma.ts): `api/src/lib/prisma.ts`
- **Rental database**

### Rental operations

- [Unit management](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/unit.controller.ts): `api/src/controllers/unit.controller.ts`
- [FnB catalog](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/fnb.controller.ts): `api/src/controllers/fnb.controller.ts`
- [Rental orders](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/orders/order.controller.ts): `api/src/controllers/orders/order.controller.ts`
- [Order FnB](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/orders/orderedFnB.controller.ts): `api/src/controllers/orders/orderedFnB.controller.ts`
- [Payment processing](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/payment.controller.ts): `api/src/controllers/transaction/payment.controller.ts`

### Access and reports

- [Authentication](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/auth.controller.ts): `api/src/controllers/auth.controller.ts`
- [Transaction history](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/transaction.controller.ts): `api/src/controllers/transaction/transaction.controller.ts`
- [Financial statements](https://github.com/moladev20/rentalps/blob/master/api/src/controllers/transaction/transactionReport.controller.ts): `api/src/controllers/transaction/transactionReport.controller.ts`

### Other components

- **Administrator**
- **Midtrans Snap**

## Connections

- Administrator → Rental POS UI: uses
- Rental POS UI → Create rental: opens
- Rental POS UI → Active rental detail: opens
- Rental POS UI → Reports UI: opens
- Create rental → Session draft: collects inputs
- Session draft → HTTP client: posts order
- Active rental detail → HTTP client: manages order
- Reports UI → HTTP client: requests reports
- HTTP client → Express app: HTTP requests
- Express app → API routes: dispatches
- API routes → Authentication: routes auth
- API routes → Unit management: routes units
- API routes → FnB catalog: routes catalog
- API routes → Rental orders: routes rentals
- API routes → Order FnB: routes FnB orders
- API routes → Payment processing: routes payments
- API routes → Transaction history: routes history
- API routes → Financial statements: routes reports
- Authentication → Prisma client: reads/writes tokens
- Unit management → Prisma client: reads/writes units
- FnB catalog → Prisma client: reads/writes catalog
- Rental orders → Prisma client: creates rental
- Order FnB → Prisma client: updates order items
- Payment processing → Prisma client: records payment
- Payment processing → Midtrans Snap: creates QRIS
- Midtrans Snap → Payment processing: sends notification
- Transaction history → Prisma client: reads history
- Financial statements → Prisma client: queries totals
- Prisma client → Rental database: queries data
