Skip to content

Commit

Permalink
chore: update local development instructions in README (#2321)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Oct 17, 2023
1 parent 7dba169 commit 44eebf0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
API_PORT=7002
API_URL_EXT=http://localhost:${API_PORT}

# JWT_SECRET must be at least 32 characters
JWT_SECRET=👻

SESSION_SECRET=👻

# Google Cloud OAuth 2.0 Client ID
GOOGLE_CLIENT_ID=👻
GOOGLE_CLIENT_SECRET=👻

Expand Down Expand Up @@ -49,9 +51,9 @@ MINIO_ADMIN_PORT=9001

# PostgreSQL
PG_PORT=7001
PG_DATABASE=👻
PG_DATABASE=planxdb
PG_USERNAME=dbuser
PG_PASSWORD=👻
PG_USERNAME=👻

# PG user with permission to sync content between environments
PRODUCTION_PG_URL_FOR_USER_GITHUB_ACTIONS=👻
Expand Down
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ planx-new is a monorepo containing our full application stack. Here's a quick su

1. Download and install the following dependencies if you don't have them already:
- [Docker](https://docs.docker.com/get-docker/)
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)
- [Docker Compose](https://docs.docker.com/compose/install/)
- [PNPM](https://github.com/pnpm/pnpm) `npm install -g [email protected]`
- [Node](https://nodejs.org/en/download) `pnpm env use --global 18.16.1`
- [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)

1. Clone this repository.
**If you're an OSL developer:**

1. Clone this repository

2. Setup your AWS CLI client with SSO - [detailed guide here](https://github.com/theopensystemslab/planx-new/blob/main/doc/how-to/how-to-setup-aws-sso-credentials.md)

Expand All @@ -48,6 +51,30 @@ planx-new is a monorepo containing our full application stack. Here's a quick su

9. Open `http://localhost:3000` and login with your Google email address

**If you're not a member of OSL, follow these steps:**

1. Fork or clone this repository

2. Copy all `.example` env files into their respective directories and replace 👻 with a string like "SECRET" or longer where noted

3. Setup free OAuth Client ID credentails in the [Google Cloud APIs console](https://console.cloud.google.com/apis/credentials)
- Application type = "Web application"
- Authorised JavaScript origins = "http://localhost:3000"
- Authorised redirect URIs = "http://localhost:7002/auth/google/callback"
- Update the `GOOGLE_CLIENT_ID` & `GOOGLE_CLIENT_SECRET` env vars with your new credentials

4. Run `pnpm start` from the project root to set up docker containers for the application's backend (postgres, sharedb, api and hasura server processes). Please note you will not be able to run commands that sync seed data from production.

5. Move into the hasura directory `cd ../hasura.planx.uk` and install dependencies `pnpm i`.

6. Open [Hasura's](https://hasura.io/) web console (`cd hasura.planx.uk` then `pnpm start`) and add your Google email address to the `users` table. You'll also likely want to create an initial `team`. This will eventually allow you to authenticate into the application as an admin.

7. Follow steps 7-9 above to start the editor and login !

At this point you'll be running the full Planx application locally in a docker container. See our Github Actions pull request workflow as an example of how to deploy via docker to a virtual linux server, or explore the `infrastructure` directory for how to deploy via Pulumi infrastructure-as-code to AWS.

We'd love to hear what you're building on Planx, don't hesitate to get in touch with questions.

### Docker

The root of the project has several scripts set up to help you manage your docker containers:
Expand Down Expand Up @@ -111,3 +138,4 @@ There are a few dependent packages that are closely related to this project:

- https://github.com/theopensystemslab/planx-core
- https://github.com/theopensystemslab/map
- https://github.com/theopensystemslab/digital-planning-data-schemas
1 change: 1 addition & 0 deletions editor.planx.uk/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Used in local development and testing, overwritten in .env.production
# This file does not (and should not) contain secrets - all values here are publicly exposed
# If you're working off a fork of Planx, please replace the AIRBRAKE and FEEDBACK_FISH values with a mock value like "SECRET"

REACT_APP_AIRBRAKE_PROJECT_ID=329753
REACT_APP_AIRBRAKE_PROJECT_KEY=388fe6f4cc0d6644c923500d5672a5b6
Expand Down

0 comments on commit 44eebf0

Please sign in to comment.