Customization
Stoobly Scaffold Structure - Questions & Answers
After scaffolding an app and services, Stoobly creates a comprehensive directory structure in .stoobly/services/ with workflow-specific configurations, Docker compose files, and helper scripts.
📚 Related Documentation:
Understanding Scaffold Structure
Q: Where does the scaffold get created?
A: The scaffold is created in the .stoobly/services/ directory within your application directory.
Example:
# Create app
stoobly-agent scaffold app create my-app --app-dir-path ./my-project
# Scaffold structure created at:
# ./my-project/.stoobly/services/Q: What is the overall structure of a scaffolded app?
A: The scaffold contains core services (build, entrypoint, gateway, stoobly-ui), user-defined services, a Makefile, and workflow-specific configurations.
Example:
Docker vs Local Runtime Differences
Q: What's the difference between --runtime docker and --runtime local?
A: Docker runtime creates additional core services (build, entrypoint, gateway) for containerized execution, while local runtime creates a simpler structure for native execution.
Example:
For more details:
Understanding Core Services
Q: What is the stoobly-ui service?
A: The stoobly-ui service provides the web interface for managing requests, scenarios, and configuration. It's available in both Docker and local runtimes.
Example:
Note: For Docker-specific services (build, entrypoint, gateway), see docker.md.
Service-Specific Directories
Q: What files are created for each user-defined service?
A: Each service gets workflow directories (mock, record, test) with configure script, init script, lifecycle hooks, fixtures, and public directory. Docker runtime also includes docker-compose.yml files.
Example:
Q: What is the purpose of the configure script?
A: The configure script sets up Stoobly configuration (rewrite rules, match rules, firewall rules) before the workflow starts.
Example:
Q: What is the purpose of the init script?
A: The init script runs custom initialization logic during service startup, such as database setup, file preparation, or environment checks.
Example:
Note: For Docker-specific docker-compose.yml customization, see docker.md.
Q: What is the fixtures.yml file used for?
A: The fixtures.yml file contains mock response data for the service, used during mock and test workflows.
Example:
Q: What is the lifecycle_hooks.py file used for?
A: The lifecycle_hooks.py file contains Python functions that modify requests/responses during interception.
Example:
Q: What is the public/ directory used for?
A: The public/ directory serves static files for mocking, useful for serving images, CSS, JavaScript, or other assets.
Example:
Workflow-Specific Configurations
Q: How are workflows organized?
A: Each service has separate directories for mock, record, and test workflows, allowing different configurations per workflow.
Example:
Q: Can I have different configurations for different workflows?
A: Yes, each workflow directory has its own configure script, docker-compose.yml, and fixtures, allowing complete customization per workflow.
Example:
Custom Workflows
Q: How do I create a custom workflow?
A: Use scaffold workflow create to create a new workflow based on a template (mock, record, or test).
Example:
Q: What gets created for a custom workflow?
A: A custom workflow gets the same structure as standard workflows: configure, docker-compose.yml, init, fixtures.yml, lifecycle_hooks.py, and public/.
Example:
Temporary Runtime Files
Q: What is the .stoobly/tmp/ directory?
A: The tmp/ directory contains runtime files generated during workflow execution, including logs, run scripts, and Traefik configuration.
Example:
Note: For Docker-specific run.sh script details, see docker.md.
Troubleshooting
Q: How do I debug scaffold issues?
A: Check the generated files in .stoobly/services/ and .stoobly/tmp/, and use --dry-run to see what commands would execute.
Example:
Q: Where can I find workflow logs?
A: Workflow logs are stored in .stoobly/tmp/<workflow>/logs/.
Example:
Note: For Docker-specific log viewing, see docker.md.
Q: How do I verify my service configuration?
A: Run the configure script manually and verify Stoobly configuration.
Example:
Note: For Docker-specific configuration verification, see docker.md.
Quick Reference
Q: What are the key directories in a scaffold?
A: Here's a quick reference of important directories:
Example:
Q: What files can I customize?
A: You can customize configure scripts, fixtures.yml, lifecycle_hooks.py, and add files to public/. For Docker runtime, you can also customize docker-compose.yml files.
Example:
For more details:
Last updated
Was this helpful?