2019-03-10 23:17:43 +00:00
|
|
|
# cjvt-valency
|
2019-03-17 16:25:59 +00:00
|
|
|
Required submodules:
|
|
|
|
|
|
|
|
* `https://gitea.cjvt.si/kristjan/cjvt-corpusparser.git`
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ git submodule init
|
2019-03-23 19:27:23 +00:00
|
|
|
$ git submodule update
|
2019-03-17 16:25:59 +00:00
|
|
|
```
|
2019-03-07 08:00:01 +00:00
|
|
|
|
|
|
|
## Components
|
|
|
|
|
|
|
|
|
|
|
|
### Database (2 containers)
|
2019-03-24 01:08:22 +00:00
|
|
|
Set db admin, user, pass, etc in 'Makefile'.
|
2019-03-23 19:27:23 +00:00
|
|
|
Spin up the database service and create users:
|
2019-03-17 16:25:59 +00:00
|
|
|
```bash
|
|
|
|
# $ make database-clean # opt
|
|
|
|
$ make database-service
|
|
|
|
$ make database-users
|
|
|
|
```
|
|
|
|
|
|
|
|
Populate the database with data form files:
|
2019-03-07 08:00:01 +00:00
|
|
|
|
|
|
|
* ssj500k.xml
|
|
|
|
* kres.xml
|
|
|
|
* kres_SRL.json
|
|
|
|
|
2019-03-17 16:25:59 +00:00
|
|
|
Set path to files in `Makefile`.
|
|
|
|
```bash
|
|
|
|
# spin up a container with python env
|
|
|
|
$ make python-env
|
2019-03-07 08:00:01 +00:00
|
|
|
|
2019-03-17 16:25:59 +00:00
|
|
|
# install our packages
|
|
|
|
$ make python-env-install
|
2019-03-07 08:00:01 +00:00
|
|
|
|
2019-03-17 16:25:59 +00:00
|
|
|
# run the code
|
2019-03-23 19:27:23 +00:00
|
|
|
$ make fill-database
|
2019-03-17 16:25:59 +00:00
|
|
|
```
|
2019-03-07 08:00:01 +00:00
|
|
|
|
2019-03-24 01:08:22 +00:00
|
|
|
If all goes well, we should be able to inspect the database, filled with corpora, on `0.0.0.0:8087`.
|
2019-03-07 08:00:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
### Flask backend (1 container)
|
2019-03-24 01:08:22 +00:00
|
|
|
Relies heavily on the database. Set that up first.
|
|
|
|
```bash
|
2019-03-28 18:17:45 +00:00
|
|
|
$ make python-env
|
|
|
|
|
|
|
|
# $ make backend-dev # development
|
2019-03-24 01:08:22 +00:00
|
|
|
$ make backend-prod
|
|
|
|
```
|
2019-03-07 08:00:01 +00:00
|
|
|
|
|
|
|
API endpoints:
|
|
|
|
|
|
|
|
* GET word list (pre-cached)
|
|
|
|
* GET reduced frames (pre-cached)
|
|
|
|
* POST senses
|
|
|
|
* User auth logic
|
|
|
|
|
|
|
|
|
|
|
|
### Vue frontend (1 container)
|
2019-03-24 01:08:22 +00:00
|
|
|
Relies on Flask backend.
|
|
|
|
Before running `make`, you might need to set the correct api address.
|
|
|
|
Check `./src/frontend_vue/config/config_prod.json`.
|
|
|
|
bash
|
|
|
|
```
|
|
|
|
# $ make frontend-dev # development
|
|
|
|
$ make frontend-prod
|
|
|
|
```
|
2019-03-07 08:00:01 +00:00
|
|
|
|
2019-03-24 01:08:22 +00:00
|
|
|
App available on: `http://0.0.0.0:8080`.
|