How bsoc-bitbyte/digigate works
Project type and purpose
• DigiGate is a full-stack Android application (Kotlin + Jetpack Compose) following an MVVM pattern.
• Purpose: enable students to generate QR passes, guards to scan them, and admins to view real-time entry logs, all backed by Firebase services.
File structure
• Top-level “app” module contains the entire Android codebase.
• src/main/java/com/tpc/digigate/application: custom Application class for Hilt setup
• src/main/java/com/tpc/digigate/data: data layer (Firebase auth & Firestore, local Room/ DataStore)
• src/main/java/com/tpc/digigate/domain: business models, repository interfaces, and use cases
• src/main/java/com/tpc/digigate/di: Hilt modules for dependency injection
• src/main/java/com/tpc/digigate/ui: UI layer (components, navigation, screens, view models)
• Build scripts, ProGuard rules, and resources are standard for Android.
README for additional insights
• Confirms MVVM + StateFlow, Jetpack Navigation, Hilt, Firebase Auth/Firestore/Storage.
• Three user roles/flows: Students (QR generation), Guards (QR scanning), Admins (dashboard).
a. Main components:
• Android App (UI Layer: Compose Screens + Navigation)
• ViewModel Layer (StateFlow + live data)
• Domain Layer (UseCases + Models)
• Data Layer:
– Firebase Auth (Auth service)
– Firebase Firestore (real-time logs)
– Firebase Storage (profile pics or scanned data)
– Local Storage (Room DB for caching history, DataStore for preferences)
• External Services: Firebase suite
• Roles / Clients: Student Device, Guard Device, Admin Dashboard (either within same app or web console)
b. Relationships and interactions:
1. UI → ViewModel: user actions (generate QR, scan QR, view logs)
2. ViewModel → UseCase: dispatch business logic
3. UseCase → Repository Interface (domain)
4. Repository Implementation (data) → Data Sources (Firebase, Room, DataStore)
5. Firebase Firestore ↔ App: push real-time updates, Admin pulls logs
6. Local DB / DataStore: read/write for offline cache and preferences
c. Architectural patterns and principles:
– MVVM: clear separation of UI, business logic, and data
– Clean architecture layering: UI → domain → data
– Dependency injection via Hilt to decouple implementations
– Single-source-of-truth: Firestore + local cache
d. Key technologies:
– Kotlin + Jetpack Compose (UI)
– StateFlow (reactive state)
– Hilt (DI)
– Jetpack Navigation 3
– Firebase Auth, Firestore, Storage
– Room (AppDatabase) & DataStore (AppPreferences)
Elements
• Labels: name each component (e.g., “LoginViewModel”, “AuthRepositoryImpl”, “FirestoreDataSource”)
• Rectangles for code modules/layers
• Clouds for external services (Firebase Auth/Firestore/Storage)
Detail without overthinking
• Break the system into these core layers and components.
• Every layer’s components and how they communicate.