Our project is Bike Accident Detection.
Many individuals (elderly, cyclists, scooter users) are vulnerable to falls, which can lead to serious injuries.
Detect falls in real-time and initiate emergency protocols to help users who are incapacitated.
attached to a mobility device (bike, wheelchair, etc.).Detects falls and emits sound alarms. Automatically contacts emergency services if the user doesn’t respond within 30 seconds, using GPS for location tracking.
- Detection: Trigger alarms when an abrupt fall is detected.
- Emergency Alerts: Automatic emergency calls after 30 seconds with GPS location.
- Mobility Mode Customization: Switch between bike, wheelchair, scooter, etc., to optimize data processing.
- Surrounding ambient: detects the temperature, light, air humidity, etc. to display on the app
-
Clone the repository:
git clone https://github.com/yourusername/thingy-api-Yellow.git
-
Navigate to the project directory:
cd thingy-api-Yellow
Create a .env file in the root directory and add the following environment variables:
MONGODB_URI = ''
INFLUXDB_URI = ''
INFLUXDB_TOKEN = ''
INFLUXDB_ORG = ''
INFLUXDB_BUCKET = ''
MQTT_USR = ''
MQTT_PWD = ''
MQTT_SERVER = ''
MQTT_PORT =
JWT_SECRET = ''
Replace the placeholders with your actual configuration values.
make sure InfluxDB and MongoDB are running in the background.
For InfluxDB, it is necessary to do initial setup:
docker run -d -p 8086:8086 \
--name bike-influxdb \
-v "$PWD/data-influxdb:/var/lib/influxdb2" \
-v "$PWD/config-influxdb:/etc/influxdb2" \
-e DOCKER_INFLUXDB_INIT_MODE=setup \
-e DOCKER_INFLUXDB_INIT_USERNAME=admin \
-e DOCKER_INFLUXDB_INIT_PASSWORD=adminadmin \
-e DOCKER_INFLUXDB_INIT_ORG=Yellow \
-e DOCKER_INFLUXDB_INIT_BUCKET=YellowBucket \
-e DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=my-super-secret-auth-token \
influxdb:2
To run MongoDB:
docker run -d -p 27017:27017 \
--name bike-mongodb \
-v "$PWD/data-mongodb:/data/db" \
mongo:8.0.4Install dependencies:
npm installStart the server:
npm startThe API will be running at http://localhost:3000.
For production deployment, use Docker Compose:
docker-compose upRefer to the ASE2024-Yellow-Sprint1-API.yml and ASE2024-Yellow-Sprint2-API.yml files for detailed API endpoint information.
- controllers: contains implementation of API
- docs: contains some information for developers, e.g. how to use a certain package
- models: contains schemas for database
- mqtt: contains logics regarding MQTT
- routes: contains paths of API
- utils: contains some useful functions

