From 09702186827c824dbdd34aa802273459281d074c Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 13 Nov 2025 18:22:47 -0500 Subject: [PATCH 1/4] feat: add dynamic Mermaid diagram support and configuration and add diagrams for legacy staff application --- .../assets/diagrams/diagrams-config.json | 10 + .../staff-mobile-application/overview.mermaid | 117 +++++++ .../use-case-flowchart.mermaid | 85 ++++++ firebase/internal-launchpad/launchpad.html | 289 +++++++++++++++--- 4 files changed, 465 insertions(+), 36 deletions(-) create mode 100644 firebase/internal-launchpad/assets/diagrams/diagrams-config.json create mode 100644 firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/overview.mermaid create mode 100644 firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use-case-flowchart.mermaid diff --git a/firebase/internal-launchpad/assets/diagrams/diagrams-config.json b/firebase/internal-launchpad/assets/diagrams/diagrams-config.json new file mode 100644 index 00000000..f381d734 --- /dev/null +++ b/firebase/internal-launchpad/assets/diagrams/diagrams-config.json @@ -0,0 +1,10 @@ +[ + { + "path": "assets/diagrams/legacy/staff-mobile-application/overview.mermaid", + "title": "Overview" + }, + { + "path": "assets/diagrams/legacy/staff-mobile-application/use-case-flowchart.mermaid", + "title": "Use Case Flowchart" + } +] diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/overview.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/overview.mermaid new file mode 100644 index 00000000..c08dba53 --- /dev/null +++ b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/overview.mermaid @@ -0,0 +1,117 @@ +flowchart TD + A[main.dart] --> B{KrowApp}; + B --> C{MaterialApp.router}; + C --> D[SplashRoute]; + D --> E{SplashRedirectGuard}; + + E -- Authenticated --> F[HomeRoute]; + E -- Admin Validation --> G[WaitingValidationRoute]; + E -- Prepare Profile --> H[CheckListFlowRoute]; + E -- Unauthenticated/Error --> I[AuthFlowRoute]; + + F --> F1[ShiftsFlowRoute]; + F --> F2[EarningsFlowRoute]; + F --> F3[ProfileMainFlowRoute]; + + F1 --> F1a[ShiftsListMainRoute]; + F1a --> F1b[ShiftDetailsRoute]; + F1a --> F1c[QrScannerRoute]; + + F2 --> F2a[EarningsRoute]; + F2a --> F2b[EarningsHistoryRoute]; + + F3 --> F3a[ProfileMainRoute]; + F3a --> F3b[RoleKitFlowRoute]; + F3a --> F3c[CertificatesRoute]; + F3a --> F3d[ScheduleRoute]; + F3a --> F3e[WorkingAreaRoute]; + F3a --> F3f[LivePhotoRoute]; + F3a --> F3g[ProfileSettingsFlowRoute]; + F3a --> F3h[WagesFormsFlowRoute]; + F3a --> F3i[BankAccountFlowRoute]; + F3a --> F3j[BenefitsRoute]; + F3a --> F3k[SupportRoute]; + F3a --> F3l[FaqRoute]; + + F3g --> F3g1[ProfileSettingsMenuRoute]; + F3g1 --> F3g2[RoleRoute]; + F3g1 --> F3g3[PersonalInfoRoute]; + F3g1 --> F3g4[EmailVerificationRoute]; + F3g4 --> L1; + F3g1 --> F3g5[AddressRoute]; + F3g1 --> F3g6[EmergencyContactsRoute]; + F3g1 --> F3g7[MobilityRoute]; + F3g1 --> F3g8[InclusiveRoute]; + + F3h --> F3h1[FormsListRoute]; + F3h1 --> F3h2[OfferLetterFormRoute]; + F3h1 --> F3h3[EddFormRoute]; + F3h1 --> F3h4[INineFormRoute]; + F3h1 --> F3h5[WFourFormRoute]; + F3h2 --> F3h6[FormSignRoute]; + F3h3 --> F3h6; + F3h4 --> F3h6; + F3h5 --> F3h6; + F3h6 --> F3h7[SignedFormRoute]; + F3h6 --> F3h8[FormPreviewRoute]; + + F3i --> F3i1[BankAccountRoute]; + F3i1 --> F3i2[BankAccountEditRoute]; + + F3b --> F3b1[RolesKitListRoute]; + F3b1 --> F3b2[RoleKitRoute]; + + H --> H1[CheckListRoute]; + H1 --> H2[PersonalInfoRoute]; + H1 --> H3[EmailVerificationRoute]; + H3 --> L1; + H1 --> H4[EmergencyContactsRoute]; + H1 --> H5[AddressRoute]; + H1 --> H6[WorkingAreaRoute]; + H1 --> H7[RoleRoute]; + H1 --> H8[CertificatesRoute]; + H1 --> H9[ScheduleRoute]; + H1 --> F3i; + H1 --> F3h; + H1 --> F3b; + + I --> I1[WelcomeRoute]; + I1 --> I2[PhoneVerificationRoute]; + I2 --> I3[CodeVerificationRoute]; + I3 --> J{SingUpRedirectGuard}; + + J -- Prepare Profile --> K[SignupFlowRoute]; + J -- Authenticated --> F; + J -- Admin Validation --> G; + J -- Unauthenticated/Error --> I; + + K --> K1[PersonalInfoRoute]; + K1 --> K2[EmailVerificationRoute]; + K2 --> K3[EmergencyContactsRoute]; + K2 --> L1; + K3 --> K4[MobilityRoute]; + K4 --> K5[InclusiveRoute]; + K5 --> K6[AddressRoute]; + K6 --> K7[WorkingAreaRoute]; + K7 --> K8[RoleRoute]; + + subgraph PhoneReLoginFlow + L1[PhoneReLoginFlowRoute] + L1 --> L2[CodeVerificationRoute] + end + + subgraph CheckListFlow + H + end + + subgraph AuthFlow + I + end + + subgraph SignUpFlow + K + end + + subgraph HomeFlow + F + end diff --git a/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use-case-flowchart.mermaid b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use-case-flowchart.mermaid new file mode 100644 index 00000000..1c1e7f1e --- /dev/null +++ b/firebase/internal-launchpad/assets/diagrams/legacy/staff-mobile-application/use-case-flowchart.mermaid @@ -0,0 +1,85 @@ +flowchart TD + subgraph AppInitialization + A[Start App] --> B{Check Auth Status}; + B -- Authenticated --> C[Go to Home]; + B -- Unauthenticated --> D[Go to Auth]; + B -- Admin Validation --> E[Go to Waiting Validation]; + B -- Prepare Profile --> F[Go to Checklist]; + end + + subgraph UserAuthentication + D --> G[Welcome Screen]; + G --> H{Select Sign In/Up}; + H -- Sign In --> I[Sign In With Phone]; + I --> J[Verify Phone Code]; + J -- Success --> C; + H -- Sign Up --> K[Go to User Onboarding]; + end + + subgraph UserOnboarding + K --> L[Collect Personal Info]; + L --> M[Verify Email]; + M --> N[Add Emergency Contacts]; + N --> O[Specify Mobility]; + O --> P[Provide Inclusivity Info]; + P --> Q[Enter Address]; + Q --> R[Define Working Area]; + R --> S[Select Role]; + S -- Success --> F; + end + + subgraph ProfileCompletion + F --> T[View Checklist]; + T --> U[Complete Personal Info]; + T --> V[Complete Email Verification]; + T --> W[Complete Emergency Contacts]; + T --> X[Manage Certificates]; + T --> Y[Set Schedule]; + T --> Z[Manage Bank Account]; + T --> AA[Fill Out Wage Forms]; + T --> AB[Manage Role Kit]; + AB -- All Complete --> C; + end + + subgraph MainApp + C --> AC[Home Screen]; + AC --> AD{Navigate}; + AD -- Shifts --> AE[Shift Management]; + AD -- Earnings --> AF[Earnings Management]; + AD -- Profile --> AG[Profile Management]; + end + + subgraph ShiftManagement + AE --> AH[View Shifts]; + AH --> AI[View Shift Details]; + AH --> AJ[Clock In/Out via QR]; + end + + subgraph EarningsManagement + AF --> AK[View Current Earnings]; + AK --> AL[View Earnings History]; + end + + subgraph ProfileManagement + AG --> AM[View Profile]; + AM --> AN[Manage Role Kit]; + AM --> AO[Manage Certificates]; + AM --> AP[Manage Schedule]; + AM --> AQ[Manage Working Area]; + AM --> AR[Update Live Photo]; + AM --> AS[Manage Profile Settings]; + AS --> AT[Update Personal Info]; + AS --> AU[Update Email]; + AU --> AV[Re-login with Phone]; + AS --> AW[Update Address]; + AM --> AX[Manage Wage Forms]; + AM --> AY[Manage Bank Account]; + AM --> AZ[View Benefits]; + AM --> BA[Access Support]; + BA --> BB[View FAQs]; + BA --> BC[Contact Support]; + end + + subgraph QRScanning + AJ --> BD[Scan QR Code]; + end diff --git a/firebase/internal-launchpad/launchpad.html b/firebase/internal-launchpad/launchpad.html index b0dcc402..39f32188 100644 --- a/firebase/internal-launchpad/launchpad.html +++ b/firebase/internal-launchpad/launchpad.html @@ -9,6 +9,8 @@ + + @@ -85,27 +129,30 @@ @@ -187,6 +234,8 @@ From 9afd275d9fb98dbe26b77c74131190973e289e70 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 13 Nov 2025 18:39:55 -0500 Subject: [PATCH 2/4] feat: add prompts for generating Mermaid diagrams for Flutter application architecture and use cases --- .../create-mermaid-overview-flutter.md | 21 ++++++++++++++ .../prompts/create-mermaid-usecase-flutter.md | 29 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 docs/prompts/create-mermaid-overview-flutter.md create mode 100644 docs/prompts/create-mermaid-usecase-flutter.md diff --git a/docs/prompts/create-mermaid-overview-flutter.md b/docs/prompts/create-mermaid-overview-flutter.md new file mode 100644 index 00000000..7c85faf3 --- /dev/null +++ b/docs/prompts/create-mermaid-overview-flutter.md @@ -0,0 +1,21 @@ +## What the prompt does +This prompt generates a Mermaid diagram that provides an overview of the given Flutter application's architecture. It includes the main components of the app, such as the widget tree, state management, and navigation. + +## Assumptions +- Flutter project is given. + +## Prompt +In the given Flutter project. Carefully analyze all files to understand the app’s navigation, logic flow, state management, and how each screen connects to the next. + +Using that analysis, generate a **Mermaid flowchart** that shows: + +* The app’s entry point (main.dart → root widget). +* The initial flow (e.g., splash → login/signup → authenticated home). +* All pages/screens and how navigation occurs between them. +* Conditional routing logic (authentication checks, API responses, state changes, etc.). +* Any loops, flows, or background logic that impact navigation. +* The diagram must accurately reflect the project structure and not make assumptions beyond what is found in the code. + +Use **Mermaid `flowchart TD` or `flowchart LR`** format, with clear labels for each screen and logic decision. + +If needed, ask me for missing files so you can produce a complete diagram. diff --git a/docs/prompts/create-mermaid-usecase-flutter.md b/docs/prompts/create-mermaid-usecase-flutter.md new file mode 100644 index 00000000..49075ddf --- /dev/null +++ b/docs/prompts/create-mermaid-usecase-flutter.md @@ -0,0 +1,29 @@ +## What the prompt does +This prompt generates a Mermaid diagram that visualizes the use case of a Flutter application. The diagram includes the actors, use cases, and relationships between them. + +## Assumption +- Flutter project is given +- Overview mermaid diagram is given + +## How to use the prompt +Using the given Flutter project code — along with the previously generated Mermaid diagram that outlines the app’s navigation and logic flow — analyze the entire system to identify **all main use cases and their sub-use cases**. + +From this analysis, create a **Mermaid flowchart** that shows: + +* All high-level use cases the app supports (e.g., Authentication, Profile Management, Dashboard Interaction, Data Fetching, Settings, etc.). +* How each use case breaks down into sub-use cases (e.g., Authentication → Login, Signup, Logout, Token Refresh). +* How these use cases depend on each other or trigger one another. +* Connections between use cases as they appear in the actual code (UI actions, state changes, service calls, repository interactions, etc.). +* Any decision points or conditions that influence which sub-use case occurs next. + +Format the output as a **clear Mermaid diagram** using `flowchart TD` or `flowchart LR`. +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 From 58ebf49bc66d0e4ed9c57f317159882f9967891e Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 13 Nov 2025 18:46:57 -0500 Subject: [PATCH 3/4] feat: add favicon.svg for the KROW Launchpad --- firebase/internal-launchpad/favicon.svg | 18 ++++++++++++++++++ firebase/internal-launchpad/launchpad.html | 1 + 2 files changed, 19 insertions(+) create mode 100644 firebase/internal-launchpad/favicon.svg diff --git a/firebase/internal-launchpad/favicon.svg b/firebase/internal-launchpad/favicon.svg new file mode 100644 index 00000000..cbeedbc2 --- /dev/null +++ b/firebase/internal-launchpad/favicon.svg @@ -0,0 +1,18 @@ + + + + + + + diff --git a/firebase/internal-launchpad/launchpad.html b/firebase/internal-launchpad/launchpad.html index 39f32188..dbb09f4e 100644 --- a/firebase/internal-launchpad/launchpad.html +++ b/firebase/internal-launchpad/launchpad.html @@ -5,6 +5,7 @@ KROW Launchpad + From 16a5cd9f6fa65e539d5f28bc7003fc242261687d Mon Sep 17 00:00:00 2001 From: bwnyasse <5323628+bwnyasse@users.noreply.github.com> Date: Fri, 14 Nov 2025 06:05:05 -0500 Subject: [PATCH 4/4] feat: create internal launchpad for KROW This commit introduces a new internal launchpad for the KROW project. The launchpad provides a centralized location for accessing applications, resources, and diagrams related to the project. The launchpad includes the following features: - A sidebar navigation menu for accessing different sections of the launchpad. - A home view with links to applications and resources. - A diagram viewer for displaying static SVG and dynamic Mermaid diagrams. - Zoom and pan functionality for diagrams. - Dynamic loading of Mermaid diagrams from a configuration file. This launchpad is designed to improve the discoverability of project resources and provide a more streamlined experience for developers and stakeholders. --- firebase/internal-launchpad/{launchpad.html => index.html} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename firebase/internal-launchpad/{launchpad.html => index.html} (100%) diff --git a/firebase/internal-launchpad/launchpad.html b/firebase/internal-launchpad/index.html similarity index 100% rename from firebase/internal-launchpad/launchpad.html rename to firebase/internal-launchpad/index.html