Anti-Theft Locker System
An advanced, secure, and automated electronic locker management system featuring real-time authentication, tamper detection, security alerts, and a full-stack Python dashboard with SQLite logging.
- Overview
- Problem Statement
- Industry Relevance
- Key Features
- Tech Stack
- Project Architecture
- Folder Structure
- Installation & Setup
- How to Run
- Security Logic
- Testing Strategy
- Author
The Anti-Theft Locker System is designed to provide robust security for storage and valuable assets. By combining secure PIN/keypad authentication, a multi-tier failed attempt counter, an alarm trigger mechanism, and a web-based administrative dashboard, this project bridges the gap between traditional physical storage and modern IoT/Embedded systems.
Traditional lockers suffer from several limitations:
- Vulnerable mechanical keys or weak physical locks.
- Lack of automated monitoring and real-time tampering detection.
- Absence of digital audit trails or access logs for accountability.
This project solves these challenges by implementing electronic access control, state management, and real-time event logging.
This system has wide applications across multiple sectors:
- Banking & Finance: Securing safe deposit boxes and vault rooms.
- Corporate & Offices: Managing employee lockers and confidential storage.
- Retail & Logistics: Automated parcel delivery and secure merchandise pick-up lockers.
- Education & Public Spaces: Gym lockers, library secure cells, and campus storage units.
- Secure Authentication: 4-digit PIN verification with simulated keypad interface.
- Intrusion Prevention: 3-attempt lockout policy with instant alarm activation.
- Event Logging: SQLite-based persistent storage tracking all successful logins and security alerts.
- Real-Time Dashboard: Flask-powered web interface monitoring locker status, alarm triggers, and attempt counts.
- System Reset: Administrative reset feature to restore normal operational status.
- Language: Python 3.x
- Backend Framework: Flask (WSGI web server)
- Database: SQLite3 (Local lightweight storage)
- Frontend: HTML5, CSS3, JavaScript (Asynchronous REST API integration)
- Embedded Concepts: State machine logic, access control systems, event-driven architecture
[Keypad / Web UI] ──> [Flask REST API] ──> [Locker Controller / Auth Manager] ──> [SQLite Database Logs]
│
└──> [Lock / Alarm State Engine]
📁 Folder Structure
Plaintext
Anti-Theft-Locker-System/
│
├── backend/
│ ├── __init__.py
│ ├── locker_controller.py
│ ├── auth_manager.py
│ └── database.py
│
├── frontend/
│ ├── __init__.py
│ ├── app.py
│ ├── templates/
│ │ └── dashboard.html
│ └── static/
│ ├── css/
│ │ └── style.css
│ └── js/
│ └── script.js
│
├── data/
│ └── locker_logs.db
│
├── tests/
│ ├── test_auth.py
│ └── test_controller.py
│
├── requirements.txt
├── README.md
└── .gitignore
⚙️ Installation & Setup
Clone the Repository:
Bash
git clone https://github.com/dalimkumar452-sudo/Anti-Theft-Locker-System.git
cd Anti-Theft-Locker-System
Install Dependencies:
Bash
pip install -r requirements.txt
Set Python Path (if required on Windows PowerShell):
PowerShell
$env:PYTHONPATH = (Get-Location).Path
🚀 How to Run
Start the Application Server:
Bash
python -m frontend.app
Access the Dashboard:
Open your browser and navigate to:
Plaintext
[http://127.0.0.1:5000](http://127.0.0.1:5000)
Test Credentials:
Valid PINs configured in simulation: 1234, 5678, 0000.
🔒 Security Logic
Correct PIN: Unlocks the system, turns off alarms, resets the failed attempt counter, and logs a SUCCESS event.
Incorrect PIN: Increments the failed attempt counter and logs a FAILED event.
Threshold Breach (3 Attempts): Locks the system down, activates the security alarm, and logs a TAMPER_ALERT event.
🧪 Testing Strategy
Unit Tests: Verify individual modules (AuthManager, DatabaseManager).
Integration Tests: Test end-to-end API response cycles from frontend keypad input to SQLite state updates.
Negative Testing: Validate correct behavior upon entering invalid PIN sequences consecutively.
👤 Author
Dalim Kumar
B.Tech CSE
I. K. Gujral Punjab Technical University (IKGPTU)
GitHub: dalimkumar452-sudo