Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jersobh/rscue

Repository files navigation

RScue - RScue is an app for helping to give aid to victms and help the rescue on catastrophes

This project provides an API service for managing alerts. It is containerized with Docker for easy setup and deployment.

Getting Started

These instructions will cover usage information and for the docker container

Prerequisities

In order to run this container you'll need docker installed.

Usage

Container Parameters

List the different parameters available to your container

docker-compose up -d

This will start the service and expose the necessary ports.

Environment Variables

NODE_ENV

- A Node.js runtime environment variable that specifies if the environment is production or development. Default is production.

Volumes

  • /path/to/your/api/src: Mount point for the source code of the API.
  • /path/to/your/api/node_modules: Persistent storage for Node.js modules.

API Endpoints

Add an Alert

You can add an alert by making a POST request to /alerts with the required data:

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -23.55052,
"lng": -46.633308,
"event_name": "Road Block",
"type": "road-block",
"description": "A road block is reported",
"tags": ["accident", "block"],
"contact_number": "1122334455"
}'

Get All Alerts

Retrieve all alerts with a GET request:
curl http://localhost:3000/alerts

Other alert examples

alert-red

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -30.0277,
"lng": -51.2287,
"event_name": "Alerta Vermelho",
"type": "alert-red",
"description": "Emergência devido a inundação",
"tags": ["emergência", "inundação"],
"contact_number": "99887766"
}'

ambulance

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -26.3044,
"lng": -48.8456,
"event_name": "Ambulância Necessária",
"type": "ambulance",
"description": "Acidente grave necessitando ambulância",
"tags": ["acidente", "urgente"],
"contact_number": "99887755"
}'

blocked

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -25.4284,
"lng": -49.2733,
"event_name": "Rua Bloqueada",
"type": "blocked",
"description": "Árvore caída bloqueando a rua",
"tags": ["obstrução", "árvore caída"],
"contact_number": "99886644"
}'

missing-person

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -29.6842,
"lng": -53.8069,
"event_name": "Pessoa Desaparecida",
"type": "missing-person",
"description": "Menino desaparecido de 10 anos",
"tags": ["desaparecido", "criança"],
"contact_number": "99885533"
}'

road-block

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -27.5969,
"lng": -48.5495,
"event_name": "Bloqueio na Estrada",
"type": "road-block",
"description": "Construção causando bloqueio na estrada principal",
"tags": ["construção", "bloqueio"],
"contact_number": "99884422"
}'

warning-red-yellow

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -28.2620,
"lng": -52.4067,
"event_name": "Atenção: Perigo de Deslizamento",
"type": "warning-red-yellow",
"description": "Alerta de deslizamento nas encostas próximas",
"tags": ["alerta", "deslizamento"],
"contact_number": "99883311"
}'

alert

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -26.9206,
"lng": -49.0661,
"event_name": "Alerta Geral",
"type": "alert",
"description": "Teste de sistema de alerta público",
"tags": ["teste", "sirene"],
"contact_number": "99882200"
}'

atention

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
"lat": -25.5013,
"lng": -54.5786,
"event_name": "Atenção no Local",
"type": "atention",
"description": "Área de alto risco de acidente",
"tags": ["precaução", "acidente"],
"contact_number": "998811

caution

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -27.5954,
  "lng": -48.5480,
  "event_name": "Atenção: Zona de Cuidado",
  "type": "caution",
  "description": "Zona de cuidado devido a obras na estrada",
  "tags": ["cuidado", "obras"],
  "contact_number": "99880088"
}'

pets

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -29.1681,
  "lng": -51.1797,
  "event_name": "Animais Perdidos",
  "type": "pets",
  "description": "Dois cães encontrados sem dono",
  "tags": ["animais", "perdidos"],
  "contact_number": "99887744"
}'

help

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -30.0346,
  "lng": -51.2177,
  "event_name": "Solicitação de Ajuda",
  "type": "help",
  "description": "Família sem abrigo devido a incêndio",
  "tags": ["família", "abrigo"],
  "contact_number": "99889911"
}'

rescue

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -27.6344,
  "lng": -48.6784,
  "event_name": "Resgate Necessário",
  "type": "rescue",
  "description": "Pessoas presas devido a enchente",
  "tags": ["resgate", "enchente"],
  "contact_number": "99883344"
}'

sos

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -25.5163,
  "lng": -54.5854,
  "event_name": "Emergência SOS",
  "type": "sos",
  "description": "Sinal de emergência recebido, socorro necessário",
  "tags": ["sos", "socorro"],
  "contact_number": "99885566"
}'

shelter

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -29.6897,
  "lng": -53.8068,
  "event_name": "Abrigo Disponível",
  "type": "shelter",
  "description": "Abrigo temporário para pessoas sem teto",
  "tags": ["abrigo", "temporário"],
  "contact_number": "99882255"
}'

warning-red-yellow

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -27.1019,
  "lng": -52.6157,
  "event_name": "Alerta: Risco Moderado",
  "type": "warning-red-yellow",
  "description": "Risco moderado de deslizamento",
  "tags": ["deslizamento", "moderado"],
  "contact_number": "99887777"
}'

warning-yellow

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -28.2450,
  "lng": -52.4067,
  "event_name": "Alerta: Risco de Chuva Forte",
  "type": "warning-yellow",
  "description": "Previsão de chuva forte na região",
  "tags": ["chuva", "forte"],
  "contact_number": "99886699"
}'

warning

curl -X POST http://localhost:3000/alerts -H "Content-Type: application/json" -d '{
  "lat": -26.3044,
  "lng": -48.8456,
  "event_name": "Alerta Geral",
  "type": "warning",
  "description": "Alerta de perigo devido a tempestade",
  "tags": ["tempestade", "perigo"],
  "contact_number": "99881122"
}'

Built With

  • Node.js - The runtime server environment
  • Express - The web framework used
  • SQLite3 - Database engine

Authors

jersobh

About

RScue is an app for helping to give aid to victms and help the rescue on catastrophes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published