Skip to content

Commit 517cebf

Browse files
author
Alex G Rice
authored
Update Readme, bump nodejs version to current LTS. (#149)
* Update Readme, bump nodejs version to current LTS.
1 parent 9c18983 commit 517cebf

File tree

2 files changed

+53
-37
lines changed

2 files changed

+53
-37
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8.13.0
1+
v12.16

README.md

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,71 @@
11
# osm-teams 🤝
22

3-
Check the beta 👉 https://mapping.team
3+
Check the beta 👉 <!-- markdownlint-disable MD034 -->https://mapping.team
4+
<!-- markdownlint-enable MD034 -->
45

56
## Installation
7+
68
### Requirements
7-
- Postgresql. On macOS, the easiest is to install [Postgres.app](https://postgresapp.com/).
8-
- NodeJS v10+
9-
- Docker & Docker Compose
9+
10+
- [PostgreSQL](https://www.postgresql.org). On OS X, the easiest is to install [Postgres.app](https://postgresapp.com/).
11+
- [Node.js](https://nodejs.org) v12.16+
12+
- [Docker](https://www.docker.com/) & Docker Compose
1013

1114
### Setting up Hydra
1215

1316
1. Create the database for tokens
14-
```
15-
createdb osm-teams
16-
```
17-
For the rest of this documentation, we will assume that the database location is `postgres://postgres@localhost/osm-teams?sslmode=disable` on your local machine. Inside docker, that location is `postgres://[email protected]/osm-teams?sslmode=disable`
1817

19-
2. Create a a `.env` file by copying `.env.sample` and replacing the values as needed. `OSM_CONSUMER_KEY` and `OSM_CONSUMER_SECRET` are values obtained by creating a new OAuth app on openstreetmap.org. The .env file can contain:
20-
```
21-
OSM_CONSUMER_KEY=<osm-teams-app>
22-
OSM_CONSUMER_SECRET=<osm-teams-app-secret>
23-
DSN=postgres://[email protected]/osm-teams?sslmode=disable
24-
SECRETS_SYSTEM=<random-guid>
25-
```
18+
```bash
19+
createdb osm-teams
20+
createdb osm-teams-test
21+
```
2622

27-
3. Migrate the database
28-
```
29-
docker-compose run --rm hydra migrate sql --yes postgres://[email protected]/osm-teams?sslmode=disable
30-
```
23+
For the rest of this documentation, we will assume that the database location is `postgres://postgres@localhost/osm-teams?sslmode=disable` on your local machine. Inside docker, that location is `postgres://[email protected]/osm-teams?sslmode=disable`
3124

32-
4. Build the images:
33-
```
34-
docker-compose build
35-
```
25+
1. Create an `.env` file by copying `.env.sample` and replacing the values as needed. `OSM_CONSUMER_KEY` and `OSM_CONSUMER_SECRET` are values obtained by creating a new OAuth app on openstreetmap.org. The .env file can contain:
3626

37-
5. Start Hydra and the server
38-
```
39-
docker-compose -f docker-compose.dev.yml up
40-
```
27+
```bash
28+
OSM_CONSUMER_KEY=<osm-teams-app>
29+
OSM_CONSUMER_SECRET=<osm-teams-app-secret>
30+
DSN=postgres://[email protected]/osm-teams?sslmode=disable
31+
SECRETS_SYSTEM=<random-guid>
32+
```
33+
34+
1. Install Javascript dependencies and migrate the osm-teams database
35+
36+
```bash
37+
nvm use
38+
yarn install
39+
yarn run migrate
40+
```
41+
42+
1. Migrate the Hydra database
43+
44+
```bash
45+
docker-compose run --rm hydra migrate sql --yes postgres://[email protected]/osm-teams?sslmode=disable
46+
```
47+
48+
1. Build the docker images:
49+
50+
```bash
51+
docker-compose build
52+
```
53+
54+
1. Start Hydra and the server
55+
56+
```bash
57+
docker-compose -f docker-compose.dev.yml up
58+
```
4159

4260
⚠️ In development, `docker-compose -f docker-compose.dev.yml up` enables hot module reloading while you make modifications to the code. `docker-compose up` should be used for production/staging deployments.
4361

4462
This will start hydra where the token issuer is at `http://localhost:4444` and the admin interface is at `http://localhost:4445`. This also sets up the consent and login interface at `http://localhost:8989` (where we will create a first-party oauth app)
4563

46-
### Setting up the first party app
64+
### Setting up the OSM-teams app
4765

48-
Create the first party "manage" app
49-
```
66+
Create the [first-party](https://auth0.com/docs/applications/concepts/app-types-first-third-party) "manage" app
67+
68+
```bash
5069
docker-compose exec hydra hydra clients create --endpoint http://localhost:4445 \
5170
--id manage \
5271
--secret manage-secret \
@@ -56,13 +75,10 @@ docker-compose exec hydra hydra clients create --endpoint http://localhost:4445
5675
--callbacks http://localhost:8989/login/accept
5776
```
5877

59-
Migrate the database
60-
```
61-
npm install
62-
npm run migrate
63-
```
64-
78+
<!-- markdownlint-disable MD034 -->
6579
✨ You can now login to the app at http://localhost:8989
80+
<!-- markdownlint-enable MD034 -->
6681

6782
## Acknowledgments
83+
6884
- This app is based off of [OSM/Hydra](https://github.com/kamicut/osmhydra)

0 commit comments

Comments
 (0)