Connector Local Development Set-up
This article serves as a guide to getting connectors set up for local development.
1 - Basics
- Fork and clone the project repository for the connector on your machine
- Navigate to the project directory in your console and run:
bundle install
- Be sure to set up your database by running:
rake db:setup
2 - Environment Variables
Before starting the connector, the environment variables must be set:
2.1 - application.yml
From your console run: cp config/application.sample.yml config/application.yml
Your application.yml
file should look something like this:
encryption_key1: encryption_key2: SIDEKIQ_USERNAME: admin SIDEKIQ_PASSWORD: password REDIS_URL: redis://localhost:6379/0/<project-name> MNO_DEVPL_HOST: https://dev-platform.maestrano.com MNO_DEVPL_API_PATH: /api/config/v1/marketplaces MNO_DEVPL_ENV_KEY: MNO_DEVPL_ENV_SECRET:
2.1.1 - Encryption Keys
These can be set to anything. Just be sure to set them as they are required for the connector to run.
2.1.2 - MNO_DEVPL Variables
- MNO_DEVPL_HOST => The url to the developer platform that the connector will be using
- MNO_DEVPL_API_PATH => Usually already set in the project; This is the path the connector will use to fetch the marketplace environments/configuration from the Developer Platform
- MNO_DEVPL_ENV_KEY & MNO_DEVPL_ENV_SECRET => These variables can be found in the Developer Platform (Each environment has a different set of keys)
2.2 - Additional Environment Variables
To run your connector locally you may need to set the $PORT
and $RACK_ENV
variables manually. For example (In your terminal):
export PORT=3001 export RACK_ENV=development
3 - Developer Platform Configuration
If you are using a connector that requires https requests (via an ngrok forwarding address). You will want to set the endpoint you are using on the developer platform. You can do so by logging in to the developer platform, finding the application you are using, and clicking on the appropriate environment (usually "Local"). Be sure to update the Host and IDM endpoints.
This must be done before starting the connector or you will experience redirection issues.
4 - Connector Specific - Additional Set-up
Each specific connector may have some variations to the set-up process:
4.1 - BigCommerce
4.1.1 - Additional Environment Variables
The bc_client_id and bc_client_secret should be set to the client_id and client_secret from your BigCommerce API account:bc_client_id:
andbc_client_secret:
- Sign up for an account at https://www.bigcommerce.com/ (You can just use a free trial account)
- Once you have created your account, sign-in to your BigCommerce dashboard
- From the dashboard you will need to go to: Advanced Settings → API Accounts
- Create an API account. On creation, you will be provided with credentials for your new API account. These include your Client ID, Client Secret, and Access Token. (be sure to save these as they cannot be retrieved again later)
DEFAULT_APP_PROTOCOL:
andDEFAULT_APP_HOST:
- The DEFAULT_APP_PROTOCOL and DEFAULT_APP_HOST should be set to the url for your ngrok forwarding address (e.g. DEFAULT_APP_PROTOCOL: https, DEFAULT_APP_HOST: 9fd9ca8e.ngrok.io)