Skip to content

Commit

Permalink
removed yarn tag-related stuff, tag handling is performed in git and …
Browse files Browse the repository at this point in the history
…CI/CD now
  • Loading branch information
HetorusNL committed Aug 26, 2023
1 parent 72a9fce commit 8a7de39
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 52 deletions.
63 changes: 32 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Vocya - vocabulary shop

Front-end for the vocjem data; dashboard and API.
'Vocabulary shop' to view, search and study Japanese words.
This is a front-end for the [VocJEM](https://github.com/HetorusNL/vocjem) data; dashboard and API.
Both the dashboard and API are available as docker containers:

- https://hub.docker.com/r/hetorusnl/vocya-api
Expand All @@ -16,6 +17,8 @@ The current API endpoint can be reached at: https://api.vocya.hetorus.nl/.

Either run the API using the docker container mentioned above, or manually using the steps below.

#### Installing poetry

Install poetry: https://python-poetry.org/docs/

Ensure poetry works by running:
Expand All @@ -25,18 +28,23 @@ Otherwise ensure that the location poetry is installed in, is added to the path.
Configure poetry to create the virtualenvs in the project folder:
`poetry config virtualenvs.in-project true`

Install the required dependencies:
`cd api`
`poetry install`
#### Running the API

```bash
# go to the api directory
cd api

Modify the path to the VocJEM database file in `database_file` in `main.py`, if that repository is stored in a different location.
# install the required dependencies
poetry install

Run the API
`cd api`
`poetry run python3 main.py`
# run the API
poetry run python3 main.py
```

### Example queries

_Make sure to change the `api.vocya.hetorus.nl` domain name when running the API locally_

Query all words
https://api.vocya.hetorus.nl/words
Query words with id='jem1-2'
Expand All @@ -47,11 +55,9 @@ Query words with course='jem1' chapter='jem1-1' and id='jem1-1'
https://api.vocya.hetorus.nl/course/jem1/chapter/jem1-1/word/jem1-1
Searching is no longer supported on the API side, searching within returned words for a course/chapter/all should be performed client-side.

\*change the domain name when running the API locally

## Dashboard

The front-end dashboard of vocya showing the results of the API calls to the vocya API.
The front-end dashboard of Vocya showing the results of the API calls to the Vocya API.
By default 'live search' is enabled, and every keystroke sends a 'search' API call and shows the results.
When 'live search' is disabled by clicking on the button, a manual search button is enabled to send the 'search' API call when clicked.
When clicking on the results, a single result page is opened where the 'raw properties' are shown.
Expand All @@ -76,43 +82,38 @@ sudo apt remove yarn
# enable corepack
corepack enable

# updating the global yarn version
corepack prepare yarn@stable --activate

# initialize yarn
yarn init -2

# update to the latest version
yarn set version stable

# install the dependencies of the project
yarn install
```

## Scripts

### Run the development server

run the following command to run the dev server:
Run the following command to run the dev server:
`yarn start`
this starts the development server on `localhost:3000`
This starts the development server on `localhost:3000`

### Run a build (without incrementing version number)

run the following command to build the application:
Run the following command to build the application:
`yarn build`
this updates the version number (if changed in `package.json`) and builds the application
This updates the version number (if changed in `package.json`) and builds the application

### Run a build with version increment and git commit creation
### Increment the version number of Vocya

// TODO: tagging is not yet working with the squash pull-request way, and not yet available in the github actions workflows

the Semantic Versioning, also known as "semver", is used:
version: `major.minor.patch`
run one of the following commands:
The Semantic Versioning, also known as "semver", is used:
Version: `major.minor.patch`
Run one of the following commands:
`yarn release-patch` // increments the `patch` number of the version
`yarn release-minor` // increments the `minor` number of the version
`yarn release-major` // increments the `major` number of the version
all these three commands also create a git commit and git tag with the message:
`v${npm_package_version}` (which is the major.minor.patch version)
these three commands also perform a push to the master branch on github and push the tags
`yarn release-major` // increments the `major` number of the version

After these commands are executed, make sure to create a tag with matching version number (e.g. matching `v${npm_package_version}`), and push this to the repository.
This causes the CI/CD to create a tagged docker image for both the API and the dashboard with this version number.

## License

Expand Down
19 changes: 0 additions & 19 deletions dashboard/git-script.js

This file was deleted.

3 changes: 1 addition & 2 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"release-patch": "yarn version patch && yarn postversion",
"release-minor": "yarn version minor && yarn postversion",
"release-major": "yarn version major && yarn postversion",
"postversion": "yarn build && yarn git-script",
"git-script": "node git-script"
"postversion": "yarn build"
},
"eslintConfig": {
"extends": [
Expand Down

0 comments on commit 8a7de39

Please sign in to comment.