Local Dev Environment

Developing integrations in your local environment using your favorite IDE

When developing integrations, you can synchronize your Membrane workspace with your local development environment. This lets you develop without leaving your favorite IDE and tools, while utilizing full functionality of Membrane.

To do it, install and launch Membrane CLI.

It will store your Membrane workspace inside your project directory using the following structure:

your-project-root/
├── membrane.config.yml                    # Workspace configuration file
└── membrane/                              # Workspace data directory
    ├── <element-type>/                    # Universal elements (i.e. actions, flows, etc.)
    |   ├── <element-key>/                 # Specific universal element
    |   |   ├── <element-key>.yaml         # Universal element specification
    |   |   └── ...                        # Other universal element files (tests, etc.)
    ├── integrations/                      # Integration definitions and their elements
    |   ├── <integration-key>/             # Specific integration 
    |   ├── <integration-key>.yaml         # Integration specification 
    |   |   ├── <element-type>/            # Integration-specific elements (i.e. actions, flows, etc.)
    |   |   |   ├── <element-key>/         # Specific integration-specific element
    |   |   |   |   ├── <element-key>.yaml # Integration-specific element specification
    |   |   |   |   └── ...                # Other integration-specific element files (tests, etc.)
    ├── connectors/                        # Connector definitions and source code
    |   ├── connector-key/                 # Specific connector
    |   |   ├── connector-key.yaml         # Connector specification
    |   |   └── <version>/                 # Specific version of the connector
    |   |       ├── src/                   # Source code directory (if un-archived)
    |   |       |   ├── <file>.yml         # Connector file
    |   |       └── src.zip                # Zipped source code (if archived)

Membrane Config

The membrane.config.yml file is used to connect the local development environment to a remote workspace. It looks like this:

workspaceKey: <workspace-key>
workspaceSecret: <workspace-secret>
apiUri: <your base API url - if self-hosted>
testCustomerId: <your customer id for testing>

This file is created during the first launch of the Membrane Code Agent.

Workspace Elements

Workspace elements are stored in the membrane folder inside your project.

This folder contains sub-folders for each workspace element type.

Elements that work across all integrations are stored at the top level organized by element type.

Each element has its own folder. It contains the element's specification in yaml as well as any additional files (tests, custom code used in the element implementation, etc).

Integrations

Integration's folder contains the integration specification as well as list of sub-folders for each integration-specific element type.

The sub-folders of an integration are organized in the same way as the top-level element folders.

Connectors

Connectors have more complex structure than other elements because they can have multiple versions.

Inside each connector folder, there could be any number of sub-folders, one per connector version.

Each version folder has src.zip file that contains the connector's source code. If you want to edit connector in your local environment,
you need to unzip the src.zip file and edit the files in the src/ directory.

Syncronizing Local and Remote Workspaces

Membrane Code Agent will automatically sync your local workspace with the remote one when running.

You can also manually trigger the sync by running membrane pull or membrane push commands to pull configuration from remote workspace or push to it.