Skip to content

Connects the chargEV CloudKit Backend with the chargev-db Database

License

Notifications You must be signed in to change notification settings

ev-freaks/chargev-db-cloudkit-connector

Repository files navigation

chargEV DB CloudKit Connector

Abstract

This connects the chargEV App CloudKit Backend to chargev-db.

Development

Setup

Obtain an auth JWT

Use the chargEV DB API CLI:

./api-cli.ts --generate --source 0 --client chargEVApp --type CKCheckIn

Setup .env

Create a .env file for development:

GE_API_KEY=<here your GoingElectric API Auth Key>
CHARGEV_DB_API_JWT=<here the chargev-db JWY Auth Key>
CHARGEV_DB_API_URL=http://localhost:3001/api/v1
CLOUDKIT_KEY_ID=<here your cloudkit key>
CLOUDKIT_CONTAINER=iCloud.info.lazar.EVPlugFinder
CLOUDKIT_ENV=development

Heroku

This App is currently deployed on Heroku:

https://dashboard.heroku.com/apps/chargev-db-cloudkit-connector

ENV vars

For production set the same env vars listen in the .env file using e.g. heroku config:add.

CloudKit PEM Key

Make sure you create a config var for the PEM file:

heroku config:add CLOUDKIT_PRIVATE_KEY_FILE="$(cat eckey.pem)"

Then use the supplied targets in package.json to create the key file on the local filesystem:

npm run create-cloudkit-key

Note: this hook will be called automatically after each npm install as well.

About

Connects the chargEV CloudKit Backend with the chargev-db Database

Resources

License

Stars

Watchers

Forks

Packages

No packages published