High-performance microservice architecture, off-chain event ingestion, transaction relayer engine, and REST/WebSocket API gateways powering StellarFlow—the next-generation DEX, yield, and cross-border remittance protocol on the Stellar network.
stellarflow-backend handles off-chain processing, indexing, transaction relaying, and liquidity aggregation for the StellarFlow ecosystem. Built with FastAPI, PostgreSQL/TimescaleDB, and Redis, the backend provides low-latency data pipelines and seamless integration with Soroban smart contracts and Stellar SEP protocols.
stellarflow-backend/
├── app/
│ ├── api/ # REST & WebSocket API route handlers (FastAPI)
│ ├── auth/ # SEP-10 JWT auth, OAuth2/OIDC, and WebAuthn handlers
│ ├── core/ # Settings, logging, Database connections, & Redis pools
│ ├── indexer/ # Soroban RPC event stream parsers & XDR deserializer
│ ├── models/ # AsyncPG/SQLAlchemy ORM schemas & Pydantic models
│ ├── relayer/ # Relayer wallet sequence guards & KMS transaction signers
│ ├── remittance/ # SEP-12 (KYC), SEP-24 (Interactive), & SEP-31/38 quote servers
│ ├── services/ # Order book matching, TWAP pricing, & liquidity route solvers
│ └── workers/ # Celery background jobs, liquidation triggers, & auto-harvesters
├── migrations/ # Alembic database schema migrations
├── scripts/ # Developer tooling, database seeders, & setup scripts
└── tests/ # Pytest unit, integration, & Locust load testing suites
- Framework: Python 3.11+ / FastAPI
- Database & Caching: PostgreSQL 15+ (AsyncPG) / TimescaleDB & Redis Sentinel
- Task Queue & Event Bus: Celery & Redis Streams
- Blockchain Integration: Soroban RPC, Stellar SDK, XDR Parsers
- Authentication & Security: SEP-10, WebAuthn, AWS KMS, OAuth2
- Monitoring & Observability: Prometheus, Grafana, OpenTelemetry, & Sentry
- Docker & Docker Compose
- Python 3.11+
- Poetry or
pip
Clone the repository and install dependencies:
git clone [https://github.com/stellarflow/stellarflow-backend.git](https://github.com/stellarflow/stellarflow-backend.git)
cd stellarflow-backend
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Spin up PostgreSQL, Redis, and local Soroban RPC containers:
docker-compose up -d
Apply database migrations and populate staging mock data:
alembic upgrade head
python -m app.cli seed-db
Start the FastAPI development server with hot-reloading:
uvicorn app.main:app --reload --port 8000
Visit http://localhost:8000/docs to access interactive Swagger API documentation.
Run unit and integration test suites with Pytest:
# Run all tests with coverage report
pytest --cov=app --cov-report=term-missing
# Run end-to-end integration tests
pytest tests/e2e/
Run linter and code formatting checks:
black --check app/
ruff check app/
mypy app/
We welcome open-source contributions! Please pick any open task from the issue tracker labeled good-first-issue or help-wanted.
- Fork the repo and create a feature branch (
git checkout -b feature/my-feature). - Commit your changes and add unit test coverage.
- Submit a Pull Request linking the issue ID.
Thank you for contributing to the StellarFlow backend infrastructure!
This repository is licensed under the MIT License.