A full-stack DeFi platform built on Stellar and Soroban — Stellar's smart contract platform.
SoroFi lets users mint tokens, participate in DAO governance, stream payments, interact with AMM pools, and more — all from a single platform with a Next.js frontend, Node.js backend, and a suite of Rust/Soroban smart contracts.
sorofi/
├── frontend/ # Next.js 14 app (App Router)
├── backend/ # Node.js / Express API
└── contracts/ # Rust / Soroban smart contracts
Built with Next.js 14 (App Router), Tailwind CSS, and Zustand for state management.
| Route | Description |
|---|---|
/ |
Dashboard — mint tokens and view your assets |
/governance |
DAO governance — create and vote on proposals |
/developer-hub |
API and contract documentation |
@stellar/freighter-api— Freighter wallet integrationreact-i18next— i18n (English + Arabic)zustand— client state managementreact-toastify— notificationslucide-react— icons
cd frontend
npm install
cp .env.example .env.local
npm run devNEXT_PUBLIC_API_BASE_URL=http://localhost:5000/api
NEXT_PUBLIC_STELLAR_NETWORK=TESTNET
NEXT_PUBLIC_NETWORK_PASSPHRASE=Test SDF Network ; September 2015Built with Node.js / Express, using Knex for database access (SQLite in dev, PostgreSQL in prod), Redis for caching, and Socket.io for real-time events.
- SEP-10 challenge-response authentication via Freighter
- Token minting and asset management
- Off-chain governance (Snapshot-style token-weighted voting)
- Payment streaming
- Webhook delivery
- Billing via Stripe
- Event indexing from Soroban contract events
- Rate limiting, fraud detection, and audit logging
cd backend
npm install
cp .env.example .env
# Edit .env with your credentials
npm run dev| Variable | Description |
|---|---|
SOROBAN_RPC_URL |
Soroban RPC endpoint (Testnet/Futurenet) |
NETWORK_PASSPHRASE |
Stellar network passphrase |
DATABASE_URL |
PostgreSQL connection string (prod) |
REDIS_URL |
Redis connection string |
JWT_SECRET |
Secret for signing JWTs |
STRIPE_SECRET_KEY |
Stripe API key for billing |
See backend/.env.example for the full list.
| Prefix | Description |
|---|---|
POST /api/auth/challenge |
SEP-10 challenge |
POST /api/auth/login |
Exchange signed XDR for JWT |
GET /api/tokens/:address |
List tokens for a wallet |
POST /api/tokens |
Mint a new token |
GET /api/proposals |
List governance proposals |
POST /api/proposals |
Create a proposal |
POST /api/proposals/:id/votes |
Cast a vote |
GET /api/voting-power |
Get your voting power |
Full API docs are available at /api/docs (Swagger UI) when the backend is running.
Written in Rust targeting the Soroban runtime. The workspace lives in contracts/.
| Contract | Description |
|---|---|
token |
SEP-41 token with minting limits and transferability controls |
factory |
Deploys and tracks token contracts |
amm_pool |
Automated market maker liquidity pool |
amm_factory |
Deploys AMM pools |
lending_pool |
Collateralised lending and borrowing |
vault |
Asset vault with access controls |
streaming |
Real-time payment streaming |
dividend |
On-chain dividend distribution |
multisig |
Multi-signature transaction approval |
access |
DAO role-based access control |
compliance |
KYC/AML compliance hooks |
vesting |
Token vesting schedules |
timelock |
Time-locked execution |
flash_loan |
Flash loan provider |
merkle_whitelist |
Merkle-proof whitelist |
oracle |
Price oracle integration |
otc_escrow |
OTC trade escrow |
lottery |
On-chain lottery |
zk_audit_log |
Zero-knowledge audit log |
- Rust with
wasm32-unknown-unknowntarget - Stellar CLI
rustup target add wasm32-unknown-unknowncd contracts
cargo build --release --target wasm32-unknown-unknowncd contracts
cargo testSoroFi uses SEP-10 for wallet-based authentication:
- Frontend requests a challenge transaction from the backend
- User signs the transaction with their Freighter wallet
- Signed XDR is submitted to the backend
- Backend verifies the signature and returns a JWT
- JWT is used for all subsequent authenticated requests
Run all three layers locally:
# Terminal 1 — backend
cd backend && npm run dev
# Terminal 2 — frontend
cd frontend && npm run dev
# Terminal 3 — contracts (optional, for testing)
cd contracts && cargo testFrontend runs on http://localhost:3000, backend on http://localhost:5000.
MIT