Update readme with installation steps

This commit is contained in:
rui hildt 2020-05-13 18:45:10 +02:00
parent 0f7f67868b
commit 9d6e9a288a
2 changed files with 38 additions and 5 deletions

View File

@ -9,3 +9,41 @@ It's based on the availibity of all participants for specific days.
- [API endpoints](https://git.armada.digital/meeting-planner/documentation/src/branch/master/api-documentation.md)
- [Database design](https://dbdiagram.io/d/5e769ab14495b02c3b88936f)
- [Flowchart](https://app.diagrams.net/#Uhttps://git.armada.digital/meeting-planner/documentation/raw/branch/master/meetingscheduler.drawio)
## Backend installation
### 1 | Create a database on Postgres
Any up to date postgres should work.
You will need the following informations:
- username
- password
- hostname
- database
### 2 | Create and/or configure an `.env` file
- Create a `.env` file at the root of the backend folder
- Replace all variables noted with `$` below, and save it to the `.env` file
```
NODE_ENV=development // This can't be changed for now
PORT=$port_number
DATABASE_URL=postgres://$db_user:$db_user_password@$hostname:5432/$db_name
JWT_SECRET=$long_random_characters
```
### 3 | Installation of packages (NodeJS needs to be installed)
- `npm i`
### Migrate tables to database
- `npx knex migrate:latest`
### Seed database with dummy content (optional)
Running this will add some users and meetings.
- `npx knex seed:run`
**List of users**
| Liza | Emile | Jack | Cynthia | Celine |
|----------------- |------------------ |----------------- |-------------------- | ------------------ |
| liza@example.com | emile@example.com | jack@example.com | cynthia@example.com | celine@example.com |
| liza-password | emile-password | jack-password | cynthia-password | celine-password |

View File

@ -1,5 +0,0 @@
## How to do a migration
- Create `.env` to the root folder
- Add the database url to the `.env` file:
`DATABASE_URL=postgres://username:password@host:port/database`
- Run `npx knex migrate:latest`