Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
aabbaq committed May 16, 2022
1 parent 129d94b commit 246d149
Showing 1 changed file with 16 additions and 123 deletions.
139 changes: 16 additions & 123 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# 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
```

### Step 2

#### Start Flask Server (local test for now)
#### Start Flask Server
```bash
cd ./backend
python3 app.py
Expand All @@ -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/<sub-data-type>/<selected-view>
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

<table>
<tr>
<th rowspan="1">api-type</th>
<th rowspan="1">data-type</th>
<th rowspan="1">sub-data-type</th>
<th rowspan="1">selected-view</th>
</tr>
<tr>
<td rowspan="14">aurin</td>
<td rowspan="3">income</td>
<td rowspan="3">none</td>
<td>year</td>
</tr>
<tr>
<td>position</td>
</tr>
<tr>
<td>2-combination (eg: year-position)</td>
</tr>
<tr>
<td rowspan="5">house-price</td>
<td rowspan="5">rent or sale</td>
<td>position</td>
</tr>
<tr>
<td>year</td>
</tr>
<tr>
<td>type</td>
</tr>
<tr>
<td>2-combination (eg: year-position)</td>
</tr>
<tr>
<td>sumary</td>
</tr>
<tr>
<td rowspan="5">migration</td>
<td rowspan="5">none</td>
<td>sex</td>
</tr>
<tr>
<td>year</td>
</tr>
<tr>
<td>population</td>
</tr>
<tr>
<td>total-population</td>
</tr>
<tr>
<td>english or English</td>
</tr>
<tr>
<td>rai</td>
<td>none</td>
<td>none</td>
</tr>
<tr>
<td rowspan="11">twitter</td>
<td rowspan="7">house-price</td>
<td rowspan="7">none</td>
<td>year</td>
</tr>
<tr>
<td>polarity</td>
</tr>
<tr>
<td>subjectivity</td>
</tr>
<tr>
<td>map</td>
</tr>
<tr>
<td>language</td>
</tr>
<tr>
<td>language-time (time: [month, quarter, year])</td>
</tr>
<tr>
<td>map-year</td>
</tr>
<tr>
<td rowspan="4">covid</td>
<td rowspan="4">none</td>
<td>polarity</td>
</tr>
<tr>
<td>subjectivity</td>
</tr>
<tr>
<td>language</td>
</tr>
<tr>
<td>language-time (time: [month, quarter, year])</td>
</tr>
<tr>
<td rowspan="2">scenario</td>
<td>languages</td>
<td>none</td>
<td>none</td>
</tr>
<tr>
<td>languages-month</td>
<td>none</td>
<td>none</td>
</tr>
</table>

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**

0 comments on commit 246d149

Please sign in to comment.