Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.
/ wiattend-srv Public archive

NodeJS server for RFID attendance system "wiattend"

License

Notifications You must be signed in to change notification settings

abobija/wiattend-srv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wiattend-srv

NodeJS server for RFID attendance system wiattend. Server uses MySQL database management system.

Usage

Run next commands for install dependencies and start the server

npm i
npm start

Abstraction

Demo

RFID Attendance System - ESP32 - NodeJS + MySQL

HTTP Routes

All routes returns response in JSON format.

  • GET /logs

    Returns

    Last 20 logs from database.

  • GET /tags

    Returns

    All tags from database.

  • POST /log

    Accept

    This route requires next HTTP headers:

    Header name Header value
    sguid 2ce81521-c42f-4556-8c28-c69d7e3a3a47
    rfid-tag Serial number of tag

    Returns

    Logged tag.

WebSocket events

All messages broadcasted to clients are formated in JSON style.

{
 "event": "event_name",
 "data": {}
}
  • logged

    Data of event logged represents logged tag. If next_direction proprety of logged tag is -1 that means the user of tag is now present, otherwise (if it is 1) user is absent.

    "event": "logged",
    "data": {
      "id": 3, 
      "uid": "0x79 0x09 0x08 0x85 0xFD", 
      "first_name": "Nikola", 
      "last_name": "Tesla", 
      "next_direction": 1
     }

Releases

No releases published

Packages

No packages published