Skip to content

Commit

Permalink
documentation for configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
piggydoughnut committed May 24, 2024
1 parent b57e47c commit 10addf2
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 35 deletions.
3 changes: 1 addition & 2 deletions documentation/pages/framework/_meta.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"configuration": "Configuration",
"permissions": "Permissions"
"configuration": "Configuration"
}
34 changes: 1 addition & 33 deletions documentation/pages/framework/configuration.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuration

Configuration for the project lives in a `./config` directory. We suggest keeping that directory in a separate repository and create symbolic link it for local development.
Configuration for the project lives in a `./config` directory. We suggest keeping that directory in a separate repository and create symbolic link it for local development. You can find a sample folder called `config-demo` [here](https://github.com/paritytech/polkadot-hub-app/tree/master/config-demo)

```
./config
Expand All @@ -22,28 +22,6 @@ Configuration for the project lives in a `./config` directory. We suggest keepin
└── notification.yaml
```

## Integrations

### Email-smtp

Add `.env` variables.

```
SMTP_ENDPOINT=""
SMTP_PORT=
SMTP_USERNAME=""
SMTP_PASSWORD=""
SMTP_FROM_NAME=""
SMTP_FROM_EMAIL=""
```

### Matrix

### Mapbox

Support for maps.
Expand All @@ -53,13 +31,3 @@ We use `mapbox` in a few places:
- All users map at `/map`.
- Map of the hub location on the about page `/about/<hubId>`
- User location on their profile if they specify that they want to share. `/profile/<userId>`

## Text templates

Depending on the configuration of your project you might have certain integrations turned on, e.g. email.
The app sends default texts when emails are sent. You can ovewrite these texts with your customs ones.

1. Create a folder with the module name in the templates folder , e.g. `./config/templates/guest-invites`
2. Create a YAML file for the text message. We have 3 types of messages: notification (matrix), email, text (error messages). E.g. `email.yml`
3. Look up the email message key [here](https://github.com/paritytech/polkadot-hub-app/blob/master/src/integrations/email-smtp/README.md#guest-invites).
4. Add your custom message to yml file. [See example here](https://github.com/paritytech/polkadot-hub-app/blob/master/src/modules/guest-invites/templates/email.yaml)
5 changes: 5 additions & 0 deletions documentation/pages/framework/configuration/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"application": "Application.json",
"company": "Company.json",
"textTemplates": "Text templates"
}
Empty file.
121 changes: 121 additions & 0 deletions documentation/pages/framework/configuration/company.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Company.json

```
{
"id": "berlin",
"name": "BerlinHub",
"city": "Berlin",
"country": "GE",
"icon": "🇩🇪",
"address": "Main street 10",
"coordinates": [0.34324324, 0.234234234],
"directions": "Entrance through the courtyard",
"workingHours": ["09:00", "18:00"],
"workingDays": "Mon - Fri",
"timezone": "Europe/Berlin",
"allowGuestInvitation": true,
"allowDeskReservation": true,
"allowRoomReservation": true,
"areas": [{
"id": "first_floor",
"name": "First Floor",
"available": true,
"bookable": true,
"map": "/path/to/map.png",
"meetingRooms": [
{
"id": "hibiscus",
"name": "Hibiscus",
"description": "1st floor",
"capacity": 5,
"equipment": "whiteboard",
"photo":"/path/to/photo.png",
"workingHours": ["08:00", "19:00"],
"autoConfirm": true,
"position": {
"x":0,
"y":0
}
}
],
"desks": [
{
"id": "a",
"name": "A",
"type": "flexible",
"position": {
"x":0,
"y":0
}
}
]
}]
}
```

## Configurable fields

`name` - name of your company

`offices` - Array of your offices/hub configurations

| key | value | required | var type |
| ----------------------- | ------------------------------------------------------------------------------------- | ----------------------- | --------------------- |
| id | unique identifier, once created please do not change | required | string |
| name | hub name | required | string |
| city | | | string |
| country | two letter code, e.g. GE | | string |
| icon | e.g. 🇩🇪 | | string |
| timezone | e.g. Europe/London | required | string |
| address | used in modules: About, Guest Invites | required for the module | string |
| coordinates | used in modules: About | required for the module | [float, float] |
| directions | used in modules: About | required for the module | string |
| workingHours | used in modules: About, e.g. ["09:00", "18:00"] | required for the module | [string, string] |
| workingDays | used in modules: Guest Invites, About. e.g. "Mon - Fri" | required for the module | string |
| roomsPlaceholderMessage | This message is shown in case you turned off `allowRoomReservation` for the given hub | optional | string |
| allowGuestInvitation | | required | boolean |
| allowDeskReservation | | required | boolean |
| allowRoomReservation | | required | boolean |
| areas | hub floors | required | Array of JSON objects |

### Areas configuration

`areas`

| key | value | required | var type |
| ------------ | ------------------------------------------------------------ | -------- | --------------------- |
| id | unique area identifier, once created please do not change | required | string |
| name | | required | string |
| available | you can turn on and off the whole area | required | boolean |
| bookable | the area can be booked | required | boolean |
| map | path to the map image, place in public folder in your config | required | string |
| meetingRooms | meeting room configuration | required | Array of JSON objects |
| desks | desks configuration | required | Array of JSON objects |

### Meeting Rooms configuration

`meetingRooms`

| key | value | required | var type |
| ------------ | ------------------------------------------------------------------------------------------- | -------- | ---------------- |
| id | unique area identifier, once created please do not change | required | string |
| name | | required | string |
| description | e.g. 1st floor | required | string |
| capacity | room capacity | required | number |
| equipment | e.g. Whiteboard, stationary, electrical sockets within reachable distance to the table. | required | string |
| photo | path to the meeting room photo, place in public folder in your config | required | string |
| workingHours | | | [string, string] |
| autoConfirm | some rooms may require manual approval by administrator | | boolean |
| position | {"x": 1, "y":1} position of the room on the map to display on the big map (module Hub Map ) | | object |

### Desks configuration

`desks`

| key | value | required | var type |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- |
| id | unique area identifier, once created please do not change | required | string |
| name | this is displayed on the map, the shorter the better. e.g: A, B, C | required | string |
| type | "flexible" - can be booked by anyone, "full_area" - will book the whole area or "multi" - multiple bookings can be made on the same desk/spot | required | string |
| position | {"x": 1, "y":1} position of the desk on the floor map to display for booking | | object |
9 changes: 9 additions & 0 deletions documentation/pages/framework/configuration/textTemplates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Text templates

Depending on the configuration of your project you might have certain integrations turned on, e.g. email.
The app sends default texts when emails are sent. You can ovewrite these texts with your customs ones.

1. Create a folder with the module name in the templates folder , e.g. `./config/templates/guest-invites`
2. Create a YAML file for the text message. We have 3 types of messages: notification (matrix), email, text (error messages). E.g. `email.yml`
3. Look up the email message key [here](https://github.com/paritytech/polkadot-hub-app/blob/master/src/integrations/email-smtp/README.md#guest-invites).
4. Add your custom message to yml file. [See example here](https://github.com/paritytech/polkadot-hub-app/blob/master/src/modules/guest-invites/templates/email.yaml)
18 changes: 18 additions & 0 deletions documentation/pages/framework/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,21 @@
## Mapbox

## Stripe

### Email-smtp

Add `.env` variables.

```
SMTP_ENDPOINT=""
SMTP_PORT=
SMTP_USERNAME=""
SMTP_PASSWORD=""
SMTP_FROM_NAME=""
SMTP_FROM_EMAIL=""
```

0 comments on commit 10addf2

Please sign in to comment.