SoroScan is a developer-focused indexing service for Soroban smart contract events on the Stellar blockchain. It provides a hybrid on-chain/off-chain architecture to index, query, and subscribe to smart contract events in real-time.
- Django Backend: A Python-based ingestion layer and API provider using Django, Django Rest Framework (REST), Strawberry (GraphQL), and Celery (Webhook dispatching).
- Next.js Frontend: A modern web dashboard for exploring events, built with Next.js, Apollo Client, and Tailwind CSS.
- Admin Dashboard: A specialized Next.js application for administrative tasks.
- Soroban Contracts: Rust smart contracts that emit standardized events for indexing.
- SDKs: Client libraries for Python and TypeScript to interact with the SoroScan API.
- Documentation: Docusaurus-based documentation for users and developers.
- Smart Contract: Emits structured
EventRecordevents. - Ingestion Layer: Streams events from Horizon/Soroban RPC and persists to PostgreSQL.
- Query Layer: Exposes data via REST, GraphQL, and push-based webhooks.
The easiest way to run the entire stack locally:
docker-compose up --buildLocated in django-backend/.
- Setup:
pip install -r requirements.txt - Migrations:
python manage.py migrate - Run Server:
python manage.py runserver - Celery Worker:
celery -A soroscan worker --loglevel=info - Celery Beat:
celery -A soroscan beat --loglevel=info
Located in soroscan-frontend/.
- Setup:
pnpm install - Dev:
pnpm dev - Codegen:
pnpm run codegen(Required after GraphQL schema changes) - Build:
pnpm build
Located in admin/.
- Setup:
npm install - Dev:
npm run dev
Located in soroban-contracts/soroscan_core/.
- Build:
cargo build --target wasm32-unknown-unknown --release
Uses pytest with pytest-django.
cd django-backend
pytestUses jest and React Testing Library.
cd soroscan-frontend
pnpm testUses standard Rust cargo test.
cd soroban-contracts/soroscan_core
cargo test- Use
.envfiles for local configuration. Seedjango-backend/.env.examplefor reference. - Important variables:
DATABASE_URL,REDIS_URL,SOROBAN_RPC_URL,SOROSCAN_CONTRACT_ID.
- REST: Implemented in
django-backend/soroscan/ingest/views.pyusing DRF. - GraphQL: Implemented in
django-backend/soroscan/ingest/schema.pyusing Strawberry. - Frontend Integration: Always run
pnpm run codegeninsoroscan-frontend/after modifying the backend GraphQL schema.
- Python: Follows PEP 8. Formatting tools like
blackandruffare recommended. - TypeScript/React: Next.js conventions with Tailwind CSS for styling.
- Rust: Standard
cargo fmtandclippyfor contracts.
- Do not commit
.envfiles or local build artifacts. - Sub-projects (backend, frontend, contracts) have their own
.gitignorefiles.