Skip to content
cic1337xdaPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

VAULT-3 Security Logo

VAULT-3

Next-Gen Multi-Factor IoT Access Security & Intruder Surveillance System

Architecture FastAPI PostgreSQL MQTT Docker

VAULT-3 is an enterprise-grade IoT physical access control and security surveillance solution. It pairs an ESP32 Multi-Factor Smart Door Controller and an ESP32-CAM Perimeter Surveillance Camera with a containerized FastAPI + PostgreSQL + Mosquitto cloud backend and a Liquid Glass administrative web portal.


📑 Language Options


🏛️ High-Level System Architecture

+---------------------------------------------------------------------------------------------------+
|                                       VAULT-3 SYSTEM OVERVIEW                                     |
+---------------------------------------------------------------------------------------------------+

     [ PERIMETER DOOR HARDWARE ]                                      [ CLOUD & SERVER STACK ]
     Folder: esp32-code/                                              Folder: vault-3/

 +---------------------------------+                             +---------------------------------+
 |      ESP32 DOOR CONTROLLER      |                             |       ECLIPSE MOSQUITTO         |
 |  - RC522 RFID (SPI VSPI)        |   MQTT (Port 1893 / TCP)    |       MQTT BROKER (v2.0)        |
 |  - AS608 Fingerprint (UART2)    | <=========================> |  - Bidirectional Telemetry      |
 |  - 4x4 Matrix Keypad (I2C)      |     KeepAlive 15s / LWT     |  - Universal & Direct Topics    |
 |  - 16x2 Character LCD (I2C)     |                             |  - Retained Hardware Heartbeats |
 |  - 12V Solenoid Relay (Active-L)|                             +---------------------------------+
 |  - Inside Exit Button           |                                              |
 |  - Haptic Buzzer (GPIO 25)      |                                              v
 +---------------------------------+                             +---------------------------------+
                                                                 |      FASTAPI BACKEND (8060)     |
                                                                 |  - Async SQLAlchemy + asyncpg   |
 +---------------------------------+                             |  - 25s Hardware Offline Watchdog|
 |        ESP32-CAM NODE           |                             |  - Intruder Photo Processing    |
 |  - OV2640 2MP Camera Sensor     |                             |  - Resend Email OTP Dispatcher  |
 |  - High-Power Flash Lamp        |   MQTT Snapshot Stream      +---------------------------------+
 |  - DMA Buffer Flush on Alert    | ==========================>                  |
 |  - Base64 JPEG Transmission     |                                              +-----------------+
 +---------------------------------+                                              |                 |
                                                                                  v                 v
                                                                        +------------------+ +--------------+
                                                                        |  POSTGRESQL 16   | | LIQUID GLASS |
                                                                        |  DATABASE (5460) | | WEB UI (3020)|
                                                                        |  Asia/KL (GMT+8) | | Nginx Alpine |
                                                                        +------------------+ +--------------+

🔌 Hardware Breadboard & Circuit Wiring (Fritzing)

The entire physical access controller circuitry—combining the ESP32, RC522 RFID reader, AS608 optical fingerprint sensor, PCF8574 I2C keypad, 16x2 LCD display, 12V solenoid strike relay, inside exit button, and haptic buzzer—is fully modeled in Fritzing:

VAULT-3 ESP32 Doorlock Fritzing Circuit Diagram


🔑 Key Features & Security Mandates

1. 3-Layer Multi-Factor Authentication (MFA)

Access is granted through strict two-factor verification combinations:

  • Combination A: RFID + Fingerprint (Something You Have + Something You Are)
  • Combination B: RFID + Keypad PIN (Something You Have + Something You Know)
  • Combination C: Fingerprint + Keypad PIN (Something You Are + Something You Know)

2. Zero-Collision Keypad Locking

  • The keypad is strictly locked during idle state.
  • Users must identify themselves first using RFID or Fingerprint. Only after the identity is registered is the keypad unlocked to accept that user's PIN.
  • Completely resolves credential collision where two users share the same PIN (e.g. 123456) and blocks physical brute-force guessing.

