Commit 85ce78f1 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt

update readme with information about development, contribution and deployment workflow

parent 866a2c5f
Pipeline #1564 failed with stages
in 60 minutes and 17 seconds
# thekno
## Project setup
```
npm install
```
A Vue.js-based frontend for the Lohrothek REST API.
### Compiles and hot-reloads for development
```
npm run serve
```
This project required *NodeJS* and *npm*. If any of the commands below fail, because they are missing refer to the *System Requirements* section below.
### Compiles and minifies for production
```
npm run build
### Development and Testing Workflow
The project uses a number of external dependencies, that you can install with the `npm install` command. After that you can just run `npm run serve` to start up a development server.
*thekno* ships with fixtures that do not require a backend server, but in case you do want to work with the [Lohrothek REST API](https://git.hack-hro.de/lohro/lohrothek/lohrothek-api) you can do that. The development server started by `npm run serve` will proxy all requests to the `/api/` endpoint to `http://localhost:8000/` by default. This matches the default configuration for the Django webserver. In case you want to use a different backend server or have started Django on a non-standard port you can provide the `PROXY_TARGET` environment variable to `npm run serve`. A development server with the production-environment `Lohrothek REST API` can be started like this:
```sh
PROXY_TARGET="https://thek.lohro.de/" npm run serve
```
### Run your tests
## Contributions
Contributions are always welcome. Before you push your commits or create *merge requests* make sure that `npm run lint` and `npm run test` do not report any errors (that did not exist before 😅).
## Builds & Deployment
VueJS provides a build target out of the box. You can create a build with `npm run build` and deploy the contents of the `build/dist` directory afterwards. The is also a `Dockerfile` that can be used to create docker images (in fact this `Dockerfile` is used to automatically deploy *thekno* to our [staging server](https://lohro-lohrothek-thekno-staging.lohrothek.git-k8s.hack-hro.de/)).
There will also be a deb package for Debian at a later point.
## System Requirements
This projects requires fairly recent versions of *NodeJS* (v8+) and *npm* (v5.8+). Both are bundled with the default distribution available on [nodejs.org](https://nodejs.org/en/download/).
### Debian Stretch
If you are using Debian Stretch you’ll notice that the distributed `nodejs` package is fairly old and that npm is missing entirely.
If you prefer packages provided by the Debian project, you can activate the `stretch-backports` repository. Add the following line to your `/etc/apt/sources.list`:
```
npm run test
deb http://deb.debian.org/debian stretch main`
```
### Lints and fixes files
```
npm run lint
After that you will be able to install `nodejs` and `npm` with the following command:
```sh
apt update && apt install -t stretch-backports nodejs npm
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
### Debian Buster
Debian Buster ships with the required versions so that you can just install the `nodejs` and `npm` packages.
### Other Distributions & Windows
For all other distributions that do not contain the required *NodeJS* and *npm* packages visit the [download section](https://nodejs.org/en/download/) on the NodeJS page.
If you have better advice for any distribution, add them to this section.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment