Part of the EasyAlarm project
Node.js/Express TypeScript API for the EasyAlarm hub. Manages authentication, units, profiles, logs, settings, and communicates with the middleware over a serial connection.
- JWT auth (access + refresh)
- Protected API routes under
/api/*withx-auth-tokenheader - MongoDB via Mongoose
- Serial communication with Arduino middleware (NRF24 bridge)
- Node.js 18+
- MongoDB instance
- Connected Arduino middleware device (via USB serial)
- Base path:
/api - Auth
POST /api/user/login→ returns{ accessToken, refreshToken, user }POST /api/user/refreshwith{ refreshToken }→ returns new tokens- Include
x-auth-token: <accessToken>for all protected routes
- Units:
/api/unit - Logs:
/api/log - Profiles:
/api/profile - Hub:
/api/hub(status/arm/disarm/panic) - Settings:
/api/settings - RFID:
/api/rfid
- 9600 baud, framing with
<(SOT) and>(EOT) - Payload fields delimited by
! - Example inbound from middleware:
<deviceId!payloadType!content> - Example outbound to middleware: wrapped with
<and>as well