From 246d14939707ee684ebee70b5838461b9ec9cc0f Mon Sep 17 00:00:00 2001 From: aabbaq <43639882+aabbaq@users.noreply.github.com> Date: Mon, 16 May 2022 13:07:25 +1000 Subject: [PATCH] Update README.md --- backend/README.md | 139 ++++++---------------------------------------- 1 file changed, 16 insertions(+), 123 deletions(-) diff --git a/backend/README.md b/backend/README.md index 4451ebc..e8add75 100644 --- a/backend/README.md +++ b/backend/README.md @@ -1,10 +1,10 @@ # RESTful backend: python + flask -## How to use (local for now) +## How to use ### Step 1 -#### Install required dependencies (for now) +#### Install required dependencies ```bash pip install -r requirements.txt @@ -12,7 +12,7 @@ ### Step 2 -#### Start Flask Server (local test for now) +#### Start Flask Server ```bash cd ./backend python3 app.py @@ -23,137 +23,30 @@ sh ./docker-run.sh ``` -## API URL (local for now) +## API URL -#### Only GET methods are allowed (for now?) +#### Only GET methods are allowed ``` - http://localhost:5000/api/api-type/data-type// + http://Host:Port/api/api-type/data-type/selected-view + http://Host:Port/api/api-type/scenario-view ``` 1. **api-source**: which type of api to use, ["aurin", "twitter", "scenario"] -`scenario` is for displaying some special processed data +`aurin` `twitter` is only for developing phase +`scenario` is for displaying demo data 2. **data-type**: data type from couchDB, * `covid` `house-price` for twitter data - * `rai` `income` `house-price` `migration` for aurin data + * `income` `house-price` `migration` for aurin data -3. **sub-data-type**: sub data type from couchDB, now only available for `house-price` - * `rent` `sale` - -4. **selected-view** (optional): map-reduce view, go to `util/constants.py` to see more +3. **selected-view**: map-reduce view, go to `util/constants.py` to see more * `year` `position` `type` or combination like `year-postion` * `sex` `English` or `english` for migration data * `subjectivity` `polarity` `language` for twitter data -## API URL From - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
api-typedata-typesub-data-typeselected-view
aurinincomenoneyear
position
2-combination (eg: year-position)
house-pricerent or saleposition
year
type
2-combination (eg: year-position)
sumary
migrationnonesex
year
population
total-population
english or English
rainonenone
twitterhouse-pricenoneyear
polarity
subjectivity
map
language
language-time (time: [month, quarter, year])
map-year
covidnonepolarity
subjectivity
language
language-time (time: [month, quarter, year])
scenariolanguagesnonenone
languages-monthnonenone
- +4. **scenario-view**: finally used in the system + * `languages` `languages-month` for scenario **Overseas Migration and Languagues Languages On Twitter** + * `house-price` for scenario **Relevance among House price, Income and Attitudes of People On Twitter** + * `covid` for scenario **How Decisions (Lockdown) made By Local Government Influence Employment and People's Feeling** + * `stream` for scenario **General Statistics of Real-time Tweets, and details of these Tweets** \ No newline at end of file