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 masterensures 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!
- install mysql server
- execute
covid19.sqlon server (executecovid19_test.sqlto add test data)
- replace the
covid-19-lk-dev-firebase-adminsdk.jsonfile in/src/main/resources/credentials/with the private key from Firebase Admin SDK - run using:
mvn spring-boot:run - change
firebase.topicinapplication.ymlaccordingly.mobile_messageis used for production andmobile_message_testis used for testing
- build project using
mvn clean install - copy
application.ymlto the folder where the jar is (targetif it has not been moved) - Replace
/src/main/resources/credentials/covid-19-lk-dev-firebase-adminsdk.jsonwith a valid credential file. - go into the folder where the jar is (eg.
cd target) - run
java -jar covid19-1.0.0-SNAPSHOT.jar. Check if the jar version matches. - NOTE: access logs will get stored in the tomcat folder (tomcat/access/). These logs can be disabled from the application.yml
- build project using
mvn clean install - unzip the
target/covid19-1.0.0-SNAPSHOT.ziptotarget/covid19-1.0.0-SNAPSHOT - modify the db url in the application.yml (replace localhose with container name) as below (FIXME: automate with spring profiles)
url: jdbc:mysql://db:3306/covid19_db?useUnicode=yes&characterEncoding=UTF-8- run
docker-compose up -d, make sure that ports 8000 and 3306 are not used in the local machine - connect to dockerized mysql localhost:3306/covid19_db and execute
covid19.sqlon server (executecovid19_test.sqlto add test data)
GET http://localhost:8000/application/alert/<alertId>/<lang>
options for lang: en, si, ta
GET http://localhost:8000/application/alert/latest
returns integer as response
POST http://localhost:8000/notification/alert/add
{
"title":"Test title",
"subtitle":"Test subtitle",
"source":"MOH",
"messageEn":"This is a test message",
"messageSi":"මෙය පරීක්ෂණ පණිවිඩයකි",
"messageTa":"இது ஒரு சோதனை செய்தி"
}
GET http://localhost:8000/application/case/<caseId>/<lang>
options for lang: en, si, ta
GET http://localhost:8000/application/case/latest
returns integer as response
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 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"
}
PUT http://localhost:8000/application/dashboard/status
{
"lk_total_case": 98,
"lk_recovered_case": 98,
"lk_total_deaths": 99,
"lk_total_suspect": 99
}
-
In order to Setup You need to Run
npm installto 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.
- Create a html file in
src/main/resources/templates/ - Create an endpoint in
WebPortalControllerto serve the web page - The endpoint must return a string which is the name of the html file (eg.
loginfor login.html)
Happy Contributing!