Stellarchain V4 is a Next.js App Router frontend for Stellar and Soroban data exploration:
- ledger / transaction / operation / effect browsing
- accounts and labels
- markets, assets, liquidity pools
- Soroban contracts, events, metadata, verification
The app is client-first ('use client') and targets static-friendly behavior with client-side data loading.
- Next.js 16
- React 19
- TypeScript
- Tailwind CSS
@stellar/stellar-sdk- Axios (for Stellarchain API service client)
npm run dev # start dev server
npm run build # production build
npm run start # serve production build
npm run lint # lint
npx tsc --noEmit # type-checkUse this for end-to-end local testing of the built static app served by Nginx:
docker build --no-cache -t stellarchain-static .
docker run --rm -p 8080:80 stellarchain-staticThen open http://localhost:8080.
src/
app/ # Next.js routes
components/ # UI components (desktop/mobile/shared)
contexts/ # React contexts
services/ # external clients (api, horizon, soroban)
lib/
network/ # network config/state
stellar/ # Stellar domain client + graph + types
soroban/ # Soroban domain (client, events, metadata, storage, tokens, verification)
shared/ # shared types/utilities aliases (interfaces/routes/xdr/design)
helpers.ts
projects.ts
searchRouting.ts-
src/services/api.js- Stellarchain API base:
https://api.stellarchain.dev - v1 base:
https://api.stellarchain.dev/v1 - default query param
network=mainnet
- Stellarchain API base:
-
src/services/horizon.js- single place for Horizon server creation and base URL resolution
-
src/services/soroban.js- single place for Soroban RPC server creation and passphrase resolution
-
src/lib/stellar/*- business/domain logic for Horizon + market/account transformations
-
src/lib/soroban/*- Soroban reads, event parsing, contract metadata/storage/verification/token registry
- Prefer
services/*for external client setup. - Keep
lib/*for domain logic and transformations. - Avoid new raw
fetch/new Horizon.Serverscattered in pages/components when a service/client helper exists. - Use
@stellar/stellar-sdkflows for Horizon/Soroban where available. - Keep network behavior consistent (
mainnet,testnet,futurenet) vialib/network/*. - Preserve client-side data loading pattern (
useEffect,useState) for route pages. - Keep UI style consistent with existing Tailwind patterns.
Use this checklist before submitting changes:
- Architecture
- Do not add new API clients in random files.
- Reuse
src/services/api.js,src/services/horizon.js,src/services/soroban.js. - Place new Stellar logic under
src/lib/stellar/*and Soroban logic undersrc/lib/soroban/*.
- Types
- Put reusable interfaces/types in
src/lib/shared/interfaces.ts(or domaintypes.tsfiles). - Avoid
anyunless strictly unavoidable.
- Networking
- Keep Stellarchain API requests using
network=mainnetby default unless explicit override is required. - Prefer SDK page shape (
records,next()) and guard optional_linkswhen API payloads can vary. - Use
axiosviasrc/services/api.jsfor Stellarchain API HTTP requests. - Use
@stellar/stellar-sdk(throughsrc/services/horizon.js/src/services/soroban.jsand lib wrappers) for Horizon and Soroban requests. - Avoid introducing direct
fetchcalls for new request flows unless there is a clear technical reason.
- Refactoring style
- Prefer
async/awaitover nested.then/.catch. - Reduce callback chains and keep effects readable.
- Avoid unnecessary abstractions if they increase complexity without value.
- Validation
- Run:
npm run lintnpx tsc --noEmit
- For large changes, run targeted lint/type-check on touched files first, then full checks.
- Safety
- Do not revert unrelated changes.
- Do not use destructive git commands unless explicitly requested.
- No environment variables are required by default.
- If new env vars are introduced, update this README and document defaults/fallbacks.