How kwila-cloud/karriba works
Project Type & Purpose
• Karriba is an open-source, offline-first, commercial drone record-keeping system. Its initial MVP focuses on an offline Android mobile app built with Flutter. The long-term vision includes both a cloud service and self-hosted deployment options.
• The README emphasizes data sovereignty, local-first operation, and scalability toward cloud synchronization in later stages.
File Structure
• The primary codebase is under the “app” directory. Notice the Flutter-specific files:
– The “lib” folder contains Dart source files. It is organized into multiple domain-specific modules (e.g., applicators, customers, pesticides, records) each with their own data access objects (DAOs) and corresponding pages.
– The “android” directory holds all the native Android configuration files, which confirms that the MVP is an Android app.
• The existence of configuration files (pubspec.yaml, analysis_options.yaml, etc.) and CI workflows (under .github/workflows) indicate standard development, build automation, and deployment setups.
Architectural Components
a. Mobile Client (Flutter Application)
– UI Layer: Represented by various pages (e.g., applicators_page.dart, customers_page.dart, pesticides_page.dart, records_page.dart). Include elements like the main.dart and supporting UI components (e.g., coming_soon_dialog.dart, unsaved_changes_dialog.dart).
– Business Logic Layer: This involves the controllers and page managers coordinating the user input with backend operations.
– Data Access Layer: Indicated by Dart files ending with “_dao.dart” (e.g., applicator_dao.dart, customer_dao.dart, pesticide_dao.dart, records_dao.dart). There’s also a database_helper.dart that suggests management of local storage.
b. Local Storage Component
– Although not explicitly detailed, the presence of DAO files and a “database_helper.dart” implies an underlying local database (for instance, SQLite) that stores drone records. Mark this component as the “Local Database” for offline-first functionality.
c. Data Synchronization/Cloud Service (Future Component)
d. External Services and CI/CD Tools
– Optionally annotate external services for cloud hosting that eventually might interact with the mobile client.
Relationships and Interactions Between Components
• CI/CD pipelines connecting to the code repository and build/deployment automation.
Architectural Patterns & Design Principles
• Separation of concerns:
– Clear distinction between UI, logic, and data.
– Offline-first design pattern that ensures functionality without internet connectivity.
• That the application uses Data Access Objects (DAOs) to encapsulate database interactions.
• Recognize the modular structure (separate files and modules for different record types like customers, applicators, pesticides, records) which simplifies maintenance and scalability.
Essential Elements
• For example, “User Input” → “UI Layer” → “Business Logic” → “Data Access Layer” → “Local Database.”