2026-01-14 21:13:18 +07:00

11 KiB

📁 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

# 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