# malikkurosaki/phis_mobile architecture

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

- Interactive diagram: https://gitdiagram.com/malikkurosaki/phis_mobile
- Repository: https://github.com/malikkurosaki/phis_mobile

## Overview

1. This is a Flutter client application named `probus_mobile`, built to run across Android, iOS, web, and macOS. The repository is mostly a frontend app plus its platform shells; there is no backend service code here.

2. The main app entrypoint is `lib/main.dart`. Shared app-wide concerns appear to live in `lib/store.dart` and `lib/tema.dart`, which likely provide global state and theming used by multiple screens.

3. The codebase is split into two major business domains:
   - `components_phis` / `models_phis` for a hotel/property-operations workflow
   - `components_presto` / `models_presto` for a restaurant/F&B workflow
   This split is one of the clearest architectural boundaries in the repo.

4. The UI/navigation layer lives under `lib/views`. The visible app surfaces include `login.dart`, `home.dart`, `hotel.dart`, and `restaurant.dart`, which likely act as top-level routes or section launchers into the two business domains.

5. The hotel/PHIS feature set includes operational dashboards and daily status views: arrivals, departures, in-house guests, next-day variants, reservations, forecast occupancy, and room production by geography. The corresponding models mirror those screens, suggesting a fairly direct mapping from API payloads to display components.

6. The restaurant/Presto feature set centers on analytics and reporting: daily revenue, home index, payment breakdowns, product sales, sales performance, sales traffic, transaction summary, and various sales-analysis screens. There is also a `master` subfolder with reference-data screens such as outlet, department, date, type, and product group.

7. Calendar-specific functionality is isolated in `lib/model_calendar` and `lib/views/calendar_*`. The presence of booking/room-type models suggests a booking/calendar workflow separate from the hotel and restaurant dashboards.

8. The network/data layer is concentrated in `lib/rest_api.dart` plus the response wrappers `rest_response_restaurant.dart`, `rest_restponse_calendar.dart`, and `rest_restponse_phis.dart`. These files likely normalize external API responses into typed Dart models before the data reaches the UI components.

9. The repository contains a few auxiliary or experimental files at the root such as `response.js`, `x_fake_api.dart`, `x.rest`, `xcoba.dart`, and `perintah.dart`. These look like developer tooling, mock API scaffolding, or scratch code rather than core runtime architecture.

10. Assets are lightweight but functional: `assets/sound` contains several audio cues, which implies the UI uses sound feedback for interactions or status events. Standard Flutter-generated native wrappers are present under `android/`, `ios/`, `macos/`, and `web/`, with no special native subsystem beyond the usual platform launch/configuration files.

11. Testing is split between `test/widget_test.dart` for basic widget coverage and `integration_test/` for end-to-end app flows. This indicates the app is expected to be exercised at both unit/widget and device-integration levels.

12. For an architecture diagram, the most important flow is: platform shell launches Flutter app → `main.dart` initializes shared state/theme → user enters via login/home → navigates into hotel, restaurant, or calendar modules → each module renders component screens backed by typed models → data is fetched and normalized through the REST/response layer.

