Stoobly Docs
  • Introduction
  • Use Cases
    • Generate Mock APIs
      • Empower Development
      • Scale API Testing
    • Enable E2E Testing
  • FAQ
    • Recording
    • Mocking
    • Terminology
  • Getting Started
    • Installing the Agent
      • Installation with pipx
      • Installation with Docker
  • Core Concepts
    • Agent
      • Intercept Modes
        • Mocking
        • Recording
      • Lifecycle Hooks
      • Proxy Settings
        • Data Rules
        • Firewall Rules
        • Rewrite Rules
        • Match Rules
    • Context
    • Mock API
      • Request
        • Response
        • Replay History
      • Scenarios
      • Snapshots
      • Fixtures
      • Public Folder
    • Scaffold
      • Service
      • Validation
      • Workflow
  • Guides
    • How to Run the Agent
      • Run with CLI
      • Run with Docker
    • How to Configure the Agent
      • Forward Proxy
        • Enable HTTPS Traffic
      • Reverse Proxy
    • How to Record Requests
      • Recording from the UI
      • Recording from the CLI
      • How to Create Contexts
      • How to Create Scenarios
        • Creating from the UI
        • Creating from the CLI
      • How to Create Requests
      • How to Customize Recordings
        • Customizing with Lifecycle Hooks
    • How to Update Requests
      • Editing from the UI
      • Editing with Snapshots
      • How to Update Scenarios
        • Updating from the UI
        • Updating from the CLI
      • Updating with Replay
        • Replaying from the UI
        • Replaying from the CLI
        • How to Customize Replays
          • Customizing with Lifecycle Hooks
      • Updating with Open API
    • How to Mock APIs
      • How to Enable Mocking
        • Enabling from the UI
        • Enabling from the CLI
      • How to Snapshot Requests
        • Deleting Snapshots
        • Sharing Snapshots
      • How to Use Fixtures
      • How to Customize Mocking
        • Customizing with Lifecycle Hooks
        • Customizing with Request Headers
      • Troubleshooting
    • How to Replay Requests
      • Replay with the UI
      • Replay with the CLI
    • How to Integrate E2E Testing
      • How to Scaffold an App
        • Scaffolding a Service
        • Customizing a Workflow
          • Customizing Container Services
          • Customizing Lifecycle Hooks
          • Customizing Init Scripts
          • Customizing Configure Scripts
          • Customizing Makefile
        • Troubleshooting
      • How to Run a Workflow
        • Running with CLI command
        • Running with Make
        • Troubleshooting
          • Validating
      • How to Stop a Workflow
        • Stopping with CLI command
        • Stopping with Make
      • How to Update a Scaffold
        • Deleting a Service
      • FAQ
  • Developer Guide
    • Installation from Source
    • Submitting Change Requests
    • Releases
  • Experimental
    • Experimental Features
      • Aliases
      • Endpoints
      • API Testing
        • Getting Started
        • Configuration
          • Assign
          • Lifecycle Hooks
          • Trace
      • Optional Components
Powered by GitBook
On this page
  • Background
  • What is Scaffold?
  • Terminology
  • Application
  • Networks
  • Service
  • Core Services
  • Workflow
  • Next steps

Was this helpful?

  1. Core Concepts

Scaffold

Background

Without scaffold, setting up Stoobly to record and mock requests involves three core challenges:

  • Service orchestration

    • Configure Stoobly to intercept traffic for multiple services

    • Dynamically generate SSL certificates

    • Support customization through adding user-defined services

  • Consistent ease-of-use across team members

    • Stoobly version management

    • Automated onboarding

    • Opinionated process for recoding, mocking, and testing

  • Separating configuration for different workflows e.g. development and CI

    • Defining a consistent file structure across workflows

    • Scoping container to specific workflows

    • Namespacing containers to enable the same workflow to run multiple times

To solve these challenges, scaffold provides a framework to define services and customize workflows.

What is Scaffold?

Scaffold is implemented as a CLI command to offer an out-of-the-box solution to build a containerized solution to record, mock, and test your applications. These workflows can be easily integrated into CI pipelines and test environments without needing to spend extra development time orchestrating a test setup.

With scaffold, we take an opinionated approach:

  • Use Docker Compose to declaratively define all the services and networking configuration

  • Automatically run Stoobly maintained services for the user such as 1 Stoobly UI, a stoobly-agent proxy per service, and a "Gateway" that intelligently routes requests to the correct service

  • Use CLI commands to make it easy to add new services

  • Allow configuration to be provided in specific files with a consistent experience

As a result, we can enforce best practices and make it easy to run dozens of services in complex setups. There are also opinionated ways of running services and configuring everything correctly for different use-cases such as recording requests, mocking requests, or for a CI pipeline with end-to-end tests.

Terminology

Application

An application represents a source-controlled code repository that depends on one or more services.

Networks

The following networks are created when running a workflow. When defining custom container services, they may need to belong in either (but not both) of the following networks:

  • Specify app.ingress when container services need to reference a service by hostname.

  • Specify app.egress when container services need to access or be accessed by other service containers.

Service

A service represents an application dependency. The service is often, but not necessary responds to HTTP(s) requests. HTTP(s) services can be either:

A "local" service is one that is defined by the user and runs as a Docker container on the user's local environment or machine. The user is expected to provide the Docker Compose specification. These are services that your team owns.

An "external" service is one that isn't ran by the user directly such as services and APIs provided by other teams or third-party ones such as payment processors and other APIs. The user is expected to provide the hostname to this service's API.

Core Services

Core services are automatically created as part of a scaffolded application. These include:

  • stoobly-agent proxies - a proxy will be created per service

  • A Stoobly UI - a single UI that can access your mock data across services

  • Gateway - intelligently routes requests to the correct service

Core services or their configurations should not be modified.

Workflow

A workflow belongs to a service and captures a specific use-case for it. Use cases include, but are not limited to recording, mocking, and testing requests.

When creating a service, the following workflows can be added:

  • mock - used for mocking requests

  • record - used for recording requests

  • test - used for running a scaffolded application in CI or testing environments

Next steps

PreviousPublic FolderNextService

Last updated 5 days ago

Was this helpful?

How to Scaffold an App