Giter Site home page Giter Site logo

covid-19's Introduction

Build Status

COVID-19 Backend Services

Contributing

Please keep the following in mind when submitting your valuable contributions 😊

  • Currently, all development is happening out of the master branch, so kindly fork it and make your changes there before submitting a PR.
  • If you've implemented a new API, update the readme and postman collection. This makes it so much easier for other developers to consume your APIs.
  • Rebase your code before submitting PRs: git pull --rebase upstream master ensures there are no conflicts and keeps the tree clean!
  • Comments are always encouraged - you never know who'll continue to work on your code next, so let's make their life a bit easier shall we 😉
  • Finally, see something wrong or have a suggestion? raise an issue so we can get working on it right away!

How to run

  • install mysql server

  • execute covid19.sql on server (execute covid19_test.sql to add test data)

  • replace the covid-19-lk-dev-firebase-adminsdk.json file in /src/main/resources/credentials/ with the private key from Firebase Admin SDK

  • build project using mvn clean install

  • run using: mvn spring-boot:run

APIs


Get Alert by Id

GET http://localhost:8000/application/alert/<alertId>/<lang>

options for lang: en, si, ta


Get Latest Alert Id

GET http://localhost:8000/application/alert/latest

returns integer as response


Add New Alert

POST http://localhost:8000/notification/alert/add 

{
   "title":"Test title",
   "subtitle":"Test subtitle",
   "source":"MOH",
   "messageEn":"This is a test message",
   "messageSi":"මෙය පරීක්ෂණ පණිවිඩයකි",
   "messageTa":"இது ஒரு சோதனை செய்தி"
}

Get Case By Id

GET http://localhost:8000/application/case/<caseId>/<lang>

options for lang: en, si, ta


Get Latest Case Id

GET http://localhost:8000/application/case/latest

returns integer as response


Add new Case

POST http://localhost:8000/notification/case/add

{
   "caseNumber":"DHIS/WP/COL/1234",
   "locations":[
      {
         "date":"2020/02/02",
         "from":"2020/02/02 00:00:00",
         "to":"2020/02/02 11:59:59",
         "address":"Colombo Municipal Council",
         "longitude":"1234",
         "latitude":"4321"
      },
      {
         "date":"2020/03/02",
         "from":"2020/03/02 13:00:00",
         "to":"2020/03/02 15:45:00",
         "address":"Galadari Hotel",
         "longitude":"1234",
         "latitude":"4321"
      }
   ],
   "message_en":"Person confirmed with COVID-19",
   "message_si":"COVID-19 සමඟ තහවුරු කළ පුද්ගලයා",
   "message_ta":"COVID-19 உடன் நபர் உறுதிப்படுத்தப்பட்டார்"
}

Get Status

GET http://localhost:8000/application/dashboard/status

If succeeded you should receive following JSON response with code 200:

{
    "lk_total_case": 99,
    "lk_recovered_case": 99,
    "lk_total_deaths": 99,
    "lk_total_suspect": 99,
    "last_update_time": "2020-03-17 15:10"
}

Update Dashboard Status

PUT http://localhost:8000/application/dashboard/status

{
    "lk_total_case": 98,
    "lk_recovered_case": 98,
    "lk_total_deaths": 99,
    "lk_total_suspect": 99
}

FCM Testing


GET /notification – Trigger sample notification with default values sending

curl -H "Content-Type: application/json" -X GET http://localhost:8000/notification

POST /notification/topic – Send a message to a specific topic

curl -d '{"title":"Hello", "message":"The message...", "topic":"contactTopic"}' -H "Content-Type: application/json" -X POST http://localhost:8000/notification/topic

POST /notification/token – Send a message to a specific device (with the token)

curl -d '{"title":"Hey you!", "message":"Watch out!", "token":"cct00ebz8eg:APA91bFcTkFE_0Qafj6nWv5yHxqCLTyxAaqi4QzwsFNLP5M9G78X8Z5UMZTW004q1PUux63Ut-1WMGVToMNTdB3ZfO8lCZlc4lGpxm7LBdWfkhaUxdbpQ5xIO5cAb-w9H2dBLNHT7i-U", "topic": ""}' -H "Content-Type: application/json" -X POST http://localhost:8080/notification/token

POST /notification/data – Send a message to a specific topic with additional payload data.

curl -d '{"title":"Hello", "message":"Data message", "topic":"contactTopic"}' -H "Content-Type: application/json" -X POST http://localhost:8000/notification/data

If succeeded you should receive following JSON response with code 200:

{
    "status": 200,
    "message": "Notification has been sent."
}

Web Portal UI

Getting started

Setting up Build system

  • In order to Setup You need to Run npm install to install all the dependencies.

  • Now Run npm run watch.

  • All of the following folders are monitored for changes, which will tell the browser to reload automatically after any changes are made: Resources>Js -Now you can edit any html file inside the resource.

  • Hit Ctrl+C or just close the command line window to stop the server.

Happy Contributing!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.