canape/README.md

59 lines
1.1 KiB
Markdown

## Install dependencies
### Install node
You'll need node v6+, here's a link to install it:
https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions
### Install yarn and dependencies
```
sudo npm install -g yarn
yarn install
```
## Dev
#### Check your config.yml file
#### Run the backend
```sh
./dev.sh back
```
#### Run the frontend
```sh
./dev.sh front
```
## Connect to the database
```sh
docker run -it --rm -e PGPASSWORD=test --link canape_postgresql_dev:postgres postgres:9.5 psql -h postgres -U test -d dev
```
## Setup the dev users
Connect to the database and enter this sql queries:
```sh
INSERT INTO users (name, hash, admin, activated) VALUES ('test', '$2a$10$QHx07iyuxO1RcehgtjMgjOzv03Bx2eeSKvsxkoj9oR2NJ4cklh6ue', false, true);
INSERT INTO users (name, hash, admin, activated) VALUES ('admin', '$2a$10$qAbyDZsHtcnhXhjhQZkD2uKlX72eMHsX8Hi2Cnl1vJUqHQiey2qa6', true, true);
```
This users are defined with this parameters:
pepper: "pepper"
cost: 10
Users:
* Admin user: admin / admin
* Test user: test / test
## Run the tests
```sh
go test ./...
```