From d456bf9dc92895b2b5749b807277a83276c058ef Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 22 Jan 2026 12:06:07 -0500 Subject: [PATCH] Update mobile app docs and add gen:all Melos script Revised the main README to clarify the mobile app structure and added a detailed README for the mobile apps. Introduced a new 'gen:all' script in Melos to run both localization and build_runner generation, and updated the info script to reflect this addition. --- README.md | 5 ++-- apps/mobile/README.md | 68 ++++++++++++++++++++++++++++++++++++++++++ apps/mobile/melos.yaml | 7 +++++ 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 apps/mobile/README.md diff --git a/README.md b/README.md index 695004f7..04116b6a 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,9 @@ KROW is a comprehensive workforce management platform designed to streamline ope ### 📦 Apps (`/apps`) These are the production-ready applications for our users: - **`web-dashboard/`**: The primary React/Vite dashboard for Admin, Vendors, and Clients. -- **`mobile-client/`**: Flutter application for final clients to manage orders and billing. -- **`mobile-staff/`**: Flutter application for staff members (scheduling, clock-in/out, earnings). +- **`mobile/`**: Flutter applications for client and staff. + - `client`: The application for final clients to manage orders and billing. + - `staff`: The application for staff members (scheduling, clock-in/out, earnings). ### ⚙️ Backend (`/backend`) The core data engine powering all applications: diff --git a/apps/mobile/README.md b/apps/mobile/README.md new file mode 100644 index 00000000..a708b8eb --- /dev/null +++ b/apps/mobile/README.md @@ -0,0 +1,68 @@ +# KROW Workforce Mobile 📱 + +This folder holds the mobile app code for the KROW Workforce apps. +This project uses [Melos](https://melos.invertase.dev/) to manage multiple Flutter packages and applications. + +## 📂 Project Structure + +The project is organized into modular packages to ensure separation of concerns and maintainability. + +- **`apps/`**: Main application entry points. + - `client`: The application for businesses/clients. + - `staff`: The application for workforce/staff. + - `design_system_viewer`: A gallery of our design system components. +- **`packages/`**: Shared logic and feature modules. + - `features/`: UI and business logic for specific features (e.g., Auth, Home, Hubs). + - `features/client`: Client specific features. + - `features/staff`: Staff specific features. + - `design_system/`: Shared UI components, tokens (colors, spacing), and core widgets. + - `domain/`: Shared business entities and repository interfaces. + - `data_connect/`: Data access layer (Mocks and Firebase Data Connect SDK). + - `core_localization/`: Internationalization using Slang. + - `core/`: Base utilities and common logic. + +## 🚀 Getting Started + +### 1. Prerequisites +Ensure you have the Flutter SDK installed and configured. + +### 2. Initial Setup +Run the following command from the **project root** to install Melos, bootstrap all packages, and generate localization files: + +```bash +# Using Makefile +make mobile-install +# Using Melos +melos bootstrap +``` + +### 3. Running the Apps +You can run the applications using Melos scripts or through the `Makefile`: + +#### Client App +```bash +# Using Melos +melos run start:client -d android # or ios +# Using Makefile +make mobile-client-dev-android +``` + +#### Staff App +```bash +# Using Melos +melos run start:staff -d android # or ios +# Using Makefile +make mobile-staff-dev-android +``` + +## 🛠 Useful Commands + +- **Bootstrap**: `melos bootstrap` (Installs all dependencies) +- **Generate All**: `melos run gen:all` (Localization + Code Generation) +- **Analyze**: `melos run analyze:all` +- **Help**: `melos run info` (Shows all available custom scripts) + +## 🏗 Coding Principles +- **Clean Architecture**: We strictly follow Domain-Driven Design and Clean Architecture. +- **Modularity**: Every feature should be its own package in `packages/features/`. Client and staff specific features should be in their respective packages. +- **Consistency**: Use the `design_system` package for all UI elements to ensure a premium, unified look. diff --git a/apps/mobile/melos.yaml b/apps/mobile/melos.yaml index fb6c4bda..ae2cce43 100644 --- a/apps/mobile/melos.yaml +++ b/apps/mobile/melos.yaml @@ -27,9 +27,16 @@ scripts: echo " CODE GENERATION:" echo " - melos run gen:l10n : Generate Slang l10n" echo " - melos run gen:build : Run build_runner" + echo " - melos run gen:all : Run l10n and build_runner" echo "============================================================" description: "Display information about available custom Melos commands." + gen:all: + run: | + melos run gen:l10n + melos run gen:build + description: "Run both localization and build_runner generation across all packages." + gen:l10n: exec: dart run slang description: "Generate localization files using Slang across all packages."