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

Chore: Update README #528

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 36 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,19 @@ See [getting started](https://financialtimes.atlassian.net/wiki/spaces/Accounts/

### Other contracts

If you need to test a specific contract, since all contracts live in the production salesforce environment, in order to test certain contracts locally you will need to use the production `SALESFORCE_*` environment variables rather than the development ones (see Doppler).

In development mode you should be using the FT Staff contract, which is stubbed in `stubs/CA-00001558.json`

All contracts except `CA-00001558` live in the production salesforce environment. If you need to test a specific contract locally, you need to add the suffix `_PROD` to the `SALESFORCE_*` environment variables defined in `custom-environment-variables.yaml`.

```yaml
SALESFORCE:
CALLBACK_URI: "SALESFORCE_CALLBACK_URI" # no changes needed
CLIENT_ID: "SALESFORCE_CLIENT_ID_PROD" # SALESFORCE_CLIENT_ID
CLIENT_SECRET: "SALESFORCE_CLIENT_SECRET_PROD" # SALESFORCE_CLIENT_SECRET
PASSWORD: "SALESFORCE_PASSWORD_PROD" # SALESFORCE_PASSWORD
USERNAME: "SALESFORCE_USERNAME_PROD" # SALESFORCE_USERNAME
```

---

## Run locally
Expand All @@ -78,7 +87,12 @@ You MIGHT need:

If you need to use the database locally, set up the database by following the instructions in [next-syndication-db-schema](https://github.com/Financial-Times/next-syndication-db-schema).

If you are using postgres in Docker, you will need to edit your `.env` file to set `DATABASE_HOST` to `192.168.99.100`
If you are using postgres in Docker, you will need to edit your `custom-environment-variables.yaml` file to change `DATABASE_HOST` to `DATABASE_HOST_DOCKER` (variable already defined in Doppler).
Copy link
Contributor

@asugar13 asugar13 Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought: Thanks for adding these docs. I wonder if anyone ever ran postgres in Docker to run syndication 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt that too. In the README of next-syndication-db-schema it mentions setting up the Postgres DB in Docker (or tried to, since that section is empty 🤷), so I supposed someone might want to run the DB in Docker.


```yaml
DB:
host: "DATABASE_HOST_DOCKER" # DATABASE_HOST
```

### Running the API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think we should stop mentioning the .env file on line 87 as we noticed that this needs to be on doppler instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we still need to edit the .env for next-router. Just checked Doppler and all the syn- env var are available. Will update this part.


Expand Down Expand Up @@ -107,10 +121,27 @@ Once you have set up the projects you want to work on, and want to run all proje

### Running against prod DB (optional)

To run `next-syndication-api` against prod DB is necessary add to the environment variables defined in `custom-environment-variables.yaml` the prefix `_PROD`.
("DATABASE_NAME_PROD",DATABASE_HOST_PROD","DATABASE_PASSWORD_PROD","DATABASE_PORT_PROD","DATABASE_URL_PROD","DATABASE_USER_NAME_PROD").
To run `next-syndication-api` against prod DB you need to add the suffix `_PROD` to the `DATABASE_*` environment variables defined in `custom-environment-variables.yaml`.

```yaml
DB:
database: "DATABASE_NAME_PROD" # DATABASE_NAME
host: "DATABASE_HOST_PROD" # DATABASE_HOST
password: "DATABASE_PASSWORD_PROD" # DATABASE_PASSWORD
port: "DATABASE_PORT_PROD" # DATABASE_PORT
uri: "DATABASE_URL_PROD" # DATABASE_URL
user_name: "DATABASE_USER_NAME_PROD" # DATABASE_USER_NAME
```

These variables are already defined in development Doppler folder.

In addition, you need to add the `ssl: true` option in `default.yaml` to bypass the SSL authenication error.

```yaml
DB:
ssl: true
```

### Running the Syndication UI (optional)

- if you also want to locally test all the `/republishing` pages, `cd` into `next-syn-list` and run `npm run start`
Expand Down