Skip to content

Commit

Permalink
Add initial development information
Browse files Browse the repository at this point in the history
Closes #15
  • Loading branch information
Siilwyn committed Jan 14, 2019
1 parent 82a1924 commit 430fa1b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -2,6 +2,7 @@
"name": "voorhoede-playbook",
"description": "Voorhoede playbook based on Dropbox Paper.",
"scripts": {
"start": "npm run docs:content && npm run docs:dev",
"test": "ava ./src/test.js",
"test:watch": "npm run test -- --watch --verbose",
"docs:dev": "vuepress dev docs",
Expand Down
42 changes: 42 additions & 0 deletions readme.md
@@ -1,2 +1,44 @@
# De Voorhoede Playbook
Playbook in the form of a website generated with [Vuepress](https://vuepress.vuejs.org/) and fetched [Dropbox Paper](https://www.dropbox.com/paper) documents.

## Development

### Quick start
#### Initial setup
```sh
git clone git@github.com:voorhoede/playbook.git
cd playbook
npm ci
```

#### Set environment
All needed environment variables are listed in the [.env.example](.env.example) file. To automatically set them fill in a `.env` file following the same structure as the example file.
```sh
cp .env.example .env
```

### Running
#### Development
Fetch content and start local server to preview the website.
```sh
npm start
```

#### Production
```sh
npm run docs:content
npm run docs:build
```

### Codebase overview
#### Structure
- `src` contains the logic needed to fetch & transform content before building.
- `docs/.vuepress` contains Vuepress configuration and front-end assets.

Because Vuepress does not support asynchronous configuration the fetching content and building the website is seperated. Which means the needed sidebar data is written to a temporary file so it can be synchronously read from [docs/.vuepress/config.js](docs/.vuepress/config.js).

#### Testing
Unit tests are present in [src/test.js](src/test.js) and are ran with: `npm test`.

#### Style
The code is written in a functional style using [Sanctuary](https://sanctuary.js.org/) to provide simple, pure functions with no need for `null` checks.

0 comments on commit 430fa1b

Please sign in to comment.