Architecture
How StepFi's three repos work together
Architecture
StepFi is built across three repositories that work together as one protocol.
System Overview
StepFi-App (React Native + Expo)
|
| REST + JWT
v
StepFi-API (NestJS + Fastify)
| |
| Unsigned XDR | SQL queries
v v
Soroban Contracts Supabase (PostgreSQL)
(Stellar Ledger) |
| | Cache
| Redis (Upstash)
v
Stellar Horizon
(Transaction submit)
StepFi-API
NestJS backend with Fastify adapter. Handles wallet authentication, unsigned XDR construction, and off-chain data storage.
- Runtime: Node.js 20
- Framework: NestJS v11 with Fastify
- Database: Supabase (PostgreSQL)
- Cache: Redis via Upstash
- Auth: Stellar wallet signatures plus JWT tokens
- Live: https://stepfi-api.onrender.com/api/v1/docs
StepFi-Contracts
5 Soroban smart contracts written in Rust, deployed on Stellar testnet.
- Language: Rust
- Runtime: Soroban WASM
- Network: Stellar Testnet
- Release: v1.0.0 with all WASM artifacts
StepFi-App
React Native mobile app built with Expo.
- Framework: React Native + Expo SDK 52
- Navigation: Expo Router
- State: Zustand
- Wallets: Freighter + Lobstr (WalletConnect v2)
- Build: EAS Build
Loan Application Flow
- Learner connects wallet (Freighter or Lobstr)
- App calls POST /api/v1/auth/nonce
- Learner signs nonce with their wallet
- App calls POST /api/v1/auth/verify with signed nonce
- API verifies signature on Stellar network
- API returns JWT access token + refresh token
- Learner submits loan application
- API builds unsigned XDR calling creditline.create_loan()
- App prompts learner to sign XDR with their wallet
- API submits signed XDR to Stellar Horizon
- Transaction confirmed on ledger
- Loan record created in Supabase