backend/README.md

67 lines
2.4 KiB
Markdown
Raw Permalink Normal View History

2020-04-14 12:06:14 +00:00
## Meeting Planner Backend
Meeting Planner helps you find the best time to schedule a meeting across several timezones.
It's based on the availibity of all participants for specific days.
2020-03-20 13:25:37 +00:00
2020-09-28 22:57:13 +00:00
- [Documentation](https://git.ruihildt.xyz/meeting-planner/documentation)
- [Frontend](https://git.ruihildt.xyz/meeting-planner/frontend)
2020-03-20 16:02:44 +00:00
2020-06-17 11:13:23 +00:00
---
**URL** https://meeting-planner-backend.herokuapp.com/
---
2020-04-14 12:06:14 +00:00
# Backend architecture
2020-09-28 22:57:13 +00:00
- [API endpoints](https://git.ruihildt.xyz/meeting-planner/documentation/src/branch/master/api-documentation.md)
2020-04-14 12:06:14 +00:00
- [Database design](https://dbdiagram.io/d/5e769ab14495b02c3b88936f)
2020-09-28 22:57:13 +00:00
- [Flowchart](https://app.diagrams.net/#Uhttps://git.ruihildt.xyz/meeting-planner/documentation/raw/branch/master/meetingscheduler.drawio)
2020-05-13 16:45:10 +00:00
2020-05-13 18:24:01 +00:00
## Installation
2020-05-13 16:45:10 +00:00
2020-05-13 18:24:01 +00:00
### 0 | Requirements
Meeting Planner runs on virtually any system where Node.js is supported.
This means it runs on Linux, macOS, Windows as well as container solutions such as Docker / Kubernetes and Heroku.
2020-05-13 16:45:10 +00:00
2020-05-13 18:24:01 +00:00
**Versions**
- Postgres 9.5 or later
- NodeJS 10.12 or later
*[KnexJS](https://knexjs.org/), the database driver used is compatible with other databases like MySQL.
With small adaptation, it should be possible to use them, but this has not been tested.*
### 1 | Configure Postgres to use UTC
** Make sure that Postgres database used is configured to UTC **
`SET TIME ZONE 'UTC';`
See [Postgres Documentation](https://www.postgresql.org/docs/current/sql-set.html)
### 2 | Create and/or configure environement variables
2020-05-13 16:45:10 +00:00
- 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
```
2020-05-13 18:24:01 +00:00
### 3 | Installation of packages with npm
2020-05-13 16:45:10 +00:00
- `npm i`
2020-05-13 18:24:01 +00:00
### 4 | Migrate tables to database
2020-05-13 16:45:10 +00:00
- `npx knex migrate:latest`
2020-05-13 18:24:01 +00:00
### 5 | Seed database with dummy content **(optional)**
Running this will add some accounts along with some meetings.
2020-05-13 16:45:10 +00:00
- `npx knex seed:run`
2020-05-13 18:24:01 +00:00
**Accounts created**
2020-05-13 17:58:42 +00:00
2020-05-13 16:45:10 +00:00
| Liza | Emile | Jack | Cynthia | Celine |
2020-05-13 17:58:42 +00:00
| :--------------- | :---------------- | :--------------- | :------------------ | :----------------- |
2020-05-13 16:45:10 +00:00
| liza@example.com | emile@example.com | jack@example.com | cynthia@example.com | celine@example.com |
| password | password | password | password | password |