CafeMap is a web service that allows you search the coffee shop near you or the coffee shop located at targeted region. We use 3 API to provide you a information integration platform for cafe shop.
-
Short-term usability goals Integreted cafe nomad and the data of place api
-
API information
-
Name : Cafe nomad
-
Description : Open-source Cafe platform.
-
Name : place api
-
Description : We use the place API, which is supported by Google, to search regional cafe shop information on google map. However, due to this api is charable, we saved it in out database as cache and use vcr package to lower the request sending demand for our platform.
-
Name : google map
-
Description :
Get the users location. We will use the longitude and latitude of user to caculate the distance of the cofffee shops to recommended.
Web API that allows user search the local cafe store with abundant informations.
GET /
Status:
- 200: API server running (happy)
Looking for regional cafeshop.
Local:
POST http://0.0.0.0:9090/api/v1/cafemap/random_store?city=新竹
Heroku:
https://cafemap-api.herokuapp.com/api/v1/cafemap/random_store?city=新竹
Noting that the city names is limited in Traditional chinese for opensource version. Ex, 南投、新竹
Status
- 200: cafestores returned (happy)
- 404: city name or folder not found (sad)
- 500: problem may resulted from server side, kindly clear the cookie or use newest version browser (bad)
Searching all the stored cafemap infomation in database based on english city name in taiwan. such as, hsinchu
Local:
http://0.0.0.0:9090/api/v1/cafemap?city=hsinchu
Heroku:
https://cafemap-api.herokuapp.com/api/v1/cafemap?city=hsinchu
Status
- 404: store or city-specified or folder not found on database (sad)
- 500: server error: problems storing store (bad)
We implement k-means in python.
Local:
http://0.0.0.0:9090/api/v1/cafemap/clusters?city=新竹
Heroku:
https://cafemap-api.herokuapp.com/api/v1/cafemap/clusters?city=新竹
If there are no updates to the database, the cluster result will be cached in the frontend for at least 10 minutes.
To make the process more reactive, we have added a progress bar to show the user the progress of the time-consuming task. To improve concurrency, the backend worker will run the clustering task using AWS Simple Queue Service (SQS). This allows the user to do other things while waiting for the task to complete.
Development: DB_FILENAME: db/local/dev.db PLACE_TOKEN: CAFE_TOKEN: REPOSTORE_PATH: repostore
API_HOST: http://localhost:9000 force_ssl: false SESSION_SECRET: AWS_ACCESS_KEY_ID: AWS_SECRET_ACCESS_KEY: AWS_REGION: ap-northeast-1 CLUSTER_QUEUE: CafeMap_Cluster_dev CLUSTER_QUEUE_URL: https://sqs.{Region}.amazonaws.com/{number}/CafeMap_Cluster_dev
Test: DB_FILENAME: db/local/test.db PLACE_TOKEN: CAFE_TOKEN: REPOSTORE_PATH: repostore
API_HOST: http://localhost:9000 force_ssl: false SESSION_SECRET: AWS_ACCESS_KEY_ID: AWS_SECRET_ACCESS_KEY: AWS_REGION: {Region} CLUSTER_QUEUE: CafeMap_Cluster_test CLUSTER_QUEUE_URL: https://sqs.{Region}.amazonaws.com/{number}/CafeMap_Cluster_test
Production on Heroku: PLACE_TOKEN: CAFE_TOKEN: REPOSTORE_PATH: repostore
API_HOST: http://url.to.app force_ssl: false SESSION_SECRET: AWS_ACCESS_KEY_ID: AWS_SECRET_ACCESS_KEY: AWS_REGION: {Region} CLUSTER_QUEUE: CafeMap_Cluster_production CLUSTER_QUEUE_URL: https://sqs.{Region}.amazonaws.com/{number}/CafeMap_Cluster_production