How freika/dawarich works
Main Components Overview
The system should be divided into these major components:
a) Frontend Layer:
• Web Interface (Rails Views + JavaScript)
• Real-time Components (ActionCable)
• Visualization (JavaScript/Maps)
b) Backend Layer:
• API Controllers (REST + WebSocket)
• Business Logic Services
• Background Jobs (Sidekiq)
• Authentication (Devise)
c) Data Layer:
• PostgreSQL Database
• Redis (for caching and Sidekiq)
• File Storage (Active Storage)
Key Architectural Elements
a) Core Services:
Import Services
• Google Maps Import
• OwnTracks Import
• GPX/GeoJSON Import
• Photo Geodata Import (Immich/Photoprism)
Location Processing
• Reverse Geocoding
• Visit Detection
• Area Detection
Export Services
• GeoJSON Export
• GPX Export
b) Real-time Features:
• WebSocket Channels for live updates
• Background job processing for heavy tasks
Integration Points
• External APIs (Reverse Geocoding)
• Photo Management Systems (Immich/Photoprism)
• Location Tracking Apps (Overland, OwnTracks, etc.)
• Rectangles: Main components
• Hexagons: External services
• Rounded rectangles: Internal services
• Blue: Frontend components
• Green: Backend services
• Yellow: Data stores
• Gray: External services
→ REST API calls
⇢ WebSocket connections
⇄ Bi-directional data flow
Key Workflows to Highlight
a) Location Data Flow:
Mobile App → API → Background Jobs → Database → Map Visualization
b) Import Process:
Import File → Import Service → Background Processing → Database → Statistics Calculation
c) Real-time Updates:
Location Update → WebSocket → Frontend Map → User Interface
Deployment Architecture
Docker Container Structure:
• Web Application (Rails)
• Sidekiq Worker
• PostgreSQL
• Redis
Remember to emphasize:
• The modular nature of the import/export system
• Real-time capabilities
• Background processing architecture
• Data flow between components
• Security boundaries
• Integration points with external services
This will provide a clear understanding of how Dawarich processes, stores, and visualizes location data while handling various import sources and real-time updates.