Skip to content

Web Module for Smart Lock Uno: Simplify control and management of your smart lock system with this intuitive web interface.

License

Notifications You must be signed in to change notification settings

albinvar/smart-lock-uno-laravel

Repository files navigation


Laravel Logo

πŸ’« πŸ¦‹ Smart Lock Uno - Web Module πŸ” ✨

Version 1.0.0 πŸ‘¨πŸ»β€πŸ’»

A smart lock system with facial recognition, RFID authentication, and web API control using Arduino Uno and Python



View Demo Β· Report Bug Β· Request Feature

The project demo is hosted for FREE πŸ’ on Wexron Hosting.

Table of contents 🌈

  1. About The Project
  2. Prerequisites
  3. Features
  4. Installation
  5. Usage
  6. Explanation
  7. Contributing
  8. License
  9. Contact
  10. Acknowledgments

Introduction

πŸ”’ The Smart Lock Uno Web Module is a simple and intuitive web interface designed to control and manage a smart lock system with multiple authentication methods.

This module is an integral part of the smart-lock-uno, offering a user-friendly web interface for controlling and managing a smart lock system.

πŸ’» Built on Laravel 10 πŸ¦„, It integrates with the project's web API to provide features such as lock and unlock functionality and intruder detection image display. The module utilizes Laravel Livewire for real-time page updates and Laravel Jetstream for rapid development. For installation and usage instructions, refer to the project's documentation.

Features ✨

✨ The Smart Lock Web Module offers the following features:

  • βš™οΈ Built on Laravel 10: The web module is developed using Laravel 10, the latest version of the popular PHP framework. Laravel 10 brings numerous enhancements, improved performance, and added features, making it a reliable choice for building smart lock systems.

  • πŸ”— Web API Integration: The module integrates with a web API provided by the smart lock system to control and monitor the lock.

  • πŸ”„ Real-time Page Updates: Leveraging Laravel Livewire, the web module provides real-time page updates, ensuring a seamless user experience.

  • πŸ”’ Lock and Unlock: Users can remotely lock and unlock the smart lock through the web interface.

  • πŸ“Έ Intruder Detection: The web module displays pictures of intruders captured by the smart lock system, providing visual evidence of unauthorized access attempts.

  • πŸš€ Laravel Jetstream Integration: The project utilizes Laravel Jetstream to simplify development and streamline processes, with much secure authentication and simplicity.

Prerequisites πŸ“‹

Before setting up the Smart Lock Web Module, ensure you have the following:

  • php 8.1+
  • composer 2.0 +
  • smart-lock-uno installed and configured properly.

Installation βš™οΈ

Follow these steps to set up the Smart Lock Web Module:

  • Clone the repository:
git clone https://github.com/your/repository.git
  • Install the dependencies:
cd smart-lock-web-module
composer install
  • Install Node dependencies:
#using npm
npm install πŸ“¦
#using yarn (recommended)
yarn install 🧢
#using pnpm
pnpm install 🍭
  • Configure the environment variables:
cp .env.example .env
  • Generate the application key:
php artisan key:generate
  • Configure the API endpoint for the smart-lock:
API_ENDPOINT=http://127.0.0.1:5000
  • Compile your CSS / JavaScript for development and recompile on change. (for developers)
# npm πŸ“¦
npm run dev
# yarn 🧢
yarn dev
# pnpm 🍭
pnpm dev

OR

  • Compile your CSS / JavaScript for production...
# npm πŸ“¦
npm run build
# yarn 🧢
yarn build
# pnpm 🍭
pnpm build
  • Run the development server:
php artisan serve
  • Access the Smart Lock Web Module: Open a web browser and visit http://localhost:8000.

Usage

πŸ”’ Lock and Unlock:

  • After accessing the dashboard, you can find controls to lock and unlock the smart lock.
  • Click on the respective buttons to perform the desired action.

πŸ“Έ Intruder Detection:

  • The web module displays pictures of intruders captured by the smart lock system.
  • Navigate to the bottom part to view the images and identify unauthorized access attempts.

Explanation πŸ‘©β€πŸš€

Web API (Flask) πŸ›Έ

The Web API is an additional authentication method that runs on a separate thread on smart-lock-uno and uses a Flask-based API. Its codes are located in the src/website.py file. The Web API listens actively on a specific port for requests and uses requests to communicate with the API. The Website API is accessible via a local server, but it is recommended to use port forwarding tools like ngrok or cloudflared tunnel to access it from the wide area network.

The Website API requires a token to authorize each request, ensuring that only authenticated users can access the API. Unlike other authentication methods, the Website API does not have a delay to keep the solenoid lock unlocked. Instead, the lock is enabled only when a specific lock action request is received.

One of the key advantages of the Website API is its ability to serve all the intruder images stored and served through the api. This feature allows users to view images of intruders and take appropriate action, such as notifying law enforcement. Additionally, the Website API provides an easy-to-use interface for interacting with the security system and monitoring its status.

API Documentation πŸ“ƒ

The following api endpoints on smart-lock-uno are used to communicate with the lock mechanism.

NB: The following API endpoints is being integrated from smart-lock-uno project.

HTTP Method Endpoint Parameters Description
GET /ping N/A Checks if the system is up and running.
POST /lock - action
- password (if action is unlock)
Locks or unlocks the solenoid lock
GET /intruders N/A Returns a list of images/frames captured for unauthorized persons
GET /intruders/{filename} filename Returns a specific image

Contributing 🌠

This project is open source and contributions are welcome. To contribute, please fork the repository, make your changes, and submit a pull request.

License πŸ“ƒ

This project is licensed under the MIT License. See the LICENSE file for more information.

Contact πŸ“ž

If you have any questions, feedback, or suggestions for this project, please feel free to contact us:

"Buy Me A Coffee"

Acknowledgments πŸ‘

This project was inspired by various smart lock projects available on the internet. Thanks to OpenCV Python and Flask for providing the tools necessary for facial recognition and web API authentication, respectively. Thanks to the Arduino community for providing helpful resources and support for this project. Additionally, thank you to ChatGPT, an AI language model trained by OpenAI, for generating helpful responses and contributing to the development of this project.

Releases

No releases published

Packages

No packages published

Languages