spraakbanken / korp-frontend

Frontend for Korp, a tool using the IMS Open Corpus Workbench (CWB).
https://spraakbanken.gu.se/en/tools/korp
MIT License
16 stars 8 forks source link
cwb frontend korp

This repo contains the frontend for Korp, Språkbanken's word research platform using the IMS Open Corpus Workbench (CWB). Korp is a great tool for searching and visualising natural language corpus data.

Korp is mainly developed by Språkbanken at the University of Gothenburg, Sweden. Contributions are also made from other organizations that use the software.

Documentation:

Getting started

Install yarn: https://yarnpkg.com

Using yarn

Declare dependencies using yarn add pkgor yarn add --dev pkg for dev dependencies.

npm has not worked previously, but the status is unknown right now.

webpack

We use webpack to build Korp and webpack-dev-server to run a local server. To include new code or resources, require or use import them where needed:

import { aFunction } from 'new-dependency'

or

nd = require("new-dependency")
nd.aFunction()

or

imgPath = require("img/image.png")
myTemplate = `<img src='${imgPath}'>`

Some dependencies are only specified in app/index.ts.

About the current loaders in webpack.config.js:

In addition to this, some specific files will simply be copied as is, for example Korp mode-files.

Configuration

Use config.yml for settings needed in the frontend. In some cases, mode-files can be used. For example it is possible to have different backends for modes.

Other instances

There are several instances of Korp, here are a list of some:

The development server

When developing, the frontend is served at http://localhost:9111 by default.

Host and port can be changed by the environment variables:

Environment variables can be entered in the .env file, which is git-ignored.

It is also possible to serve the frontend from HTTPS using the environment variables:

The key and cert can be created using mkcert.

mkcert korp.spraakbanken.gu.se
mkcert -install

Now use korp.spraakbanken.gu.se as the value for KORP_HOST. It must also be added to /etc/hosts.

Branches, releases and versions

Development is done on the dev branch. These changes are not necessarily yet stable and well-tested.

Once tested, they can be merged to the master branch in a release.

When doing a release:

As an external developer, when forking this respository, you may choose to pull from dev and/or master, depending on your needs for latest versus stable changes.