# nhapthan58-design/rapphim architecture

> Architecture diagram of the GitHub repository nhapthan58-design/rapphim, 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/nhapthan58-design/rapphim
- Repository: https://github.com/nhapthan58-design/rapphim

## Overview

RapPhim is a Windows Forms cinema showtime scheduler. Users open the scheduling form to create or edit a screening; the service validates time and room conflicts, then the data manager persists and reloads schedules. Users can also browse schedules in table or timeline form and copy a day’s schedule. Ticket-sales support is exposed as a service API. The README is empty, so capabilities and relationships here are based on the supplied source excerpts and SOURCE INDEX; configuration details are represented by the existing data directory.

Main entry points: [`RapPhim/Services/LichChieuService.cs`](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/LichChieuService.cs) (Schedule rules and operations), [`RapPhim/FormDanhSachLich.cs`](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormDanhSachLich.cs) (Schedule browser), [`RapPhim/Data/DataManager.cs`](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/DataManager.cs) (Data manager), [`RapPhim/FormXepLich.cs`](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormXepLich.cs) (Schedule editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Desktop interface"]
  node_startup["Application startup<br/>[Program.cs]"]
  node_home["Main menu<br/>[Form1.cs]"]
  node_schedule_form["Schedule editor<br/>[FormXepLich.cs]"]
  node_list_form["Schedule browser"]
  node_copy_form["Day copy dialog<br/>[FormSaoChepLich.cs]"]
  node_timeline["Day timeline"]
end

subgraph group_domain["Scheduling domain"]
  node_showtime_service["Schedule rules and operations"]
  node_schedule_result["Operation results<br/>[KetQua.cs]"]
  node_copy_result["Copy results<br/>[KetQuaSaoChep.cs]"]
  node_showtime["Showtime record<br/>[LichChieu.cs]"]
  node_showtime_view["Schedule view model"]
  node_movie["Movie catalog item<br/>[Phim.cs]"]
  node_room["Screening room<br/>[PhongChieu.cs]"]
end

subgraph group_data["Data access"]
  node_data_manager["Data manager<br/>[DataManager.cs]"]
  node_repository_contract["Schedule repository contract"]
  node_json_repository[("JSON schedule store")]
  node_catalog_contract["Catalog provider contract"]
  node_sample_catalog["Sample catalog provider"]
  node_ticket_contract["Ticket count provider"]
  node_ticket_counter["Ticket count provider"]
  node_storage_config["Storage configuration<br/>[CauHinhLuuTru.cs]"]
end

node_user(("Cinema staff"))
node_ticket_client(("Ticket module"))

node_startup -->|"starts"| node_home
node_user -.->|"uses"| node_home
node_home -->|"opens"| node_schedule_form
node_home -->|"opens"| node_list_form
node_schedule_form -->|"loads catalog"| node_data_manager
node_schedule_form -->|"checks and saves"| node_showtime_service
node_schedule_form -->|"opens browser"| node_list_form
node_list_form -->|"loads schedules"| node_data_manager
node_list_form -->|"builds views"| node_showtime_view
node_list_form -->|"updates timeline"| node_timeline
node_list_form -->|"edits selection"| node_schedule_form
node_list_form -->|"opens copy dialog"| node_copy_form
node_copy_form -->|"copies schedule"| node_showtime_service
node_copy_form -->|"reloads data"| node_data_manager
node_timeline -->|"reads clock"| node_showtime_service
node_showtime_service -->|"reads and reloads"| node_data_manager
node_showtime_service -->|"returns result"| node_schedule_result
node_showtime_service -->|"returns copy result"| node_copy_result
node_showtime_service -->|"validates and updates"| node_showtime
node_ticket_client -.->|"records sales"| node_showtime_service
node_data_manager -->|"uses repository"| node_repository_contract
node_data_manager -->|"loads catalog"| node_catalog_contract
node_data_manager -->|"configures provider"| node_ticket_contract
node_storage_config -->|"configures"| node_json_repository
node_storage_config -->|"configures"| node_sample_catalog
node_storage_config -->|"configures"| node_ticket_counter
node_json_repository -->|"implements"| node_repository_contract
node_sample_catalog -->|"implements"| node_catalog_contract
node_ticket_counter -->|"implements"| node_ticket_contract
node_catalog_contract -->|"provides"| node_movie
node_catalog_contract -->|"provides"| node_room

click node_startup "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Program.cs"
click node_home "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Form1.cs"
click node_schedule_form "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormXepLich.cs"
click node_list_form "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormDanhSachLich.cs"
click node_copy_form "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormSaoChepLich.cs"
click node_timeline "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/UI/TimelineLichChieu.cs"
click node_showtime_service "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/LichChieuService.cs"
click node_schedule_result "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/KetQua.cs"
click node_copy_result "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/KetQuaSaoChep.cs"
click node_showtime "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/LichChieu.cs"
click node_showtime_view "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/LichChieuViewModel.cs"
click node_movie "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/Phim.cs"
click node_room "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/PhongChieu.cs"
click node_data_manager "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/DataManager.cs"
click node_repository_contract "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/ILichChieuRepository.cs"
click node_json_repository "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/JsonLichChieuRepository.cs"
click node_catalog_contract "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/IDanhMucProvider.cs"
click node_sample_catalog "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/MauDanhMucProvider.cs"
click node_ticket_contract "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/IVeDaBanProvider.cs"
click node_ticket_counter "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/BoDemVeDaBanProvider.cs"
click node_storage_config "https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/CauHinhLuuTru.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_startup,node_home,node_schedule_form,node_list_form,node_copy_form,node_timeline toneBlue
class node_showtime_service,node_schedule_result,node_copy_result,node_showtime,node_showtime_view,node_movie,node_room toneAmber
class node_data_manager,node_repository_contract,node_json_repository,node_catalog_contract,node_sample_catalog,node_ticket_contract,node_ticket_counter,node_storage_config toneMint
class node_user,node_ticket_client toneIndigo
```

## Components

### Desktop interface

- [Application startup](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Program.cs): `RapPhim/Program.cs`
- [Main menu](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Form1.cs): `RapPhim/Form1.cs`
- [Schedule editor](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormXepLich.cs): `RapPhim/FormXepLich.cs`
- [Schedule browser](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormDanhSachLich.cs): `RapPhim/FormDanhSachLich.cs`
- [Day copy dialog](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/FormSaoChepLich.cs): `RapPhim/FormSaoChepLich.cs`
- [Day timeline](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/UI/TimelineLichChieu.cs): `RapPhim/UI/TimelineLichChieu.cs`

### Scheduling domain

- [Schedule rules and operations](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/LichChieuService.cs): `RapPhim/Services/LichChieuService.cs`
- [Operation results](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/KetQua.cs): `RapPhim/Services/KetQua.cs`
- [Copy results](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Services/KetQuaSaoChep.cs): `RapPhim/Services/KetQuaSaoChep.cs`
- [Showtime record](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/LichChieu.cs): `RapPhim/Models/LichChieu.cs`
- [Schedule view model](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/LichChieuViewModel.cs): `RapPhim/Models/LichChieuViewModel.cs`
- [Movie catalog item](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/Phim.cs): `RapPhim/Models/Phim.cs`
- [Screening room](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Models/PhongChieu.cs): `RapPhim/Models/PhongChieu.cs`

### Data access

- [Data manager](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/DataManager.cs): `RapPhim/Data/DataManager.cs`
- [Schedule repository contract](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/ILichChieuRepository.cs): `RapPhim/Data/ILichChieuRepository.cs`
- [JSON schedule store](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/JsonLichChieuRepository.cs): `RapPhim/Data/JsonLichChieuRepository.cs`
- [Catalog provider contract](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/IDanhMucProvider.cs): `RapPhim/Data/IDanhMucProvider.cs`
- [Sample catalog provider](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/MauDanhMucProvider.cs): `RapPhim/Data/MauDanhMucProvider.cs`
- [Ticket count provider](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/IVeDaBanProvider.cs): `RapPhim/Data/IVeDaBanProvider.cs`
- [Ticket count provider](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/BoDemVeDaBanProvider.cs): `RapPhim/Data/BoDemVeDaBanProvider.cs`
- [Storage configuration](https://github.com/nhapthan58-design/rapphim/blob/master/RapPhim/Data/CauHinhLuuTru.cs): `RapPhim/Data/CauHinhLuuTru.cs`

### Other components

- **Cinema staff**
- **Ticket module**

## Connections

- Application startup → Main menu: starts (evidence: `RapPhim/Program.cs`)
- Cinema staff → Main menu: uses
- Main menu → Schedule editor: opens (evidence: `RapPhim/Form1.cs`)
- Main menu → Schedule browser: opens (evidence: `RapPhim/Form1.cs`)
- Schedule editor → Data manager: loads catalog (evidence: `RapPhim/FormXepLich.cs`)
- Schedule editor → Schedule rules and operations: checks and saves (evidence: `RapPhim/FormXepLich.cs`)
- Schedule editor → Schedule browser: opens browser (evidence: `RapPhim/FormXepLich.cs`)
- Schedule browser → Data manager: loads schedules (evidence: `RapPhim/FormDanhSachLich.cs`)
- Schedule browser → Schedule view model: builds views (evidence: `RapPhim/FormDanhSachLich.cs`)
- Schedule browser → Day timeline: updates timeline (evidence: `RapPhim/FormDanhSachLich.cs`)
- Schedule browser → Schedule editor: edits selection (evidence: `RapPhim/FormDanhSachLich.cs`)
- Schedule browser → Day copy dialog: opens copy dialog (evidence: `RapPhim/FormDanhSachLich.cs`)
- Day copy dialog → Schedule rules and operations: copies schedule (evidence: `RapPhim/FormSaoChepLich.cs`)
- Day copy dialog → Data manager: reloads data (evidence: `RapPhim/FormSaoChepLich.cs`)
- Day timeline → Schedule rules and operations: reads clock (evidence: `RapPhim/UI/TimelineLichChieu.cs`)
- Schedule rules and operations → Data manager: reads and reloads (evidence: `RapPhim/Services/LichChieuService.cs`)
- Schedule rules and operations → Operation results: returns result (evidence: `RapPhim/Services/LichChieuService.cs`)
- Schedule rules and operations → Copy results: returns copy result (evidence: `RapPhim/Services/LichChieuService.cs`)
- Schedule rules and operations → Showtime record: validates and updates (evidence: `RapPhim/Services/LichChieuService.cs`)
- Ticket module → Schedule rules and operations: records sales
- Data manager → Schedule repository contract: uses repository (evidence: `RapPhim/Data/DataManager.cs`)
- Data manager → Catalog provider contract: loads catalog (evidence: `RapPhim/Data/DataManager.cs`)
- Data manager → Ticket count provider: configures provider (evidence: `RapPhim/Data/DataManager.cs`)
- Storage configuration → JSON schedule store: configures (evidence: `RapPhim/Data/CauHinhLuuTru.cs`)
- Storage configuration → Sample catalog provider: configures (evidence: `RapPhim/Data/CauHinhLuuTru.cs`)
- Storage configuration → Ticket count provider: configures (evidence: `RapPhim/Data/CauHinhLuuTru.cs`)
- JSON schedule store → Schedule repository contract: implements (evidence: `RapPhim/Data/JsonLichChieuRepository.cs`)
- Sample catalog provider → Catalog provider contract: implements (evidence: `RapPhim/Data/MauDanhMucProvider.cs`)
- Ticket count provider → Ticket count provider: implements (evidence: `RapPhim/Data/BoDemVeDaBanProvider.cs`)
- Catalog provider contract → Movie catalog item: provides (evidence: `RapPhim/Data/IDanhMucProvider.cs`)
- Catalog provider contract → Screening room: provides (evidence: `RapPhim/Data/IDanhMucProvider.cs`)
