# uhhhewankowalaakongmaisip/bettermvc architecture

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

- Interactive diagram: https://gitdiagram.com/uhhhewankowalaakongmaisip/bettermvc
- Repository: https://github.com/uhhhewankowalaakongmaisip/bettermvc

## Overview

bettermvc is an ASP.NET Core staycation-management web app. Guests can browse property units, while administrators and infodesk staff manage units; the app also includes identity, booking/document/approval domain models, and a PayMongo test-checkout flow. The sampled controllers establish unit browsing and staff CRUD, and the payment controller delegates checkout creation to the PayMongo service. Booking, guest-document, and approval models are represented in the data layer, but no corresponding workflow controllers were shown, so their runtime links are omitted. The README provides no further capability detail.

Main entry points: [`Data/ApplicationDbContext.cs`](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Data/ApplicationDbContext.cs) (Persistence context), [`Models/PropertyUnits.cs`](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/PropertyUnits.cs) (Property units), [`Models/Bookings.cs`](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Bookings.cs) (Bookings), [`Services/PayMongoService.cs`](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Services/PayMongoService.cs) (Checkout service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest browsing"]
  node_guest_units["Browse units<br/>[GuestController.cs]"]
  node_payment["Payment flow"]
  node_paymongo_service["Checkout service<br/>[PayMongoService.cs]"]
end

subgraph group_operations["Staff operations"]
  node_admin["Admin management<br/>[AdminController.cs]"]
  node_infodesk["Infodesk management"]
  node_image_files["Unit images"]
end

subgraph group_domain["Stay domain"]
  node_units["Property units<br/>[PropertyUnits.cs]"]
  node_bookings["Bookings<br/>[Bookings.cs]"]
  node_accounts["Accounts<br/>[Accounts.cs]"]
  node_guest_documents["Guest documents<br/>[GuessDocuments.cs]"]
  node_pmo_approval["PMO approvals<br/>[PMO_Approval.cs]"]
  node_addons["Add-ons<br/>[Addons.cs]"]
  node_payment_model["Payment model<br/>[Payment.cs]"]
end

subgraph group_platform["App platform"]
  node_db_context["Persistence context"]
  node_sqlite[("SQLite database<br/>[app.db]")]
  node_app["Web app setup<br/>[Program.cs]"]
  node_home["Home pages<br/>[HomeController.cs]"]
  node_error_model["Error view model<br/>[ErrorViewModel.cs]"]
end

node_guest_actor(("Guest"))
node_paymongo(("PayMongo"))

node_guest_actor -->|"browses"| node_guest_units
node_guest_units -->|"reads"| node_units
node_admin -->|"manages"| node_units
node_admin -->|"manages"| node_accounts
node_infodesk -->|"manages"| node_units
node_infodesk -->|"saves"| node_image_files
node_payment -->|"requests checkout"| node_paymongo_service
node_paymongo_service -->|"creates session"| node_paymongo
node_payment -->|"redirects guest"| node_paymongo
node_app -->|"configures"| node_db_context
node_app -->|"registers"| node_paymongo_service
node_db_context -->|"uses"| node_sqlite
node_db_context -->|"stores"| node_accounts
node_db_context -->|"stores"| node_units
node_db_context -->|"stores"| node_bookings
node_db_context -->|"stores"| node_guest_documents
node_db_context -->|"stores"| node_pmo_approval
node_bookings -->|"references guest"| node_accounts
node_bookings -->|"references unit"| node_units
node_home -->|"creates"| node_error_model

click node_guest_units "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/GuestController.cs"
click node_admin "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/AdminController.cs"
click node_infodesk "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/InfodeskController.cs"
click node_image_files "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/InfodeskController.cs"
click node_payment "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/PaymentController.cs"
click node_paymongo_service "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Services/PayMongoService.cs"
click node_units "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/PropertyUnits.cs"
click node_bookings "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Bookings.cs"
click node_accounts "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Accounts.cs"
click node_guest_documents "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/GuessDocuments.cs"
click node_pmo_approval "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/PMO_Approval.cs"
click node_addons "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Addons.cs"
click node_payment_model "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Payment.cs"
click node_db_context "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Data/ApplicationDbContext.cs"
click node_sqlite "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/app.db"
click node_app "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Program.cs"
click node_home "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/HomeController.cs"
click node_error_model "https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/ErrorViewModel.cs"

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_guest_units,node_payment,node_paymongo_service toneBlue
class node_admin,node_infodesk,node_image_files toneAmber
class node_units,node_bookings,node_accounts,node_guest_documents,node_pmo_approval,node_addons,node_payment_model toneMint
class node_db_context,node_sqlite,node_app,node_home,node_error_model toneRose
class node_guest_actor,node_paymongo toneIndigo
```

## Components

### Guest browsing

- [Browse units](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/GuestController.cs): `Controllers/GuestController.cs`
- [Payment flow](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/PaymentController.cs): `Controllers/PaymentController.cs`
- [Checkout service](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Services/PayMongoService.cs): `Services/PayMongoService.cs`

### Staff operations

- [Admin management](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/AdminController.cs): `Controllers/AdminController.cs`
- [Infodesk management](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/InfodeskController.cs): `Controllers/InfodeskController.cs`
- [Unit images](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/InfodeskController.cs): `Controllers/InfodeskController.cs`

### Stay domain

- [Property units](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/PropertyUnits.cs): `Models/PropertyUnits.cs`
- [Bookings](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Bookings.cs): `Models/Bookings.cs`
- [Accounts](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Accounts.cs): `Models/Accounts.cs`
- [Guest documents](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/GuessDocuments.cs): `Models/GuessDocuments.cs`
- [PMO approvals](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/PMO_Approval.cs): `Models/PMO_Approval.cs`
- [Add-ons](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Addons.cs): `Models/Addons.cs`
- [Payment model](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/Payment.cs): `Models/Payment.cs`

### App platform

- [Persistence context](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Data/ApplicationDbContext.cs): `Data/ApplicationDbContext.cs`
- [SQLite database](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/app.db): `app.db`
- [Web app setup](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Program.cs): `Program.cs`
- [Home pages](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Controllers/HomeController.cs): `Controllers/HomeController.cs`
- [Error view model](https://github.com/uhhhewankowalaakongmaisip/bettermvc/blob/main/Models/ErrorViewModel.cs): `Models/ErrorViewModel.cs`

### Other components

- **Guest**
- **PayMongo**

## Connections

- Guest → Browse units: browses (evidence: `Controllers/GuestController.cs`)
- Browse units → Property units: reads (evidence: `Controllers/GuestController.cs`)
- Admin management → Property units: manages (evidence: `Controllers/AdminController.cs`)
- Admin management → Accounts: manages (evidence: `Controllers/AdminController.cs`)
- Infodesk management → Property units: manages (evidence: `Controllers/InfodeskController.cs`)
- Infodesk management → Unit images: saves (evidence: `Controllers/InfodeskController.cs`)
- Payment flow → Checkout service: requests checkout (evidence: `Controllers/PaymentController.cs`)
- Checkout service → PayMongo: creates session (evidence: `Services/PayMongoService.cs`)
- Payment flow → PayMongo: redirects guest (evidence: `Controllers/PaymentController.cs`)
- Web app setup → Persistence context: configures (evidence: `Program.cs`)
- Web app setup → Checkout service: registers (evidence: `Program.cs`)
- Persistence context → SQLite database: uses
- Persistence context → Accounts: stores (evidence: `Data/ApplicationDbContext.cs`)
- Persistence context → Property units: stores (evidence: `Data/ApplicationDbContext.cs`)
- Persistence context → Bookings: stores (evidence: `Data/ApplicationDbContext.cs`)
- Persistence context → Guest documents: stores (evidence: `Data/ApplicationDbContext.cs`)
- Persistence context → PMO approvals: stores (evidence: `Data/ApplicationDbContext.cs`)
- Bookings → Accounts: references guest (evidence: `Models/Bookings.cs`)
- Bookings → Property units: references unit (evidence: `Models/Bookings.cs`)
- Home pages → Error view model: creates (evidence: `Controllers/HomeController.cs`)
