Backend for Frontend (BFF) OpenAPI spec generator for BRRTRouter microservices
BFF Generator is a tool for generating Backend for Frontend (BFF) OpenAPI specifications by aggregating microservice OpenAPI specs into unified API gateway specs. It supports multi-suite architectures where each suite has its own BFF.
Status: 🏗️ In Development
- Multi-Suite Support: Generate BFF specs for multiple independent suites
- Automatic Discovery: Discovers OpenAPI specs from directory structure
- Idempotent Generation: Deterministic, sorted output for consistent diffs
- Schema Conflict Resolution: Automatic prefixing to avoid schema name conflicts
- BRRTRouter Integration: Works seamlessly with BRRTRouter-generated services
git clone https://github.com/microscaler/bff-generator.git
cd bff-generator
pip install -e .pip install bff-generator- Debian/Ubuntu:
apt install bff-generator(deb package) - Red Hat/CentOS:
yum install bff-generator(rpm package) - macOS:
brew install bff-generator(Homebrew) - Windows (WSL2): Use Debian/Ubuntu package or pip
# Generate BFF spec for a suite
bff-generator generate-spec \
--suite example-suite \
--openapi-dir openapi/example-suite \
--output openapi/example-suite/openapi_bff.yaml \
--config openapi/example-suite/bff-config.yamlSee USAGE.md for detailed usage instructions.
BFF Generator supports multi-suite architectures where each suite has its own BFF. Examples:
- Example Suite 1: Multiple services →
openapi/example-suite/openapi_bff.yaml - Example Suite 2: Multiple services →
openapi/example-suite-2/openapi_bff.yaml - Example Suite N: Multiple services →
openapi/example-suite-n/openapi_bff.yaml
Each suite can be deployed independently (e.g., in separate Kubernetes namespaces) and has its own BFF that aggregates the microservices within that suite.
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src/ tests/
# Lint code
ruff check src/ tests/
# Type check
mypy src/Licensed under the PolyForm Shield License 1.0.0. See LICENSE for details.
GitHub: https://github.com/microscaler/bff-generator
Status: In Development
Version: 0.1.0