# kimthuyveng20/rental-room architecture

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

- Interactive diagram: https://gitdiagram.com/kimthuyveng20/rental-room
- Repository: https://github.com/kimthuyveng20/rental-room

## Overview

RoomFlow is a property-management application: owners and administrators manage properties, rooms, tenants, and leases; billing covers invoices and payments, while tenants and managers can handle maintenance requests. Its Next.js dashboard and API routes sit over a PostgreSQL-backed data model, with authentication and file/email services supporting the workflows. The README is only the generic Next.js starter README, so product capabilities are inferred from the repository tree and sampled source; unsampled page-to-API relationships are not asserted.

Main entry points: [`src/lib/db/index.ts`](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/db/index.ts) (Database Access), [`src/lib/auth.ts`](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/auth.ts) (Auth Configuration), [`src/lib/services/email.service.ts`](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/services/email.service.ts) (Verification Email), [`src/app/api/properties/route.ts`](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/properties/route.ts) (Property Management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_auth["Identity"]
  node_authconfig["Auth Configuration<br/>[auth.ts]"]
  node_authroutes["Auth Routes<br/>[route.ts]"]
  node_register["Registration<br/>[route.ts]"]
  node_email["Verification Email<br/>[email.service.ts]"]
end

subgraph group_operations["Property Operations"]
  node_properties["Property Management<br/>[route.ts]"]
  node_rooms["Room Management<br/>[route.ts]"]
  node_tenants["Tenant Management<br/>[route.ts]"]
  node_leases["Lease Management<br/>[route.ts]"]
  node_maintenanceui["Maintenance Interface"]
  node_maintenanceaction["Maintenance Actions<br/>[maintenance.ts]"]
  node_maintenancepage["Maintenance Page<br/>[page.tsx]"]
  node_dashboardui["Dashboard Interface"]
  node_dashboardpage["Dashboard Page<br/>[page.tsx]"]
  node_dashboardroute["Dashboard API<br/>[route.ts]"]
  node_dashboardaction["Dashboard Actions<br/>[dashboard.ts]"]
end

subgraph group_billing["Billing"]
  node_invoices["Invoice Management<br/>[route.ts]"]
  node_payments["Payment Management<br/>[route.ts]"]
  node_paymentwebhook["ABA Webhook<br/>[route.ts]"]
end

subgraph group_platform["Shared Platform"]
  node_schema["Domain Schema<br/>[schema.ts]"]
  node_database[("Database Access<br/>[index.ts]")]
  node_s3service["File Storage Service<br/>[s3.service.ts]"]
end

node_user(("User"))
node_objectstore[("AWS S3")]
node_smtp["Email Service"]
node_google["Google Sign-In"]

node_user -->|"signs in"| node_authroutes
node_authconfig -->|"configures adapter"| node_database
node_authconfig -->|"offers sign-in"| node_google
node_register -->|"sends code"| node_email
node_user -.->|"manages"| node_properties
node_user -.->|"manages"| node_rooms
node_user -->|"manages"| node_tenants
node_user -.->|"manages"| node_leases
node_maintenancepage -.->|"renders"| node_maintenanceui
node_maintenanceui -->|"submits request"| node_maintenanceaction
node_dashboardpage -.->|"renders"| node_dashboardui
node_dashboardroute -->|"delegates to"| node_dashboardaction
node_user -.->|"requests billing"| node_invoices
node_user -.->|"records payment"| node_payments
node_user -.->|"initiates payment"| node_paymentwebhook
node_authconfig -->|"queries users"| node_schema
node_database -->|"loads schema"| node_schema
node_properties -->|"reads and writes"| node_database
node_rooms -->|"reads and writes"| node_database
node_tenants -->|"reads and writes"| node_database
node_leases -->|"reads and writes"| node_database
node_invoices -->|"reads and writes"| node_database
node_payments -->|"reads and writes"| node_database
node_maintenanceaction -->|"reads and writes"| node_database
node_dashboardaction -->|"reads data"| node_database
node_s3service -->|"uploads objects"| node_objectstore
node_email -->|"sends mail"| node_smtp

click node_authconfig "https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/auth.ts"
click node_authroutes "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_register "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/auth/register/route.ts"
click node_email "https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/services/email.service.ts"
click node_properties "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/properties/route.ts"
click node_rooms "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/rooms/route.ts"
click node_tenants "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/tenants/route.ts"
click node_leases "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/leases/route.ts"
click node_maintenanceui "https://github.com/kimthuyveng20/rental-room/blob/master/src/components/maintenance-client.tsx"
click node_maintenanceaction "https://github.com/kimthuyveng20/rental-room/blob/master/src/actions/maintenance.ts"
click node_maintenancepage "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/dashboard/maintenance/page.tsx"
click node_dashboardui "https://github.com/kimthuyveng20/rental-room/blob/master/src/components/dashboard-layout.tsx"
click node_dashboardpage "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/dashboard/page.tsx"
click node_dashboardroute "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/dashboard/route.ts"
click node_dashboardaction "https://github.com/kimthuyveng20/rental-room/blob/master/src/actions/dashboard.ts"
click node_invoices "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/invoices/route.ts"
click node_payments "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/payments/route.ts"
click node_paymentwebhook "https://github.com/kimthuyveng20/rental-room/blob/master/src/app/dashboard/payments/aba/webhook/route.ts"
click node_schema "https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/db/schema.ts"
click node_database "https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/db/index.ts"
click node_s3service "https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/services/s3.service.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_authconfig,node_authroutes,node_register,node_email,node_user toneBlue
class node_properties,node_rooms,node_tenants,node_leases,node_maintenanceui,node_maintenanceaction,node_maintenancepage,node_dashboardui,node_dashboardpage,node_dashboardroute,node_dashboardaction,node_objectstore toneAmber
class node_invoices,node_payments,node_paymentwebhook toneMint
class node_schema,node_database,node_s3service toneRose
class node_smtp,node_google toneIndigo
```

## Components

### Identity

- [Auth Configuration](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/auth.ts): `src/lib/auth.ts`
- [Auth Routes](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- [Registration](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/auth/register/route.ts): `src/app/api/auth/register/route.ts`
- [Verification Email](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/services/email.service.ts): `src/lib/services/email.service.ts`

### Property Operations

- [Property Management](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/properties/route.ts): `src/app/api/properties/route.ts`
- [Room Management](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/rooms/route.ts): `src/app/api/rooms/route.ts`
- [Tenant Management](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/tenants/route.ts): `src/app/api/tenants/route.ts`
- [Lease Management](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/leases/route.ts): `src/app/api/leases/route.ts`
- [Maintenance Interface](https://github.com/kimthuyveng20/rental-room/blob/master/src/components/maintenance-client.tsx): `src/components/maintenance-client.tsx`
- [Maintenance Actions](https://github.com/kimthuyveng20/rental-room/blob/master/src/actions/maintenance.ts): `src/actions/maintenance.ts`
- [Maintenance Page](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/dashboard/maintenance/page.tsx): `src/app/dashboard/maintenance/page.tsx`
- [Dashboard Interface](https://github.com/kimthuyveng20/rental-room/blob/master/src/components/dashboard-layout.tsx): `src/components/dashboard-layout.tsx`
- [Dashboard Page](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Dashboard API](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/dashboard/route.ts): `src/app/api/dashboard/route.ts`
- [Dashboard Actions](https://github.com/kimthuyveng20/rental-room/blob/master/src/actions/dashboard.ts): `src/actions/dashboard.ts`

### Billing

- [Invoice Management](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/invoices/route.ts): `src/app/api/invoices/route.ts`
- [Payment Management](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/api/payments/route.ts): `src/app/api/payments/route.ts`
- [ABA Webhook](https://github.com/kimthuyveng20/rental-room/blob/master/src/app/dashboard/payments/aba/webhook/route.ts): `src/app/dashboard/payments/aba/webhook/route.ts`

### Shared Platform

- [Domain Schema](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/db/schema.ts): `src/lib/db/schema.ts`
- [Database Access](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/db/index.ts): `src/lib/db/index.ts`
- [File Storage Service](https://github.com/kimthuyveng20/rental-room/blob/master/src/lib/services/s3.service.ts): `src/lib/services/s3.service.ts`

### Other components

- **User**
- **AWS S3**
- **Email Service**
- **Google Sign-In**

## Connections

- User → Auth Routes: signs in
- Auth Configuration → Database Access: configures adapter (evidence: `src/lib/auth.ts`)
- Auth Configuration → Google Sign-In: offers sign-in (evidence: `src/lib/auth.ts`)
- Registration → Verification Email: sends code (evidence: `src/app/api/auth/register/route.ts`)
- User → Property Management: manages
- User → Room Management: manages
- User → Tenant Management: manages (evidence: `src/app/api/tenants/route.ts`)
- User → Lease Management: manages
- Maintenance Page → Maintenance Interface: renders
- Maintenance Interface → Maintenance Actions: submits request (evidence: `src/components/maintenance-client.tsx`)
- Dashboard Page → Dashboard Interface: renders
- Dashboard API → Dashboard Actions: delegates to (evidence: `src/app/api/dashboard/route.ts`)
- User → Invoice Management: requests billing
- User → Payment Management: records payment
- User → ABA Webhook: initiates payment
- Auth Configuration → Domain Schema: queries users (evidence: `src/lib/auth.ts`)
- Database Access → Domain Schema: loads schema (evidence: `src/lib/db/index.ts`)
- Property Management → Database Access: reads and writes (evidence: `src/app/api/properties/route.ts`)
- Room Management → Database Access: reads and writes (evidence: `src/app/api/rooms/route.ts`)
- Tenant Management → Database Access: reads and writes (evidence: `src/app/api/tenants/route.ts`)
- Lease Management → Database Access: reads and writes (evidence: `src/app/api/leases/route.ts`)
- Invoice Management → Database Access: reads and writes (evidence: `src/app/api/invoices/route.ts`)
- Payment Management → Database Access: reads and writes (evidence: `src/app/api/payments/route.ts`)
- Maintenance Actions → Database Access: reads and writes (evidence: `src/actions/maintenance.ts`)
- Dashboard Actions → Database Access: reads data (evidence: `src/actions/dashboard.ts`)
- File Storage Service → AWS S3: uploads objects (evidence: `src/lib/services/s3.service.ts`)
- Verification Email → Email Service: sends mail (evidence: `src/lib/services/email.service.ts`)
