Employee Checkin using barcodes

Good day fellow ERPNext implemetors, users, sys admins…

I am trying to use a barcode scanner to record employee checkin and out as I’ve seen a Youtube video Attendance with Barcode scanner - YouTube.

I added a barcode field in the doctype and linked the Code39 barcode to the employee ID. I tried using Co-Pilot and other AI platforms to create a server script to do what it does in the video but nothing works. I have reached out to the owner of the video but no response. Anyone tried this method? If successfully can you please provide the script?