Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/albinvar/smart-lock-uno-laravel

Web Module for Smart Lock Uno: Simplify control and management of your smart lock system with this intuitive web interface.
https://github.com/albinvar/smart-lock-uno-laravel

api facial-recognition iot iot-application iot-device iot-prototype jetstream laravel livewire php prototype rfid smart-lock smart-lock-uno web web-api

Last synced: 3 days ago
JSON representation

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

Awesome Lists containing this project

README

        






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](https://lock.lov3.pw) is hosted for FREE ๐Ÿ’ on [Wexron Hosting](https://wexronhosting.com).

## 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](https://github.com/albinvar/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](https://github.com/albinvar/smart-lock-uno) 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](https://github.com/albinvar/smart-lock-uno), 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](https://github.com/albinvar/smart-lock-uno) installed and configured properly.

## Installation โš™๏ธ

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

- Clone the repository:
```bash
git clone https://github.com/your/repository.git
```

- Install the dependencies:
```bash
cd smart-lock-web-module
composer install
```

- Install Node dependencies:
```bash
#using npm
npm install ๐Ÿ“ฆ
#using yarn (recommended)
yarn install ๐Ÿงถ
#using pnpm
pnpm install ๐Ÿญ
```

- Configure the environment variables:
```bash
cp .env.example .env
```

- Generate the application key:
```bash
php artisan key:generate
```

- Configure the API endpoint for the smart-lock:
```bash
API_ENDPOINT=http://127.0.0.1:5000
```

- Compile your CSS / JavaScript for development and recompile on change. **(for developers)**
```bash
# npm ๐Ÿ“ฆ
npm run dev
# yarn ๐Ÿงถ
yarn dev
# pnpm ๐Ÿญ
pnpm dev
```
OR

- Compile your CSS / JavaScript for production...
```bash
# npm ๐Ÿ“ฆ
npm run build
# yarn ๐Ÿงถ
yarn build
# pnpm ๐Ÿญ
pnpm build
```

- Run the development server:
```bash
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](https://github.com/albinvar/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](https://github.com/albinvar/smart-lock-uno) are used to communicate with the lock mechanism.

> NB: The following API endpoints is being integrated from [smart-lock-uno](https://github.com/albinvar/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:

- Name: **Albin Varghese**
- Email: [email protected]

[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/albinvar)

## 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.