Commit 4f118f1c authored by Andres Käver's avatar Andres Käver

hw2 backend initial

parent 87d5dbba
# HW2 - Backend
All projects:
https://git.akaver.com/com-akaver-sportmap
Full source code for the backend in visible here:
https://git.akaver.com/com-akaver-sportmap/sportmap-aspnet
ERD schema is simple:
* GpsSession - training sessions
* GpsLocation - locations for session (WP, CP, regular)
* GpsLocationType - LocationTypes for location
Base url for RESTful api: https://sportmap.akaver.com/api/
Create account, log in - get and save jwt.
POST https://sportmap.akaver.com/api/account/register
and
POST https://sportmap.akaver.com/api/account/login
There are 3 RESTful endpoints defined for your usage:
https://sportmap.akaver.com/api/GpsSessions
https://sportmap.akaver.com/api/GpsLocations
https://sportmap.akaver.com/api/GpsLocationTypes
Include jwt in every request header!
Authorization: Bearer lijvfvkdnvldnvsdcsv237eskdfn
Start a new session:
POST https://sportmap.akaver.com/api/GpsSessions
Payload in body as json:
~~~json
{
"name": "2020-04-15",
"description": "2020-04-15 evening run",
"recordedAt": "2020-04-15T23:41:57.352165+03:00",
}
~~~
Response will be:
~~~json
{
"name": "2020-04-15",
"description": "2020-04-15 evening run",
"recordedAt": "2020-04-15T23:41:57.352165+03:00",
"duration": 0,
"speed": 0,
"distance": 0,
"climb": 0,
"descent": 0,
"appUserId": "560b11c9-eea6-43a3-ca5b-08d7e1770ca9",
"id": "b310e8ce-eebd-47b0-91c3-08d7e17d70ab"
}
~~~~
Save the session id!
Get the list of location types (these are predefined in db)
GET https://sportmap.akaver.com/api/GpsLocationTypes
Response will be:
~~~~json
[
{
"name": "location",
"description": "regular location update",
"id": "b310e8ce-1234-47b0-91c3-08d7e17d70ab"
}
]
~~~~
Post the location updates to backend:
POST https://sportmap.akaver.com/api/GpsLocations
Payload in body as json:
~~~json
{
"recordedAt": "2020-04-15T23:51:57.352165+03:00",
"latitude": 23.456,
"longitude": 59.789,
"accuracy": 15.5,
"altitude": 75.7,
"verticalAccuracy": 13.9,
"gpsSessionId": "b310e8ce-eebd-47b0-91c3-08d7e17d70ab",
"gpsLocationTypeId": "b310e8ce-1234-47b0-91c3-08d7e17d70ab"
}
~~~
......@@ -43,7 +43,10 @@ Change app icon into something more meaningful.
***Waypoint - WP*** - temporary marker, used to measure smaller segments on terrain to find path to next CP. When placing new WP, previous one is removed. WPs do not get saved to DB.
***Backend service*** - Web-API/Rest service. Web based visualization of map and tracks on map (realtime).
Under development...
https://sportmap.akaver.com
https://git.akaver.com/iti0213-2019s/course-materials/-/blob/master/homeworks/HW2-backend.md
***Demo of Fused location in background foreground service***
https://git.akaver.com/iti0213-2019s/fusedlocationbackground2020
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment