Skip to content

Commit

Permalink
Merge pull request #71 from MrHappyEnding/update-readme
Browse files Browse the repository at this point in the history
#69 Update README.md for Google Maps documentation
  • Loading branch information
aaronbrethorst authored Apr 5, 2024
2 parents 5ab2ca0 + f582195 commit d9e91b3
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,59 @@ Then you can connect to it programmatically using `mysql`:
```bash
mysql -u oba_user -p -h localhost:3306
```

### Using Google Maps

#### Prerequisites

- Have a valid Google Cloud Platform (GCP) account.
- Create a project on GCP and enable the Maps JavaScript API for it.
- Create an API key for your project. [See how to create an API key](https://cloud.google.com/docs/authentication/api-keys).
- If there is a rate limit error while using the test API key, it means you have reached the maximum usage limit for that key, you need to generate a new API key.

#### Configuring Google Maps

You'll need to set the following environment variables:

- `GOOGLE_MAPS_API_KEY`: Your Google Maps API key.
- `GOOGLE_MAPS_CLIENT_ID`: (Optional) Required if you are using the Google Maps Premium Plan.
- `GOOGLE_MAPS_CHANNEL_ID`: (Optional) A channel ID that helps identify the source of API requests for analytics and reporting purposes.

#### Docker Configuration

If using Docker Compose:

1.Modify the 'docker-compose.yml' file like this:

```yaml
services:
oba-app:
environment:
- GOOGLE_MAPS_API_KEY=<YOUR_KEY_HERE>
- GOOGLE_MAPS_CHANNEL_ID=<YOUR_CHANNEL_ID_HERE>
- GOOGLE_MAPS_CLIENT_ID=<YOUR_CLIENT_ID_HERE>
```
2.Use the following command to start the oba-app service:
```bash
docker-compose up -d oba-app
```


If deployed in Kubernetes environment:

1.Use the kubectl set env command to set new environment variables,
make sure you replace deployment/oba-app with the actual name of your deployment:

```bash
kubectl set env deployment/oba-app GOOGLE_MAPS_API_KEY=<YOUR_KEY_HERE> \
GOOGLE_MAPS_CHANNEL_ID=<YOUR_CHANNEL_ID_HERE> \
GOOGLE_MAPS_CLIENT_ID=<YOUR_CLIENT_ID_HERE>
```

2.Use the following command to rebuild and start the oba app service:

```bash
kubectl rollout restart deployment/oba-app
```

0 comments on commit d9e91b3

Please sign in to comment.