Main entry points: [`lib/main.dart`](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/main.dart) (Main app), [`lib/views/home.dart`](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/home.dart) (Views), [`lib/store.dart`](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/store.dart) (Store + theme), [`lib/rest_api.dart`](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_api.dart) (REST API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shells["Platform shells"]
  node_android_shell["Android<br/>platform shell<br/>[MainActivity.kt]"]
  node_ios_shell["iOS<br/>platform shell<br/>[AppDelegate.swift]"]
  node_macos_shell["macOS<br/>platform shell<br/>[AppDelegate.swift]"]
  node_web_shell["Web<br/>platform shell<br/>[index.html]"]
end

subgraph group_app["Core app"]
  node_main_app["Main app<br/>Flutter entrypoint<br/>[main.dart]"]
  node_store_theme["Store + theme<br/>shared app state<br/>[store.dart]"]
  node_navigation["Views<br/>routing/ui shell<br/>[home.dart]"]
  node_login_screen["Login<br/>auth screen<br/>[login.dart]"]
end

subgraph group_phis["PHIS domain"]
  node_hotel_home["Hotel home<br/>PHIS dashboard<br/>[hotel_home.dart]"]
  node_phis_models["PHIS models<br/>domain models"]
end

subgraph group_presto["Presto domain"]
  node_presto_home["Presto home<br/>F&B dashboard<br/>[home_index.dart]"]
  node_presto_models["Presto models<br/>domain models"]
end

subgraph group_calendar["Calendar domain"]
  node_calendar_views["Calendar screens<br/>booking ui<br/>[calendar_v5.dart]"]
  node_calendar_models["Calendar models<br/>booking models"]
end

subgraph group_data["Data layer"]
  node_api_client["REST API<br/>network client<br/>[rest_api.dart]"]
  node_phis_response["PHIS response<br/>response wrapper"]
  node_presto_response["Restaurant response<br/>response wrapper"]
  node_calendar_response["Calendar response<br/>response wrapper"]
end

subgraph group_tests["Quality checks"]
  node_tests["Tests<br/>test suites<br/>[widget_test.dart]"]
end

node_android_shell -->|"launches"| node_main_app
node_ios_shell -->|"launches"| node_main_app
node_macos_shell -->|"launches"| node_main_app
node_web_shell -->|"launches"| node_main_app
node_main_app -->|"configures"| node_store_theme
node_main_app -->|"boots"| node_navigation
node_navigation -->|"routes"| node_login_screen
node_navigation -->|"routes"| node_hotel_home
node_navigation -->|"routes"| node_presto_home
node_navigation -->|"routes"| node_calendar_views
node_hotel_home -->|"uses"| node_phis_models
node_presto_home -->|"uses"| node_presto_models
node_calendar_views -->|"uses"| node_calendar_models
node_api_client -->|"normalizes"| node_phis_response
node_api_client -->|"normalizes"| node_presto_response
node_api_client -->|"normalizes"| node_calendar_response
node_phis_response -->|"maps to"| node_phis_models
node_presto_response -->|"maps to"| node_presto_models
node_calendar_response -->|"maps to"| node_calendar_models
node_store_theme -->|"shared by"| node_hotel_home
node_store_theme -->|"shared by"| node_presto_home
node_store_theme -->|"shared by"| node_calendar_views
node_tests -->|"covers"| node_main_app

click node_android_shell "https://github.com/malikkurosaki/phis_mobile/blob/master/android/app/src/main/kotlin/makuro/probus/system/probus_mobile/MainActivity.kt"
click node_ios_shell "https://github.com/malikkurosaki/phis_mobile/blob/master/ios/Runner/AppDelegate.swift"
click node_macos_shell "https://github.com/malikkurosaki/phis_mobile/blob/master/macos/Runner/AppDelegate.swift"
click node_web_shell "https://github.com/malikkurosaki/phis_mobile/blob/master/web/index.html"
click node_main_app "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/main.dart"
click node_store_theme "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/store.dart"
click node_navigation "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/home.dart"
click node_login_screen "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/login.dart"
click node_hotel_home "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/components_phis/hotel_home.dart"
click node_phis_models "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/models_phis/model_hotel_home.dart"
click node_presto_home "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/components_presto/home_index.dart"
click node_presto_models "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/models_presto/model_home_index.dart"
click node_calendar_views "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/calendar_v5.dart"
click node_calendar_models "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/model_calendar/model_list_booking.dart"
click node_api_client "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_api.dart"
click node_phis_response "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_restponse_phis.dart"
click node_presto_response "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_response_restaurant.dart"
click node_calendar_response "https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_restponse_calendar.dart"
click node_tests "https://github.com/malikkurosaki/phis_mobile/blob/master/test/widget_test.dart"

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_android_shell,node_ios_shell,node_macos_shell,node_web_shell,node_tests toneBlue
class node_main_app,node_store_theme,node_navigation,node_login_screen toneAmber
class node_hotel_home,node_phis_models toneMint
class node_presto_home,node_presto_models toneRose
class node_calendar_views,node_calendar_models toneIndigo
class node_api_client,node_phis_response,node_presto_response,node_calendar_response toneTeal
```

## Components

### Platform shells

Flutter platform wrappers and launch code

- [Android](https://github.com/malikkurosaki/phis_mobile/blob/master/android/app/src/main/kotlin/makuro/probus/system/probus_mobile/MainActivity.kt): platform shell · Android launcher and native wrapper · `android/app/src/main/kotlin/makuro/probus/system/probus_mobile/MainActivity.kt`
- [iOS](https://github.com/malikkurosaki/phis_mobile/blob/master/ios/Runner/AppDelegate.swift): platform shell · iOS runner and launch wrapper · `ios/Runner/AppDelegate.swift`
- [macOS](https://github.com/malikkurosaki/phis_mobile/blob/master/macos/Runner/AppDelegate.swift): platform shell · macOS runner and window wrapper · `macos/Runner/AppDelegate.swift`
- [Web](https://github.com/malikkurosaki/phis_mobile/blob/master/web/index.html): platform shell · Web bootstrap and manifest · `web/index.html`

### Core app

Entrypoint, global state, theming, and navigation

- [Main app](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/main.dart): Flutter entrypoint · Application bootstrap and root wiring · `lib/main.dart`
- [Store + theme](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/store.dart): shared app state · Global state and theming used across screens · `lib/store.dart`
- [Views](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/home.dart): routing/ui shell · Top-level screens and section navigation · `lib/views/home.dart`
- [Login](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/login.dart): auth screen · Entry login surface · `lib/views/login.dart`

### PHIS domain

Hotel/property-operations screens and models

- [Hotel home](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/components_phis/hotel_home.dart): PHIS dashboard · Hotel/property operations landing screen · `lib/components_phis/hotel_home.dart`
- [PHIS models](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/models_phis/model_hotel_home.dart): domain models · Arrival, departure, occupancy, reservation, and production models · `lib/models_phis/model_hotel_home.dart`

### Presto domain

Restaurant/F&B screens and models

- [Presto home](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/components_presto/home_index.dart): F&B dashboard · Restaurant analytics and reporting landing screen · `lib/components_presto/home_index.dart`
- [Presto models](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/models_presto/model_home_index.dart): domain models · Revenue, sales, payment, traffic, and summary models · `lib/models_presto/model_home_index.dart`

### Calendar domain

Booking and room-type workflow

- [Calendar screens](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/views/calendar_v5.dart): booking ui · Calendar-related views for booking and room types · `lib/views/calendar_v5.dart`
- [Calendar models](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/model_calendar/model_list_booking.dart): booking models · Booking list and room-type data models · `lib/model_calendar/model_list_booking.dart`

### Data layer

REST client and response normalization

- [REST API](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_api.dart): network client · Shared API access and request orchestration · `lib/rest_api.dart`
- [PHIS response](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_restponse_phis.dart): response wrapper · Normalized PHIS API payload wrapper · `lib/rest_restponse_phis.dart`
- [Restaurant response](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_response_restaurant.dart): response wrapper · Normalized restaurant API payload wrapper · `lib/rest_response_restaurant.dart`
- [Calendar response](https://github.com/malikkurosaki/phis_mobile/blob/master/lib/rest_restponse_calendar.dart): response wrapper · Normalized calendar API payload wrapper · `lib/rest_restponse_calendar.dart`

### Quality checks

Widget and integration test entry points

- [Tests](https://github.com/malikkurosaki/phis_mobile/blob/master/test/widget_test.dart): test suites · Widget and integration test entry points · `test/widget_test.dart`

## Connections

- Android → Main app: launches · Android shell starts the Flutter app
- iOS → Main app: launches · iOS shell starts the Flutter app
- macOS → Main app: launches · macOS shell starts the Flutter app
- Web → Main app: launches · Web bootstrap starts the Flutter app
- Main app → Store + theme: configures · Entrypoint initializes shared state and theme
- Main app → Views: boots · Entrypoint wires the app navigation shell
- Views → Login: routes · Top-level navigation exposes login
- Views → Hotel home: routes · Navigation enters the hotel/PHIS area
- Views → Presto home: routes · Navigation enters the restaurant/Presto area
- Views → Calendar screens: routes · Navigation enters the calendar workflow
- Hotel home → PHIS models: uses · Hotel UI is driven by PHIS typed models
- Presto home → Presto models: uses · Restaurant UI is driven by Presto typed models
- Calendar screens → Calendar models: uses · Calendar UI is driven by booking models
- REST API → PHIS response: normalizes · API layer shapes PHIS responses
- REST API → Restaurant response: normalizes · API layer shapes restaurant responses
- REST API → Calendar response: normalizes · API layer shapes calendar responses
- PHIS response → PHIS models: maps to · PHIS responses are mapped into domain models
- Restaurant response → Presto models: maps to · Restaurant responses are mapped into domain models
- Calendar response → Calendar models: maps to · Calendar responses are mapped into booking models
- Store + theme → Hotel home: shared by · Hotel screens share global state and theming
- Store + theme → Presto home: shared by · Restaurant screens share global state and theming
- Store + theme → Calendar screens: shared by · Calendar screens share global state and theming
- Tests → Main app: covers · Tests exercise the app entrypoint and flows
