# meehhmett/smart_locker_system architecture

> Architecture diagram of the GitHub repository meehhmett/smart_locker_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/meehhmett/smart_locker_system
- Repository: https://github.com/meehhmett/smart_locker_system

## Overview

Smart Locker is a Flutter-based locker rental and administration app paired with ESP32 hardware and Firebase. The documented workflow is: a user rents a locker and associates an RFID card in the app; Firebase stores the assignment and access data; the ESP32 checks authorization on card scans, actuates the lock, and updates status and activity records. The graph preserves the app’s user, admin, profile, and RFID areas. App and firmware source were not excerpted, so relationships below rely on the README rather than inspected implementation details.

Main entry points: [`esp32/src/main.cpp`](https://github.com/meehhmett/smart_locker_system/blob/main/esp32/src/main.cpp) (ESP32 firmware), [`lib/app/smart_locker_app.dart`](https://github.com/meehhmett/smart_locker_system/blob/main/lib/app/smart_locker_app.dart) (Flutter app), [`lib/app/auth_gate.dart`](https://github.com/meehhmett/smart_locker_system/blob/main/lib/app/auth_gate.dart) (Auth gate), [`lib/features/locker/presentation/request_locker_page.dart`](https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/locker/presentation/request_locker_page.dart) (Locker requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Flutter client"]
  node_app["Flutter app"]
  node_authgate["Auth gate<br/>[auth_gate.dart]"]
  node_login["Sign in / register"]
  node_locker["Locker dashboard"]
  node_rental["Locker requests"]
  node_mylocker["My locker"]
  node_rfid["RFID account<br/>[rfid_page.dart]"]
  node_admin["Admin management<br/>[admin_page.dart]"]
  node_profile["User profile<br/>[profile_page.dart]"]
  node_models["Locker models<br/>[locker_models.dart]"]
  node_activity["Activity records"]
end

subgraph group_cloud["Firebase services"]
  node_auth["Firebase Authentication"]
  node_database[("Realtime Database")]
end

subgraph group_controller["Locker controller"]
  node_esp["ESP32 firmware<br/>[main.cpp]"]
end

subgraph group_hardware["Physical access"]
  node_card(("RFID card"))
  node_reader["RC522 reader"]
  node_lock["Servo lock"]
  node_sensors["Door / status hardware"]
end

node_user(("User / admin"))

node_user -->|"uses"| node_app
node_app -->|"gates access"| node_authgate
node_authgate -->|"authenticates"| node_auth
node_user -->|"signs in"| node_login
node_user -->|"requests locker"| node_rental
node_rental -->|"stores assignment"| node_database
node_user -->|"associates card"| node_rfid
node_rfid -->|"stores association"| node_database
node_user -->|"views status"| node_locker
node_user -->|"views rental"| node_mylocker
node_user -->|"manages lockers"| node_admin
node_user -.->|"manages account"| node_profile
node_card -->|"scans at"| node_reader
node_reader -->|"sends scan"| node_esp
node_esp -->|"checks authorization"| node_database
node_esp -->|"unlocks"| node_lock
node_esp -->|"updates status"| node_database
node_esp -->|"writes activity"| node_database
node_esp -.->|"monitors door"| node_sensors
node_database -->|"syncs status"| node_locker
node_database -.->|"provides locker data"| node_models
node_activity -.->|"records actions"| node_database

click node_app "https://github.com/meehhmett/smart_locker_system/blob/main/lib/app/smart_locker_app.dart"
click node_authgate "https://github.com/meehhmett/smart_locker_system/blob/main/lib/app/auth_gate.dart"
click node_login "https://github.com/meehhmett/smart_locker_system/tree/main/lib/features/auth/presentation"
click node_locker "https://github.com/meehhmett/smart_locker_system/tree/main/lib/features/locker/presentation"
click node_rental "https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/locker/presentation/request_locker_page.dart"
click node_mylocker "https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/locker/presentation/my_locker_page.dart"
click node_rfid "https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/rfid/presentation/rfid_page.dart"
click node_admin "https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/admin/presentation/admin_page.dart"
click node_profile "https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/profile/presentation/profile_page.dart"
click node_models "https://github.com/meehhmett/smart_locker_system/blob/main/lib/core/models/locker_models.dart"
click node_activity "https://github.com/meehhmett/smart_locker_system/blob/main/lib/core/services/activity_log_service.dart"
click node_esp "https://github.com/meehhmett/smart_locker_system/blob/main/esp32/src/main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_authgate,node_login,node_locker,node_rental,node_mylocker,node_rfid,node_admin,node_profile,node_models,node_activity,node_user toneBlue
class node_auth,node_database toneAmber
class node_esp toneMint
class node_card,node_reader,node_lock,node_sensors toneRose
```

## Components

### Flutter client

- [Flutter app](https://github.com/meehhmett/smart_locker_system/blob/main/lib/app/smart_locker_app.dart): `lib/app/smart_locker_app.dart`
- [Auth gate](https://github.com/meehhmett/smart_locker_system/blob/main/lib/app/auth_gate.dart): `lib/app/auth_gate.dart`
- [Sign in / register](https://github.com/meehhmett/smart_locker_system/tree/main/lib/features/auth/presentation): `lib/features/auth/presentation`
- [Locker dashboard](https://github.com/meehhmett/smart_locker_system/tree/main/lib/features/locker/presentation): `lib/features/locker/presentation`
- [Locker requests](https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/locker/presentation/request_locker_page.dart): `lib/features/locker/presentation/request_locker_page.dart`
- [My locker](https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/locker/presentation/my_locker_page.dart): `lib/features/locker/presentation/my_locker_page.dart`
- [RFID account](https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/rfid/presentation/rfid_page.dart): `lib/features/rfid/presentation/rfid_page.dart`
- [Admin management](https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/admin/presentation/admin_page.dart): `lib/features/admin/presentation/admin_page.dart`
- [User profile](https://github.com/meehhmett/smart_locker_system/blob/main/lib/features/profile/presentation/profile_page.dart): `lib/features/profile/presentation/profile_page.dart`
- [Locker models](https://github.com/meehhmett/smart_locker_system/blob/main/lib/core/models/locker_models.dart): `lib/core/models/locker_models.dart`
- [Activity records](https://github.com/meehhmett/smart_locker_system/blob/main/lib/core/services/activity_log_service.dart): `lib/core/services/activity_log_service.dart`

### Firebase services

- **Firebase Authentication**
- **Realtime Database**

### Locker controller

- [ESP32 firmware](https://github.com/meehhmett/smart_locker_system/blob/main/esp32/src/main.cpp): `esp32/src/main.cpp`

### Physical access

- **RFID card**
- **RC522 reader**
- **Servo lock**
- **Door / status hardware**

### Other components

- **User / admin**

## Connections

- User / admin → Flutter app: uses (evidence: `README.md`)
- Flutter app → Auth gate: gates access (evidence: `README.md`)
- Auth gate → Firebase Authentication: authenticates (evidence: `README.md`)
- User / admin → Sign in / register: signs in (evidence: `README.md`)
- User / admin → Locker requests: requests locker (evidence: `README.md`)
- Locker requests → Realtime Database: stores assignment (evidence: `README.md`)
- User / admin → RFID account: associates card (evidence: `README.md`)
- RFID account → Realtime Database: stores association (evidence: `README.md`)
- User / admin → Locker dashboard: views status (evidence: `README.md`)
- User / admin → My locker: views rental (evidence: `README.md`)
- User / admin → Admin management: manages lockers (evidence: `README.md`)
- User / admin → User profile: manages account
- RFID card → RC522 reader: scans at (evidence: `README.md`)
- RC522 reader → ESP32 firmware: sends scan (evidence: `README.md`)
- ESP32 firmware → Realtime Database: checks authorization (evidence: `README.md`)
- ESP32 firmware → Servo lock: unlocks (evidence: `README.md`)
- ESP32 firmware → Realtime Database: updates status (evidence: `README.md`)
- ESP32 firmware → Realtime Database: writes activity (evidence: `README.md`)
- ESP32 firmware → Door / status hardware: monitors door
- Realtime Database → Locker dashboard: syncs status (evidence: `README.md`)
- Realtime Database → Locker models: provides locker data
- Activity records → Realtime Database: records actions
