Thank you for your interest in contributing to mockbook.
Please report issues in our GitHub repository. Before submitting an issue, please search for existing issues to avoid duplicates.
This project consists of the following components:
- Python package (
mockbook), a FastAPI application serving mock endpoints with live reloading on file changes (/app/mockbook) - Preconfigured JupyterLab for writing mock endpoints
- Preconfigured NGINX reverse proxy for full mocking flexibility
- NGINX reloader triggered by configuration file changes (
/app/mockbook/nginx)
This project uses the following tech stack:
- Python 3.14
- uv for dependency management and configuration
- FastAPI for serving mock endpoints
- JupyterLab for writing mock endpoints
- NGINX for reverse proxy
- Supervisor for running services
- Ruff to format and lint Python code, and Mypy for type checking
- shfmt and shellcheck for formatting and linting shell scripts, and BATS for running tests
docs/: Documentation resourcesexamples/: Usage examplesjupyterlab/: JupyterLab configurationmockbook/: The project's Python package source codemockbook/nginx/: NGINX configuration filesscripts/: Shell scripts for running servicessupervisord/: Supervisor configuration filestest/: Project testsdocker-compose.yaml: Docker Compose configuration for local development and testingdocker-entrypoint.sh: Docker entrypoint scriptDockerfile: Docker image definitionflake.nix: Nix Flakes development environmentJustfile: Commands for developmentpyproject.toml: Project dependencies and configuration
For development, the following tools are required:
You need Docker and Docker Compose installed on your system.
This repository uses Nix Flakes to manage development tools. The following tools are installed automatically when nix is available:
pre-commitjustuvnginx
Simply run nix develop to enter the development environment, then run just install to set up dependencies. The Nix shell also installs the pre-commit hooks automatically.
If you prefer using a Dev Container, an example configuration file (devcontainer.json) is provided with Nix and Docker-in-Docker pre-installed.
Before pushing your code, run just ci to verify that your changes adhere to the project's coding standards and pass all linters, formatters, and tests.
Alternatively, use the pre-commit hooks to handle formatting, linting, type checking, and quick test feedback automatically.
Please feel free to submit pull requests on GitHub. Before opening a PR, ensure your changes pass all checks by running just ci.
The Docker image is published to Docker Hub automatically on pushes to the main branch. To release a new version, create a release in GitHub Releases with a v* tag, which will trigger the publish.yaml workflow to build and push the Docker image with semantic version tags.