The backend architecture and cross-platform mobile application for an IoT Smart Locker System, designed to facilitate secure, low-latency communication between mobile clients and ESP8266 microcontrollers. Built using Node.js, Express, MongoDB, and Flutter, this system manages user profiles, provisions embedded NFC card UIDs, and efficiently logs real-time access events via custom REST APIs and robust state management logic.
- Secure Remote Unlocking: Users can securely unlock their assigned lockers remotely from the mobile app via custom REST APIs.
- NFC Authentication Workflow: Supports physical NFC card tapping (Mifare RC522) with the ESP8266 microcontroller for instant physical access.
- Real-Time Access Logs: Comprehensive logging of all locker interactions (App Unlock, NFC Unlock, Admin overrides) stored efficiently in MongoDB.
- Admin Dashboard & Provisioning: Secure workflows for administrators to provision new users and assign NFC cards right from the app.
- Hardware Synchronization: Fault-tolerant communication logic between the Flutter frontend, Node.js backend, and the ESP8266 locker hardware.
Backend / Infrastructure
- Node.js & Express.js
- MongoDB (Mongoose ORM)
- Custom RESTful APIs
- JSON Web Tokens (JWT) for secure authentication
Frontend / Mobile Application
- Flutter (Dart)
- Cross-platform support (Android / iOS)
- Provider for state management
IoT & Hardware
- ESP8266 Microcontroller
- C++ (Arduino IDE)
- RFID RC522 Module (for NFC unlocking)
- Relay Modules (for electronic lock actuation)
IoT-Smart-Locker-System/
├── backend/ # Node.js, Express, and MongoDB backend code
├── frontend/ # Flutter cross-platform mobile application
└── firmware/ # C++ code for the ESP8266 and NFC modules
- Node.js (v14+)
- MongoDB running locally or remotely
- Flutter SDK installed
- Arduino IDE (for flashing the ESP8266)
cd backend
npm install
# Set up your .env file with your PORT and MONGO_URI
npm run devcd frontend
flutter pub get
# Update the API base URL in the frontend constants to point to your backend IP
flutter run- Open
firmware/esp8266_final/esp8266_final.inoin Arduino IDE. - Update the Wi-Fi credentials (
ssidandpassword). - Update the
backendUrlvariable to point to your live backend server IP. - Flash to your ESP8266.
Contributions, issues, and feature requests are welcome!
This project is licensed under the MIT License.