https://github.com/scriptscrypt/iot-monitor
This is the submission for Enview's BE test
https://github.com/scriptscrypt/iot-monitor
Last synced: 8 months ago
JSON representation
This is the submission for Enview's BE test
- Host: GitHub
- URL: https://github.com/scriptscrypt/iot-monitor
- Owner: scriptscrypt
- Created: 2023-09-25T14:28:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-25T15:21:06.000Z (over 2 years ago)
- Last Synced: 2025-06-26T03:41:59.488Z (12 months ago)
- Language: JavaScript
- Size: 4.57 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Enview BE - IOT Device
This Repository Demonstrates Event Schedulers for an automated IOT device that checks for Rash Driving of the Vehicle and Alerts the same.
## For Local Development
1. Clone this Repository
2. `yarn` or `npm install` - Install all the dependencies
3. `yarn dev` or `npm run dev` - Start the development server
4. Please use an API Client Like Postman to test all the APIs
Postman Link :
https://app.getpostman.com/join-team?invite_code=816b7bb0bf9d63e81a43391b91e47593&target_code=f32d201d85aa06f6f5f54ceb8270df48
## API Reference
#### Post the Event from the IOT Device
URL : http://localhost:3001/event
```http
POST /event
```
raw - json
{
"vehicle_id" : "KA05LC77XX",
"is_driving_safe" : "false",
"location_type" : "highway"
}
#### Get alert
```http
GET /alert/:alertId
```
| Parameter | Type | Description | Example |
| :-------- | :------- | :-------------------------------- | ------ |
| `alertId` | `string` | **Required**. alertId of the Alert to query the details | alertlCjBfCn8VmJr |
#### Get alert
```http
GET /event/all/:locationType
```
| Parameter | Type | Description | Example |
| :-------- | :------- | :-------------------------------- | ------ |
| `alertId` | `string` | **Required**. locationType of the Event to query the details | residential or highway or city_center |
## Demo
Short Demo : https://youtu.be/QGFTIELkQ0o
Detailed Explanation : https://youtu.be/wHO-2FptjBA
## Tech Stack
1. MongoDB
2. Node - Expressjs
3. Mongoose
4. Postman