How graphefruit/beanconqueror works
Project Type and Purpose
• Beanconqueror is a cross-platform mobile application (iOS & Android) built with the Ionic framework (Angular) and Capacitor.
• Its goal is to let coffee aficionados record, track, and optimize every stage of their coffee journey—from green-bean management and roasting, through brewing and cupping, to data export and integration with Bluetooth devices and Apple Health.
File Structure & Architectural Patterns
• Top-Level Folders
– android/, ios/: Native platform projects generated by Capacitor.
– src/: The entire Ionic/Angular client, subdivided into app modules, pages, components, services, classes, directives, pipes, etc.
– capacitor.config.ts: Configures Capacitor plugins and app IDs.
– e2e/, hooks/: End-to-end tests and build/deploy hooks.
• Angular Modularization
– src/app/*.module.ts and routing modules define feature boundaries: beans, brew, roasting-section, water-section, etc.
– Each feature folder contains pages, subcomponents, popovers, and routing for that domain.
– Shared services under src/services handle data persistence, device communication, analytics, and UI helpers.
• Native Bridging
– capacitor plugins and custom native code live under android/ and ios/, plus native-calls-plugin in src/native and src/classes/devices.
– Bluetooth communication and file system access are provided via Capacitor’s native bridge.
• Data Flow Patterns
– UI Components → Angular Services (business logic) → Storage (Ionic Storage/SQLite, FileSystem via Capacitor) and Device APIs (Bluetooth, Camera, FileSystem) → Native platform → External systems (Apple Health, optional analytics server).
How to Represent This
1. Mobile UI Layer (Angular pages & components)
2. Angular Business Logic Layer (Services, Classes, Mappers)
3. Data Layer
• Local Storage (Ionic Storage / SQLite)
• File System (images, exports)
4. Device Integration Layer (Capacitor Plugins)
• Bluetooth device service
• Native calls plugin
5. Native Platforms
• Android project (Java/Kotlin)
• iOS project (Swift/Objective-C)
6. External Integrations
• Apple Health
• Analytics & optional server-communication
• User taps UI → Component invokes Service → Service reads/writes Local Storage or calls Device Integration → Capacitor Bridge → Native Platform → Bluetooth device or FileSystem
• Services may post events back to UI (Observables) or trigger navigation.
• Data export/import flows through FileSystem to share files.
• Analytics calls flow from Services → HTTP (optional) → Analytics endpoint.
• Apple Health calls flow from Services → Capacitor Bridge → iOS HealthKit.
c. Key Architectural Patterns
• Modular feature organization (Angular modules + lazy routing)
• Separation of concerns: UI (components) vs. business logic (services) vs. persistence (storage)
• Observer pattern (RxJS) for real-time updates (e.g., live brew graphs)
• Bridge pattern (Capacitor) for platform-specific capabilities
d. Technologies & Frameworks
• Ionic & Angular (UI, routing, modules, components)
• Capacitor (native bridge, plugins)
• SQLite / Ionic Storage (persistent data)
• Bluetooth LE (via Capacitor plugins + custom native device classes)
• Apple HealthKit (iOS)
• FileSystem & Camera plugins
• RxJS for reactive data flows
Detail & Granularity
• Major services under the business logic layer (e.g., uiBeanStorage, server-communication, qr-scanner)
• How native-calls-plugin links the Angular layer to android/BCAndroidNativeCallsPlugin.java and AppDelegate.swift
• Essential device classes (e.g., AcaiaScale, DecentScale) under the Device Integration layer