3. Intruder Lockout Protocol (Force-Lock)

  • Upon 3 consecutive failed attempts, the system automatically engages STATE_FORCE_LOCKED.
  • The solenoid lock deadbolts, an ear-piercing continuous siren sounds for 5 seconds, and an alert is broadcast via MQTT.
  • The ESP32-CAM flashes its illumination lamp, purges stale camera DMA buffers, snaps an instant photograph, and streams it to the web dashboard.
  • Standard keys and PINs are rejected. Access can only be restored by tapping the physical Master Override RFID Card.

4. Real-Time Hardware LWT & 25-Second Watchdog

  • Both ESP32 nodes register a Last Will and Testament (LWT) with the broker.
  • If a controller is disconnected or power is cut, Mosquitto releases the LWT ({"status":"OFFLINE","online":false}) within 15–22 seconds.
  • The backend server runs an auxiliary 25-second asynchronous watchdog, ensuring the dashboard immediately flags dead devices as OFFLINE.

5. Liquid Glass Administrative Portal

  • Translucent Apple-grade visual ergonomics (dark mode, blur backdrops, Radix color precision).
  • Real-time door status dials, remote lock/unlock triggers, Master Card configuration, member enrollment wizard, and an interactive Intruder Photo Gallery.

📂 Repository Organization & Scoped Documentation

.
├── README.md                           # Master Project Overview (English)
├── README_MY.md                        # Master Project Overview (Bahasa Melayu)
├── .gitignore                          # Global git exclusion rules
│
├── esp32-code/                         # Embedded Hardware Firmwares (Symlinked as "esp32 code")
│   ├── PINOUT_AND_WIRING.md            # Hardware wiring & electrical schematics
│   ├── PINOUT_AND_WIRING_MY.md         # Pendawaian perkakasan & sambungan GPIO (BM)
│   ├── MQTT_SPECIFICATION.md           # MQTT topics, payloads & LWT specs
│   ├── MQTT_SPECIFICATION_MY.md        # Spesifikasi topik, payload MQTT & LWT (BM)
│   ├── AUTHENTICATION_AND_MFA.md       # Multi-factor logic, buzzer & Force-Lock
│   ├── AUTHENTICATION_AND_MFA_MY.md    # Logik pengesahan MFA, buzzer & Force-Lock (BM)
│   ├── FLASHING_AND_LIBRARIES.md       # Arduino IDE toolchain & library guide
│   ├── FLASHING_AND_LIBRARIES_MY.md    # Panduan flashing & library Arduino (BM)
│   ├── Production Code/                # Final verified production sketches
│   │   ├── esp32_door_controller/      # Door Controller (MFA, Buzzer, LWT, Relay)
│   │   └── esp32_cam_security/         # Surveillance Camera Node (Flash, Snapshot, LWT)
│   ├── Development Code/               # Development mirror matching production
│   └── Testing Code/                   # Hardware component diagnostic sketches
│
└── vault-3/                            # Containerized Cloud & Server Stack
    ├── DOCKER_AND_SERVICES.md          # Container topology, port mapping & commands
    ├── DOCKER_AND_SERVICES_MY.md       # Topologi kontena, pemetaan port & arahan (BM)
    ├── DATABASE_SCHEMA.md              # PostgreSQL tables, models & Alembic
    ├── DATABASE_SCHEMA_MY.md           # Skema pangkalan data PostgreSQL & migrasi (BM)
    ├── API_DOCUMENTATION.md            # REST API endpoints, parameters & schemas
    ├── API_DOCUMENTATION_MY.md         # Dokumentasi laluan REST API (BM)
    ├── SECURITY_AND_POLICIES.md        # HttpOnly cookies, CSRF, anti-brute force
    ├── SECURITY_AND_POLICIES_MY.md     # Polisi keselamatan & perlindungan ancaman (BM)
    ├── docker-compose.yml              # 4-Container production orchestration
    ├── .env.example                    # Clean environment configuration template
    ├── backend/                        # FastAPI, SQLAlchemy, Alembic, MQTT services
    ├── frontend/                       # Liquid Glass web portal (HTML5/CSS3/Vanilla JS)
    └── mqtt/                           # Mosquitto broker persistence and configuration

📖 Subsystem Documentation Directory

🔌 Embedded Hardware (esp32-code/)

🐳 Server, Cloud & Docker (vault-3/)


📄 License & Attribution

Developed for the Final Year Project (FYP) 2026–2027.
Built strictly adhering to Malaysian Standard Time (Asia/Kuala_Lumpur / GMT+8).

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages