Provides a simple REST api for searching the firebase instance.
Installation of this API requires a working docker and docker-compose install. See steps below for details.
- Setup a working install of Docker (https://docs.docker.com/get-docker/)
- Setup a working install of docker-compose (https://docs.docker.com/compose/install/)
- Run
docker-compose up -dfrom the root of the cloned/extracted folder
The above docker-based installation automatically exposes port 8080 for the API and port 27017 for the MongoDB database to the localhost (i.e. these services can be accessed at localhost:8080 and localhost:27017). If either of these needed to be accessed externally to the host machine, the ports should be exposed in the firewall (i.e. port-forwarded). Please see the documentation for your computer/VM to see how to do this.
Must Set header
authorization: $firebase_user_tokenThis can be obtained in flutter using:
_getToken() async {
print(await FirebaseAuth.instance.currentUser!.getIdToken());
return {"authorization": await FirebaseAuth.instance.currentUser!.getIdToken()};
}Errors return an error message in the "error" field of the returned JSON map.
/activities/$id
/wanderlists/$id
/rewards/$idmethods: GET
Text query
/activities/?query=text queryBy location
/activities/?lat=10&lon=10?range=50The range is optional, and specified as a radius in kilometers of the specified location.
methods: GET
By Wanderlist
/activities/?wanderlist=<wanderlistid>For the authenticated user profile
/activities/?recmethods: GET, POST
The user is identified by the firebase user token.
/user
methods: GET
The points required for each new reward to be attained by users.
/user/rewards/totalpointsThe next recommended award
/user/rewards/nextmethods: GET, POST
/wanderlists/wanderlistid