http://localhost:3000/heartbeats
This project is implemented with ExpressJS in TypeScript (backend/databse). And React (Frontend).
Make sure Node version > 18
"engines": {
"npm": ">=8.0.0",
"node": ">=18.0.0"
},
Backend build websocket connection to frontend. Then pull sensors data from database, generate heartbeats in random time based on sensor number.
Frontend render DOMs to display all sensors(users) status, at the same time send heartbeat data to database.
Database append heartbeat record, and update latest time in sensors.
Database entrypoint display if the sensor is updated in 10 mins. Otherwise will show offline.
Script will install all frontend/backend/database at one time.
npm run install
Script will run all frontend/backend/database concurrently.
npm run start
When frontend post data to database, sometimes database serve can't handle cocurrent requests. This will cause response missing error in browser console.