From 865484a508d7f5f80a41371cbeabacd197c1d563 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Sat, 15 Nov 2025 23:00:15 -0500 Subject: [PATCH] feat(diagrams): add new Mermaid diagrams for client mobile application overview, use cases, API map, and backend architecture --- .../create-mermaid-be-diagrams-flutter.md | 4 - .../prompts/create-mermaid-usecase-flutter.md | 7 -- .../assets/diagrams/diagrams-config.json | 12 ++- .../overview.mermaid | 65 +++++++++++++++ .../use-case-flowchat.mermaid | 80 +++++++++++++++++++ .../{api_map.mermaid => api-map.mermaid} | 0 ...e.mermaid => backend-architecture.mermaid} | 0 ...e_flows.mermaid => use-case-flows.mermaid} | 0 8 files changed, 154 insertions(+), 14 deletions(-) create mode 100644 firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/overview.mermaid create mode 100644 firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/use-case-flowchat.mermaid rename firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/{api_map.mermaid => api-map.mermaid} (100%) rename firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/{backend_architecture.mermaid => backend-architecture.mermaid} (100%) rename firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/{use_case_flows.mermaid => use-case-flows.mermaid} (100%) diff --git a/docs/prompts/create-mermaid-be-diagrams-flutter.md b/docs/prompts/create-mermaid-be-diagrams-flutter.md index 64684b1b..1a99baf8 100644 --- a/docs/prompts/create-mermaid-be-diagrams-flutter.md +++ b/docs/prompts/create-mermaid-be-diagrams-flutter.md @@ -51,7 +51,3 @@ Please do the following: * **Backend Architecture** * **API Map** * **Use-Case Flows** - ---- - -If you'd like, I can also generate a **Cursor-optimized** version or a **Claude Projects** version. diff --git a/docs/prompts/create-mermaid-usecase-flutter.md b/docs/prompts/create-mermaid-usecase-flutter.md index 49075ddf..e977bbd1 100644 --- a/docs/prompts/create-mermaid-usecase-flutter.md +++ b/docs/prompts/create-mermaid-usecase-flutter.md @@ -20,10 +20,3 @@ Format the output as a **clear Mermaid diagram** using `flowchart TD` or `flowch Ensure the flow represents the **real behavior of the code**, not assumptions. Ask for any missing files if needed to build a complete and accurate use-case hierarchy. - ---- - -If you want, I can also generate a version tailored for: -✔ UML use-case diagrams -✔ Sequence diagrams -✔ System interaction diagrams diff --git a/firebase/internal-launchpad/assets/diagrams/diagrams-config.json b/firebase/internal-launchpad/assets/diagrams/diagrams-config.json index d624202c..8871db8a 100644 --- a/firebase/internal-launchpad/assets/diagrams/diagrams-config.json +++ b/firebase/internal-launchpad/assets/diagrams/diagrams-config.json @@ -60,21 +60,27 @@ "icon": "bi-diagram-2" }, { - "path": "assets/diagrams/legacy/staff-mobile-application/api_map.mermaid", + "path": "assets/diagrams/legacy/staff-mobile-application/api-map.mermaid", "title": "Legacy App API Map", "type": "mermaid", "icon": "bi-phone" }, { - "path": "assets/diagrams/legacy/staff-mobile-application/use_case_flows.mermaid", + "path": "assets/diagrams/legacy/staff-mobile-application/use-case-flows.mermaid", "title": "Legacy App Use Cases BE Chart", "type": "mermaid", "icon": "bi-diagram-2" }, { - "path": "assets/diagrams/legacy/staff-mobile-application/backend_architecture.mermaid", + "path": "assets/diagrams/legacy/staff-mobile-application/backend-architecture.mermaid", "title": "Legacy App Use Cases", "type": "mermaid", "icon": "bi-diagram-2" + }, + { + "path": "assets/diagrams/legacy/client-mobile-application/overview.mermaid", + "title": "Legacy App Overview", + "type": "mermaid", + "icon": "bi-phone" } ] \ No newline at end of file diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/overview.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/overview.mermaid new file mode 100644 index 00000000..3d0fd2a4 --- /dev/null +++ b/firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/overview.mermaid @@ -0,0 +1,65 @@ +flowchart TD + subgraph "App Initialization" + A[main.dart] --> B(KrowApp); + B --> C{MaterialApp.router}; + C --> D[Initial Route: /]; + end + + subgraph "Authentication Flow" + D --> E(SplashRoute); + E --> F{SplashRedirectGuard}; + F -- Authenticated --> G(HomeRoute); + F -- Unauthenticated/Error --> H(SignInFlowRoute); + end + + subgraph "Sign-In/Welcome Flow" + H --> I[WelcomeRoute]; + I --> J[SignInRoute]; + J --> K[ResetPassRoute]; + L[Deeplink with oobCode] --> M[EnterNewPassRoute]; + J -- Forgot Password --> K; + I -- Sign In --> J; + end + + subgraph "Main Application (Home)" + G --> G_Tabs((Bottom Navigation)); + G_Tabs -- Events --> Events; + G_Tabs -- Invoices --> Invoices; + G_Tabs -- Notifications --> Notifications; + G_Tabs -- Profile --> Profile; + G_Tabs -- Create Event --> CreateEvent; + end + + subgraph "Events Flow" + Events[EventsFlow] --> Events_List(EventsListMainRoute); + Events_List --> Events_Event_Details(EventDetailsRoute); + Events_Event_Details --> Events_Assigned_Staff(AssignedStaffRoute); + Events_Assigned_Staff --> Events_Clock_Manual(ClockManualRoute); + Events_Event_Details --> Events_Rate_Staff(RateStaffRoute); + end + + subgraph "Create Event Flow" + CreateEvent[CreateEventFlow] --> Create_Event_Edit(CreateEventRoute); + Create_Event_Edit --> Create_Event_Preview(EventDetailsRoute); + end + + subgraph "Invoice Flow" + Invoices[InvoiceFlow] --> Invoice_List(InvoicesListMainRoute); + Invoice_List --> Invoice_Details(InvoiceDetailsRoute); + Invoice_Details --> Invoice_Event_Details(EventDetailsRoute); + end + + subgraph "Notifications Flow" + Notifications[NotificationFlow] --> Notification_List(NotificationsListRoute); + Notification_List --> Notification_Details(NotificationDetailsRoute); + end + + subgraph "Profile Flow" + Profile[ProfileFlow] --> Profile_Preview(ProfilePreviewRoute); + Profile_Preview --> Profile_Edit(PersonalInfoRoute); + end + + style F fill:#f9f,stroke:#333,stroke-width:2px + style G fill:#bbf,stroke:#333,stroke-width:2px + style H fill:#bbf,stroke:#333,stroke-width:2px + style L fill:#f9f,stroke:#333,stroke-width:2px diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/use-case-flowchat.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/use-case-flowchat.mermaid new file mode 100644 index 00000000..8de690a2 --- /dev/null +++ b/firebase/internal-launchpad/assets/diagrams/legacy/client-mobile-application/use-case-flowchat.mermaid @@ -0,0 +1,80 @@ +flowchart TD + subgraph "User" + U((User)) + end + + subgraph "Authentication Use Cases" + UC1(Sign In) + UC2(Sign Out) + UC3(Password Reset) + end + + subgraph "Event Management Use Cases" + UC4(Create Event) + UC5(View Event Details) + UC6(List Events) + end + + subgraph "Invoice Management Use Cases" + UC7(List Invoices) + UC8(View Invoice Details) + end + + subgraph "Staff Management Use Cases" + UC9(View Assigned Staff) + UC10(Rate Staff) + UC11(Manual Clock In/Out) + end + + subgraph "Profile Management Use Cases" + UC12(View Profile) + UC13(Edit Profile) + end + + subgraph "Notification Use Cases" + UC14(List Notifications) + UC15(View Notification Details) + end + + U --> UC1 + UC1 -- Success --> UC6 + UC1 -- Forgot Password --> UC3 + + UC6 --> UC5 + UC5 --> UC9 + UC9 --> UC11 + UC5 --> UC10 + + U --> UC4 + UC4 -- Success --> UC5 + + UC6 -- Triggers --> UC7 + UC7 --> UC8 + UC8 -- View Event --> UC5 + + U --> UC12 + UC12 --> UC13 + UC13 -- Success --> UC12 + + U --> UC14 + UC14 --> UC15 + + UC12 -- Sign Out --> UC2 + UC2 -- Success --> UC1 + + %% Styling + style UC1 fill:#f9f,stroke:#333,stroke-width:2px + style UC2 fill:#f9f,stroke:#333,stroke-width:2px + style UC3 fill:#f9f,stroke:#333,stroke-width:2px + style UC4 fill:#bbf,stroke:#333,stroke-width:2px + style UC5 fill:#bbf,stroke:#333,stroke-width:2px + style UC6 fill:#bbf,stroke:#333,stroke-width:2px + style UC7 fill:#bbf,stroke:#333,stroke-width:2px + style UC8 fill:#bbf,stroke:#333,stroke-width:2px + style UC9 fill:#bbf,stroke:#333,stroke-width:2px + style UC10 fill:#bbf,stroke:#333,stroke-width:2px + style UC11 fill:#bbf,stroke:#333,stroke-width:2px + style UC12 fill:#bbf,stroke:#333,stroke-width:2px + style UC13 fill:#bbf,stroke:#333,stroke-width:2px + style UC14 fill:#bbf,stroke:#333,stroke-width:2px + style UC15 fill:#bbf,stroke:#333,stroke-width:2px diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/api_map.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/api-map.mermaid similarity index 100% rename from firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/api_map.mermaid rename to firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/api-map.mermaid diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/backend_architecture.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/backend-architecture.mermaid similarity index 100% rename from firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/backend_architecture.mermaid rename to firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/backend-architecture.mermaid diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use_case_flows.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use-case-flows.mermaid similarity index 100% rename from firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use_case_flows.mermaid rename to firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use-case-flows.mermaid