Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loomio api #71

Merged
merged 15 commits into from
Nov 28, 2018
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
.idea
*~
*.bak
*.swp

# Dependencies
node_modules/
/yarn.lock
node_modules/

# Misc
*.log
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ Set up your connection variables to Neo4j in `api/.env`. With Neo4j running loca
DB_URL=bolt://127.0.0.1:7687
DB_USERNAME=neo4j
DB_PASSWORD=

LOOMIO_API_BASE=https://talk.theborderland.se/api/v1
LOOMIO_SITE_BASE=https://talk.theborderland.se
LOOMIO_CRON_SCHEDULE='5 * * * *'
```
The LOOMIO* variables are used for accessing the Loomio API to download discussions.
The LOOMIO_CHRON_SCHEDULE is in standard cron format, starting with minutes. The example above
runs the download every hour at hh:05.

Make sure you're running the versions of node and npm specified in the api and ui package.json files (node 8.9.x and npm 5.5.x), then...

Expand Down
31 changes: 31 additions & 0 deletions api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,34 @@ The GraphQL schema is defined using a set of tools from Apollo named [graphql-to
### Inspect the GraphQL API easily using GraphiQL

When the back-end is running, explore the API using GraphiQL at [http://localhost:3100/graphiql](http://localhost:3100/graphiql).

### Loomio Interface (optional)

[Loomio](https://loomio.com/) is a web site that hosts discussion groups. Realities accesses the [Loomio API](https://help.loomio.org/en/dev_manual/using_the_api/)
to enhance the user experience when adding Deliberation links (`Info` nodes) to a `Need` or `Responsibility`, and to allow graphing of
connections between those nodes.

To activate the Loomio connection, add the following parameters to your .env file:

```
LOOMIO_API_BASE=https://your-loomio-domain.com/api/v1
LOOMIO_SITE_BASE=https://your-loomio-domain.com
LOOMIO_CRON_SCHEDULE='*/10 * * * *'
```

There are two ways Loomio discussions and groups are added to the database.

1. The system should be initialized with *all* currently existing discussions and groups, like this:
```
cd api
npm run init-loomio
```
2. The system regularly downloads new discussions and groups using a cron-like scheduler. It retrieves anything created
in the last 24 hours. Therefore, the scheduler should be set to anything less than 24 hours. The syntax of the
scheduler follows the standard [cron syntax](https://en.wikipedia.org/wiki/Cron).
Example:
```
LOOMIO_CRON_SCHEDULE='5 * * * *' // Update once per hour, at hh:05
or
LOOMIO_CRON_SCHEDULE='*/10 * * * *' // Update every 10 minutes
```
Loading