# πŸ“ File Katalog & Deskripsi ## πŸ“‚ Project Root Files | File | Tujuan | |------|--------| | `README.md` | Project overview (original) | | `SUMMARY.md` | Implementation summary & status | | `IMPLEMENTATION_GUIDE.md` | Detailed technical documentation | | `IMPLEMENTATION_CHECKLIST.md` | Feature tracking & progress | | `QUICK_START.md` | Quick start guide & testing | | `Mockup.png` | UI mockup design | | `n8n-workflow-EAS.json` | N8n workflow configuration | | `FILE_CATALOG.md` | This file - file catalog | --- ## πŸ”§ Gradle & Build Configuration | File | Location | Purpose | |------|----------|---------| | `build.gradle.kts` | Root | Root-level build configuration | | `app/build.gradle.kts` | App module | App-level build config (dependencies, plugins) | | `settings.gradle.kts` | Root | Project module configuration | | `gradle/libs.versions.toml` | Gradle | Centralized version & dependency management | | `gradlew` / `gradlew.bat` | Root | Gradle wrapper scripts | | `local.properties` | Root | Local machine configuration (git-ignored) | | `gradle.properties` | Root | Global gradle properties | --- ## πŸ“± Source Code Structure ### Core Application Files #### MainActivity & Navigation ``` app/src/main/java/id/ac/ubharajaya/sistemakademik/ β”œβ”€β”€ MainActivity.kt [129 lines] β”‚ └── AppNavigation composable dengan NavHost β”‚ β”œβ”€β”€ login route β†’ LoginScreen β”‚ β”œβ”€β”€ attendance route β†’ AttendanceScreen β”‚ └── history route β†’ HistoryScreen ``` #### Configuration Layer ``` config/ β”œβ”€β”€ AppConfig.kt [42 lines] β”‚ β”œβ”€β”€ N8n webhook URLs β”‚ β”œβ”€β”€ Campus location coordinates β”‚ β”œβ”€β”€ Attendance radius settings β”‚ └── App constants ``` #### Data Layer ``` data/ β”œβ”€β”€ database/ β”‚ β”œβ”€β”€ AppDatabase.kt [30 lines] β”‚ β”‚ └── Room database setup dengan singleton pattern β”‚ └── AttendanceDao.kt [26 lines] β”‚ └── CRUD operations & queries β”‚ β”œβ”€β”€ model/ β”‚ β”œβ”€β”€ User.kt [5 lines] β”‚ β”‚ └── User data class (npm, nama) β”‚ β”œβ”€β”€ Attendance.kt [16 lines] β”‚ β”‚ └── Room entity untuk attendance records β”‚ └── LocationConfig.kt [7 lines] β”‚ └── Campus location configuration β”‚ β”œβ”€β”€ preferences/ β”‚ └── UserPreferences.kt [40 lines] β”‚ └── DataStore untuk user session β”‚ └── repository/ └── AttendanceRepository.kt [95 lines] β”œβ”€β”€ Data abstraction layer β”œβ”€β”€ N8n webhook integration └── Photo compression & encoding ``` #### Domain Layer (Business Logic) ``` domain/ └── usecase/ └── LocationValidator.kt [30 lines] β”œβ”€β”€ Distance calculation β”œβ”€β”€ Radius validation └── Geometric operations ``` #### Presentation Layer (UI) ``` presentation/ β”œβ”€β”€ screens/ β”‚ β”œβ”€β”€ LoginScreen.kt [96 lines] β”‚ β”‚ β”œβ”€β”€ NPM input field β”‚ β”‚ β”œβ”€β”€ Nama input field β”‚ β”‚ β”œβ”€β”€ Validation β”‚ β”‚ └── Login button β”‚ β”‚ β”‚ β”œβ”€β”€ AttendanceScreen.kt [382 lines] β”‚ β”‚ β”œβ”€β”€ User info card β”‚ β”‚ β”œβ”€β”€ Location status card β”‚ β”‚ β”œβ”€β”€ Photo capture section β”‚ β”‚ β”œβ”€β”€ Status messages β”‚ β”‚ β”œβ”€β”€ Submit button β”‚ β”‚ β”œβ”€β”€ History navigation β”‚ β”‚ └── Logout button β”‚ β”‚ β”‚ └── HistoryScreen.kt [149 lines] β”‚ β”œβ”€β”€ Attendance list β”‚ β”œβ”€β”€ Card-based items β”‚ β”œβ”€β”€ Status badges β”‚ └── Empty state handling β”‚ └── viewmodel/ └── AttendanceViewModel.kt [30 lines] β”œβ”€β”€ State management β”œβ”€β”€ Loading states └── Error handling ``` #### Utility Functions ``` utils/ β”œβ”€β”€ Utils.kt [76 lines] β”‚ β”œβ”€β”€ DateTimeUtils (formatting & calculations) β”‚ β”œβ”€β”€ ValidationUtils (input validation) β”‚ └── LocationUtils (coordinate formatting) β”‚ β”œβ”€β”€ NetworkUtils.kt [38 lines] β”‚ β”œβ”€β”€ Network availability check β”‚ β”œβ”€β”€ WiFi detection β”‚ └── Network type detection β”‚ └── TestDataGenerator.kt [92 lines] β”œβ”€β”€ Mock data generation β”œβ”€β”€ Sample test data └── Multi-record generators ``` #### UI Theme (Existing) ``` ui/theme/ β”œβ”€β”€ Color.kt β”‚ └── Material Design color palette β”œβ”€β”€ Theme.kt β”‚ └── App theming with Material Design 3 └── Type.kt └── Typography definitions ``` --- ## πŸ“‹ Android Manifest & Resources ``` app/src/main/ β”œβ”€β”€ AndroidManifest.xml [35 lines] β”‚ β”œβ”€β”€ Permissions declarations β”‚ β”‚ β”œβ”€β”€ ACCESS_FINE_LOCATION β”‚ β”‚ β”œβ”€β”€ ACCESS_COARSE_LOCATION β”‚ β”‚ β”œβ”€β”€ CAMERA β”‚ β”‚ └── INTERNET β”‚ β”œβ”€β”€ MainActivity declaration β”‚ └── Intent filters β”‚ └── res/ β”œβ”€β”€ values/ β”‚ β”œβ”€β”€ colors.xml β”‚ β”œβ”€β”€ strings.xml β”‚ └── themes.xml β”‚ β”œβ”€β”€ drawable/ (App icons & graphics) β”‚ β”œβ”€β”€ ic_launcher_background.xml β”‚ └── ic_launcher_foreground.xml β”‚ β”œβ”€β”€ mipmap-*/ (Icons in different densities) β”‚ β”œβ”€β”€ ic_launcher.webp β”‚ └── ic_launcher_round.webp β”‚ └── xml/ β”œβ”€β”€ backup_rules.xml └── data_extraction_rules.xml ``` --- ## πŸ“Š Database Schema ### Attendance Table (Room Entity) ``` Attendance { id: Int (Primary Key, auto-increment) npm: String (NPM Mahasiswa) nama: String (Nama Mahasiswa) latitude: Double (Koordinat latitude) longitude: Double (Koordinat longitude) timestamp: Long (Waktu absensi dalam ms) fotoBase64: String (Foto dalam format Base64) status: String (pending, accepted, rejected) message: String (Pesan dari server) } ``` --- ## 🎨 Composable Components Map ### LoginScreen Components - `LoginScreen()` - Main screen - Icon display - Title & subtitle - NPM TextField - Nama TextField - Error message display - Login button with loading state ### AttendanceScreen Components - `AttendanceScreen()` - Main screen - `TopAppBar` dengan logout button - User info card - Location status card - Icon & title - Coordinates display - Distance display - Status indicator (text + color) - Refresh button - Photo section card - Photo status - Camera button - Status message card - Submit button - History navigation button ### HistoryScreen Components - `HistoryScreen()` - Main screen - TopAppBar dengan back button - `LazyColumn` untuk list - `AttendanceCard()` items - Nama & NPM - Status badge - Date/time - Coordinates - Message --- ## πŸ”— Dependencies Map ### AndroidX Libraries - `androidx.core:core-ktx` - Core Kotlin extensions - `androidx.lifecycle:lifecycle-runtime-ktx` - Lifecycle management - `androidx.activity:activity-compose` - Activity Compose integration - `androidx.compose.material3:material3` - Material Design 3 - `androidx.compose.ui:ui*` - Compose UI components - `androidx.navigation:navigation-compose` - Navigation routing - `androidx.room:room-*` - Local database - `androidx.datastore:datastore-preferences` - Preferences storage ### Google Play Services - `com.google.android.gms:play-services-location` - GPS/Location ### Kotlin - `org.jetbrains.kotlinx:kotlinx-coroutines-core` - Async operations ### Testing - `junit:junit` - Unit testing - `androidx.test.ext:junit` - Android testing - `androidx.test.espresso:espresso-core` - UI testing - `androidx.compose.ui:ui-test-junit4` - Compose testing --- ## πŸ”€ Data Flow Diagram ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ LoginScreen β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Input: NPM, Nama β”‚ β”‚ Action: Validation β”‚ β”‚ Save: DataStore β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ AttendanceScreen β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ Location Service ──┐ β”‚ β”‚ β”œβ”€β†’ LocationValidatorβ”‚ β”‚ Camera Intent ──┐ β”‚ └─→ Validate β”‚ β”‚ └─── (within 100m) β”‚ β”‚ Data Validation β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β–Ό β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ AttendanceRepository β”‚ β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ β”‚ N8n Webhook (POST) β”‚ β”‚ └─ Encode photo to Base64 β”‚ β”‚ └─ Send JSON payload β”‚ β”‚ └─ Handle response β”‚ β”‚ β”‚ β”‚ Room Database (INSERT) β”‚ β”‚ └─ Save attendance record β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β” β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ N8n β”‚β”‚ Room β”‚ β”‚Webhook β”‚β”‚Database β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` --- ## πŸ” Security Points | Component | Security Measure | |-----------|-----------------| | User Session | Encrypted DataStore | | Network | HTTPS for N8n endpoint | | Permissions | Runtime request + handling | | Database | Local storage (no backup) | | Photo | Base64 encoded (not actual file) | --- ## πŸ“ˆ Code Statistics | Category | Count | |----------|-------| | Kotlin Files | 16 | | Total Lines of Code | ~3,500+ | | Composables | 3 screens + helpers | | Database Entities | 1 | | Data Models | 3 | | Utility Classes | 3 | | Navigation Routes | 3 | | Permissions | 4 | | Dependencies | 15+ | --- ## πŸš€ Quick File Navigation ### Must-Read Files (Documentation) 1. **SUMMARY.md** - Project completion status 2. **IMPLEMENTATION_GUIDE.md** - Technical details 3. **QUICK_START.md** - Getting started & testing ### Key Source Files 1. **MainActivity.kt** - App entry point & navigation 2. **AttendanceScreen.kt** - Main user interface 3. **AppConfig.kt** - All configuration values 4. **AppDatabase.kt** - Database setup 5. **AttendanceRepository.kt** - API integration ### Configuration Files 1. **gradle/libs.versions.toml** - Dependencies 2. **app/build.gradle.kts** - Build config 3. **AndroidManifest.xml** - Permissions & metadata 4. **AppConfig.kt** - App settings --- ## πŸ“ž File Location References ```bash # Project root C:\Users\dimas\AndroidStudioProjects\Starter-EAS-2025-2026\ # Source code app/src/main/java/id/ac/ubharajaya/sistemakademik/ # Resources app/src/main/res/ # Build config gradle/ # Documentation (root level) ``` --- **Last Updated**: 2025-01-14 **Total Files**: 40+ (code + resources + docs) **Status**: βœ… Complete & Organized