How itissid/privyloci works
Main Components Identification
The system should be represented with these key components:
a. Core Application Layer:
• Main Application (MainApplication.kt)
• Foreground Service (PrivyForegroundService.kt)
• Service Management Components
b. Data Layer:
• Local Database (AppDatabase.kt)
• Key-Value Repository
• Data Models and DAOs
c. Sensor Layer:
• Location Sensors
• Bluetooth Sensors
• Sensor Management System
d. UI Layer:
• Main Activity
• Compose UI Components
• ViewModels
• Permission Handlers
e. Event Processing Layer:
• Event Processors
• Geofence Processors
Component Relationships
a. Use a layered architecture approach with:
• Business Logic in the middle
• Sensor Layer as a parallel component
• User interactions → ViewModels → Business Logic
• Sensor data → Event Processors → Storage
• Storage → ViewModels → UI
Specific Implementation Details
a. Privacy-First Architecture:
• Data encryption points
• Local-only storage
• Permission boundaries
b. Sensor Integration:
• Google Fused Location Provider
• BLE scanning components
• Geofencing components
c. Data Flow Control:
• Permission-gated operations
• Event processing pipeline
• Subscription management
Key Architectural Patterns
Patterns:
• MVVM architecture (ViewModels folder structure)
• Repository Pattern (kvrepository)
• Service-based background processing
• Event-driven architecture (eventprocessors)
Component Grouping
Related components:
UI Layer:
• MainActivity
• Compose UI Components
• Permission Dialogs
• Theme Components
Core Services:
• PrivyForegroundService
• ServiceStarter
• ServiceStoppedWorker
Data Management:
• AppDatabase
• Repositories
• DAOs
Sensor Framework:
• SensorManager
• GoogleFusedLocationSensor
• BLE Components