QrUnlock: access Events
Control Access and Register Assistances to an Event
🎯Introduction
Hey pals 👋🏻.
I heard about the PlanetScale hackathon weeks ago and I this my first time participanting in a hackathon .
🤔 Concept
Access control is something that I like along with the use of Qr codes. Access control issue to a place is something recurring and observed in many places and situations for.
The objective is to be able to accept access to correctly identified users. You can use it for various places and situations depending on the complexity. From access to sectors such as Training, Education and Private
- Events
- Concerts
- Conferences
- Seminars
- Business.
- Hotels.
- Car parking.
QR Codes be used for attendance?
- Less physical contact with people
- Agility in marking user assistance at the entrance of the event
QR Code check-in system.
Consider 2 ways Select First one. I want a recurring group/audience and will have a database of user and with telegram is a easy way to get data.
Why Telegram?
- It is guaranteed that the user can register only once (unique identifier for chat).
- Easy and speed in registering a user.
- Notifications
- No less important i like automate things and telegram bots
⚙️ Tech Stack
Backend
- PlanetScale (MySQL database)
- Axios (HTTP request)
- NodeJS
- Telegram Bot
- Heroku (Deploy Bot)
Front
- Android App (Kotlin)
Apps
Telegram Bot.
- Register each user.
- Verify user data.
- Get QR for attendance
Android App.
For Scanning each user attendance
🤔 Struggles
- Upon startup plan to netlify with lambda function functions and limitation was MySQL database connection with that and I finished using heroku because of the experience in it
- Planetscale doesn't support FOREIGN KEY constraints. In that case I found the documentation that help me.
👁️🗨️ Demo
Telegram Bot acces with url web
inital step
Functions.
- Event Details: A website demo for details of Event
- Register Event: A User register to Event.
- My Qr: received my Qr Code for Attendance.( Please First register)
- Source Code: About PlanetScale hackathon and code.
Event Details:
Register Event:
My Qr Code
Source Code
⚓ Deployment
Deployment in Heroku and use a Telegram Bot:
- Register user to System(db in PlanetScale).
- Generate Qr code for each user.
An Android App.
- Verification of users
- registration of attendance at the Event
Connect to Server
PlanetScale Database
CREATE TABLE user (
id INT NOT NULL AUTO_INCREMENT,
chat_id VARCHAR(200) NOT NULL,
first_name VARCHAR(200) NOT NULL,
last_name VARCHAR(200) NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
updated_at DATETIME on UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
status BOOLEAN DEFAULT TRUE,
PRIMARY KEY (id),
UNIQUE idx_chatid_unique (chat_id(200))
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE event (
id INT NOT NULL AUTO_INCREMENT ,
event VARCHAR(255),
description VARCHAR(255),
event_date DATETIME,
end_date DATETIME,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
updated_at DATETIME on UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
CREATE TABLE attendance (
id INT NOT NULL AUTO_INCREMENT,
chat_id VARCHAR(200) NOT NULL,
event_id INT,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
updated_at DATETIME on UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY (id),
KEY user_id_idx (chat_id),
KEY event_id_idx (event_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Telegram Bot Configuration:
Why: for register user to event check availibity access to Event Received QR code in case Loose it
🔮 Future Scope
- I not expert in Web. Will be great make a Web App (Admin Portal/ and Event Portal for information) and keep Telegram for user Notifications.
- Hardware: Access Control QR Code RFID Reader Security Entrance in Hotels
-Potencial to other Projects: Concerts, Tickets Parking Pass, classroom.
🙏Final word
Using Qr Code is a physical to digital channel ideal for streamlining digital attendance tracking from physical touchpoints
Thanks to Hashnode x PlanetScale for giving an opportunity to work on this project.
Useful Links 🔗
Live Site Bot : t.me/QRUnlockBot
GitHub repositories: Qr Register Server Code Telegram