flowchart TD
classDef entity fill:#fff,stroke:#000,stroke-width:2px,color:#000,font-weight:bold
classDef process fill:#fff,stroke:#000,stroke-width:2px,color:#000,font-weight:bold
classDef datastore fill:transparent,stroke:none,color:#000,font-weight:bold
%% Entitas Eksternal
Admin["Admin (Dashboard)"]:::entity
Occupant["Penghuni"]:::entity
ESP["Alat Scan Pintu (ESP32)"]:::entity
%% Proses Inti
P1(("1. Pendataan Penghuni")):::process
P2(("2. Autentikasi Akses Pintu")):::process
P3(("3. Pencatatan Kehadiran")):::process
P4(("4. Penyiaran Notifikasi")):::process
%% Data Store
D1["
"]:::datastore
D2["
"]:::datastore
%% 1. Alur Manajemen Data
Admin -->|"Input Profil Baru / Ubah"| P1
P1 -->|"Simpan Profil"| D1
D1 -->|"Baca Daftar Profil"| P1
P1 -->|"Tampil Data ke Dasbor"| Admin
%% 2. Alur Scanning Pintu
Occupant -->|"Pindai Jari / Wajah"| ESP
ESP -->|"Kirim Identitas Scan"| P2
D1 -->|"Validasi Identitas"| P2
P2 -->|"Status Buka Pintu"| ESP
ESP -->|"Pintu Terbuka"| Occupant
%% 3. Alur Pencatatan Log
P2 -->|"Kirim Status Keberhasilan"| P3
P3 -->|"Catat Waktu Kehadiran"| D2
D2 -->|"Baca Rekapitulasi"| P3
P3 -->|"Tampil Laporan Absensi"| Admin
%% 4. Alur Pemberitahuan
D2 -->|"Aktivitas Akses Masuk Baru"| P4
P4 -->|"Kirim Pesan Pop-up (Realtime)"| Admin
linkStyle default stroke:#000,stroke-width:2px,color:#000