16 KiB
Dawarich User Scenarios Documentation
Overview
Dawarich is a self-hosted location history tracking application that allows users to import, visualize, and analyze their location data. This document describes all user scenarios for comprehensive test coverage.
Application Context
- Purpose: Self-hosted alternative to Google Timeline/Location History
- Tech Stack: Rails 8, PostgreSQL, Hotwire (Turbo/Stimulus), Tailwind CSS with DaisyUI
- Key Features: Location tracking, data visualization, import/export, statistics, visits detection
- Deployment: Docker-based with self-hosted and cloud options
1. Authentication & User Management
1.1 User Registration (Non-Self-Hosted Mode)
Scenario: New user registration process
- Entry Point: Home page → Sign up link
- Steps:
- Navigate to registration form
- Fill in email, password, password confirmation
- Complete CAPTCHA (if enabled)
- Submit registration
- Receive confirmation (if email verification enabled)
- Validation: Email format, password strength, password confirmation match
- Success: User created, redirected to sign-in or dashboard
1.2 User Sign In/Out
Scenario: User authentication workflow
- Entry Point: Home page → Sign in link
- Steps:
- Navigate to sign-in form
- Enter email and password
- Optionally check "Remember me"
- Submit login
- Successful login redirects to map page
- Demo Mode: Special demo credentials (demo@dawarich.app / password)
- Sign Out: User can sign out from dropdown menu
1.3 Password Management
Scenario: Password reset and change functionality
- Forgot Password:
- Click "Forgot password" link
- Enter email address
- Receive reset email
- Follow reset link
- Set new password
- Change Password (when signed in):
- Navigate to account settings
- Provide current password
- Enter new password and confirmation
- Save changes
1.4 Account Settings
Scenario: User account management
- Entry Point: User dropdown → Account
- Actions:
- Update email address (requires current password)
- Change password
- View API key
- Generate new API key
- Theme selection (light/dark)
- Self-Hosted: Limited registration options
2. Map Functionality & Visualization
2.1 Main Map Interface
Scenario: Core location data visualization
- Entry Point: Primary navigation → Map
- Features:
- Interactive Leaflet map with multiple tile layers
- Time range selector (date/time inputs)
- Quick time range buttons (Today, Last 7 days, Last month)
- Navigation arrows for day-by-day browsing
- Real-time distance and points count display
2.2 Map Layers & Controls
Scenario: Map customization and layer management
- Base Layers:
- Switch between OpenStreetMap and OpenTopo
- Custom tile layer configuration
- Overlay Layers:
- Toggle points display
- Toggle route lines
- Toggle heatmap
- Toggle fog of war
- Toggle areas
- Toggle visits
- Layer Control: Expandable/collapsible layer panel
2.3 Map Data Display
Scenario: Location data visualization options
- Points Rendering:
- Raw mode (all points)
- Simplified mode (filtered by time/distance)
- Point clicking reveals details popup
- Battery level, altitude, velocity display
- Routes:
- Polyline connections between points
- Speed-colored routes option
- Configurable route opacity
- Route segment distance display
2.4 Map Settings & Configuration
Scenario: Map behavior customization
- Settings Available:
- Route opacity (0-100%)
- Meters between routes (distance threshold)
- Minutes between routes (time threshold)
- Fog of war radius
- Speed color scale customization
- Points rendering mode
- Help Modals: Contextual help for each setting
3. Location Data Import
3.1 Manual File Import
Scenario: Import location data from various sources
- Entry Point: Navigation → My data → Imports
- Supported Sources:
- Google Semantic History (JSON files)
- Google Records (Records.json)
- Google Phone Takeout (mobile device JSON)
- OwnTracks (.rec files)
- GeoJSON files
- GPX track files
- Process:
- Select source type
- Choose file(s) via file picker
- Upload and process (background job)
- Receive completion notification
3.2 Automatic File Watching
Scenario: Automatic import from watched directories
- Setup: Files placed in
/tmp/imports/watched/USER@EMAIL.TLD/ - Process: System scans hourly for new files
- Supported Formats: GPX, JSON, REC files
- Notification: User receives import completion notifications
3.3 Photo Integration Import
Scenario: Import location data from photo EXIF data
- Immich Integration:
- Configure Immich URL and API key in settings
- Trigger import job
- System extracts GPS data from photos
- Creates location points from photo metadata
- Photoprism Integration:
- Configure Photoprism URL and API key
- Similar process to Immich
- Supports different date ranges
3.4 Import Management
Scenario: View and manage import history
- Import List: View all imports with status
- Import Details: Points count, processing status, errors
- Import Actions: View details, delete imports
- Progress Tracking: Real-time progress updates via WebSocket
4. Data Export
4.1 Export Creation
Scenario: Export location data in various formats
- Entry Point: Navigation → My data → Exports
- Export Types:
- GeoJSON format (default)
- GPX format
- Complete user data archive (ZIP)
- Process:
- Select export format
- Choose date range (optional)
- Submit export request
- Background processing
- Notification when complete
4.2 Export Management
Scenario: Manage created exports
- Export List: View all exports with details
- Export Actions:
- Download completed exports
- Delete old exports
- View export status
- File Information: Size, creation date, download links
4.3 Complete Data Export
Scenario: Export all user data for backup/migration
- Trigger: Settings → Users → Export data
- Content: All user data, settings, files in ZIP format
- Use Case: Account migration, data backup
- Process: Background job, notification on completion
5. Statistics & Analytics
5.1 Statistics Dashboard
Scenario: View travel statistics and analytics
- Entry Point: Navigation → Stats
- Key Metrics:
- Total distance traveled
- Total tracked points
- Countries visited
- Cities visited
- Reverse geocoding statistics
- Display: Cards with highlighted numbers and units
5.2 Yearly/Monthly Breakdown
Scenario: Detailed statistics by time period
- View Options:
- Statistics by year
- Monthly breakdown within years
- Distance traveled per period
- Points tracked per period
- Actions: Update statistics (background job)
5.3 Statistics Management
Scenario: Update and manage statistics
- Manual Updates:
- Update all statistics
- Update specific year/month
- Background job processing
- Automatic Updates: Triggered by data imports
6. Trips Management
6.1 Trip Creation
Scenario: Create and manage travel trips
- Entry Point: Navigation → Trips → New trip
- Trip Properties:
- Trip name
- Start date/time
- End date/time
- Notes (rich text)
- Validation: Date ranges, required fields
6.2 Trip Visualization
Scenario: View trip details and route
- Trip View:
- Interactive map with trip route
- Trip statistics (distance, duration)
- Countries visited during trip
- Photo integration (if configured)
- Photo Display: Grid layout with links to photo sources
6.3 Trip Management
Scenario: Edit and manage existing trips
- Trip List: Paginated view of all trips
- Trip Actions:
- Edit trip details
- Delete trips
- View trip details
- Background Processing: Distance and route calculations
7. Visits & Places (Beta Feature)
7.1 Visit Suggestions
Scenario: Automatic visit detection and suggestions
- Process: Background job analyzes location data
- Detection: Identifies places where user spent time
- Suggestions: Creates suggested visits for review
- Notifications: User receives visit suggestion notifications
7.2 Visit Management
Scenario: Review and manage visit suggestions
- Entry Point: Navigation → My data → Visits & Places
- Visit States:
- Suggested (pending review)
- Confirmed (accepted)
- Declined (rejected)
- Actions: Confirm, decline, or edit visits
- Filtering: View by status, order by date
7.3 Places Management
Scenario: Manage detected places
- Place List: All places created by visit suggestions
- Place Details: Name, coordinates, creation date
- Actions: Delete places (deletes associated visits)
- Integration: Places linked to visits
7.4 Areas Creation
Scenario: Create custom areas for visit detection
- Map Interface: Draw areas on map
- Area Properties:
- Name
- Radius
- Coordinates (center point)
- Purpose: Improve visit detection accuracy
8. Points Management
8.1 Points List
Scenario: View and manage individual location points
- Entry Point: Navigation → My data → Points
- Display: Paginated table with point details
- Point Information:
- Timestamp
- Coordinates
- Accuracy
- Source import
- Filtering: Date range, import source
8.2 Point Actions
Scenario: Individual point management
- Point Details: Click point for popup with full details
- Actions:
- Delete individual points
- Bulk delete points
- View point source
- Map Integration: Points clickable on map
9. Notifications System
9.1 Notification Types
Scenario: System notifications for various events
- Import Notifications:
- Import completed
- Import failed
- Import progress updates
- Export Notifications:
- Export completed
- Export failed
- System Notifications:
- Visit suggestions available
- Statistics updates completed
- Background job failures
9.2 Notification Management
Scenario: View and manage notifications
- Entry Point: Bell icon in navigation
- Notification List: All notifications with timestamps
- Actions:
- Mark as read
- Mark all as read
- Delete notifications
- Delete all notifications
- Display: Badges for unread count
10. Settings & Configuration
10.1 Integration Settings
Scenario: Configure external service integrations
- Entry Point: Navigation → Settings → Integrations
- Immich Integration:
- Configure Immich URL
- Set API key
- Test connection
- Photoprism Integration:
- Configure Photoprism URL
- Set API key
- Test connection
10.2 Map Settings
Scenario: Configure map appearance and behavior
- Entry Point: Settings → Map
- Options:
- Custom tile layer URL
- Map layer name
- Distance unit (km/miles)
- Tile usage statistics
- Preview: Real-time map preview
10.3 User Settings
Scenario: Personal preferences and account settings
- Theme: Light/dark mode toggle
- API Key: View and regenerate API key
- Visits Settings: Enable/disable visit suggestions
- Route Settings: Default route appearance
11. Admin Features (Self-Hosted Only)
11.1 User Management
Scenario: Admin user management in self-hosted mode
- Entry Point: Settings → Users (admin only)
- User Actions:
- Create new users
- Edit user details
- Delete users
- View user statistics
- User Creation: Email and password setup
11.2 Background Jobs Management
Scenario: Admin control over background processing
- Entry Point: Settings → Background Jobs
- Job Types:
- Reverse geocoding jobs
- Statistics calculation
- Visit suggestion jobs
- Actions: Start/stop background jobs, view job status
11.3 System Administration
Scenario: System-level administration
- Sidekiq Dashboard: Background job monitoring
- System Settings: Global configuration options
- User Data Management: Export/import user data
12. API Functionality
12.1 Location Data API
Scenario: Programmatic location data submission
- Endpoints: RESTful API for location data
- Authentication: API key based
- Supported Apps:
- Dawarich iOS app
- Overland
- OwnTracks
- GPSLogger
- Custom applications
12.2 Data Retrieval API
Scenario: Retrieve location data via API
- Use Cases: Third-party integrations, mobile apps
- Data Formats: JSON, GeoJSON
- Authentication: API key required
13. Error Handling & Edge Cases
13.1 Import Errors
Scenario: Handle various import failure scenarios
- File Format Errors: Unsupported or corrupted files
- Processing Errors: Background job failures
- Network Errors: Failed downloads or API calls
- User Feedback: Error notifications with details
13.2 System Errors
Scenario: Handle system-level errors
- Database Errors: Connection issues, constraints
- Storage Errors: File system issues
- Memory Errors: Large data processing
- User Experience: Graceful error messages
13.3 Data Validation
Scenario: Validate user input and data integrity
- Coordinate Validation: Valid latitude/longitude
- Time Validation: Logical timestamp values
- File Validation: Supported formats and sizes
- User Input: Form validation and sanitization
14. Performance & Scalability
14.1 Large Dataset Handling
Scenario: Handle users with large amounts of location data
- Map Performance: Efficient rendering of many points
- Data Processing: Batch processing for imports
- Memory Management: Streaming for large files
- User Experience: Progress indicators, pagination
14.2 Background Processing
Scenario: Asynchronous task handling
- Job Queues: Sidekiq for background jobs
- Progress Tracking: Real-time job status
- Error Recovery: Retry mechanisms
- User Feedback: Job completion notifications
15. Mobile & Responsive Design
15.1 Mobile Interface
Scenario: Mobile-optimized user experience
- Responsive Design: Mobile-first approach
- Touch Interactions: Map gestures, mobile-friendly controls
- Mobile Navigation: Collapsible menus
- Performance: Optimized for mobile devices
15.2 Cross-Platform Compatibility
Scenario: Consistent experience across devices
- Browser Support: Modern browser compatibility
- Device Support: Desktop, tablet, mobile
- Feature Parity: Full functionality across platforms
Test Scenarios Priority
High Priority (Core Functionality)
- User authentication (sign in/out)
- Map visualization with basic controls
- Data import (at least one source type)
- Basic settings configuration
- Point display and interaction
Medium Priority (Extended Features)
- Trip management
- Visit suggestions and management
- Data export
- Statistics viewing
- Notification system
Low Priority (Advanced Features)
- Admin functions
- API functionality
- Complex map settings
- Background job management
- Error handling edge cases
Notes for Test Implementation
- Test Data: Use factory-generated test data for consistency
- API Testing: Include both UI and API endpoint testing
- Background Jobs: Test asynchronous processing
- File Handling: Test various file formats and sizes
- Responsive Testing: Include mobile viewport testing
- Performance Testing: Test with large datasets
- Error Scenarios: Include negative test cases
- Browser Compatibility: Test across different browsers