How forifor/scoutingapp works
Main Components
• User Interface (Frontend): Represented by the Prototype layer (AppDelegate, SceneDelegate, PrototypeViews) and utilizing SwiftUI and UIKit. This layer is where users interact with the app.
• Business Logic / Core Modules (Backend within the iOS app): Under the “code/ScoutingApp/Core” directory you have distinct modules:
• Authentication (AuthenticationService.swift): Manages user login and account management.
• Database (FirebaseManager.swift & SyncManager.swift): Handles offline/online data synchronization and general database connections via Firebase.
• Models (Models.swift): Defines the data structures used throughout the application.
• Report (AnalyticsService.swift, ReportService.swift, RewardService.swift): Handles report generation, evaluation, statistics analysis, and rewards.
• Schedule (ScheduleService.swift): Manages game schedules and event details.
• Security (SecurityManager.swift): Provides encryption using AES-GCM and manages Firebase security rules.
• External Services:
• Firebase: Underpins authentication, Firestore/Storage, Functions, and security; it is a critical external infrastructure component.
• Testing and Documentation:
• Tests directory covers unit, integration, and UI tests ensuring multiple quality gates.
• The Docs and Design directories (including architecture.md, wireframes.md, etc.) provide supporting documentation and design guidelines that can be referenced to further detail component interactions.
Relationships and Interactions
• The UI/Presentation layer (Prototype) invokes ViewModels that interact with the Core services.
• Core service modules (e.g., Authentication, Database, Report, Schedule, and Security) encapsulate business logic and are interconnected. For instance, when a user creates a scouting report via the UI, the Report module validates input and interacts with the Database module (FirebaseManager/SyncManager) to store and sync data.
• The Authentication module interfaces directly with Firebase for user verification, while Security follows both encryption protocols and Firebase Security Rules.
• All modules use Combine or similar reactive approaches (as indicated by the tech stack) to handle data synchronization and asynchronous flows.
Architectural Patterns & Technologies
• MVVM separation: Clearly separate the Presentation (views) from the business logic (core modules) using ViewModels.
• Combine Framework: Represent asynchronous data flows and real-time sync between the app and Firebase.
• Firebase Integration: Show data and authentication flows between the mobile application’s core services and external Firebase services.
• SwiftUI/ UIKit usage in UI layer to demonstrate the modern UI components.