Superhero is a modular, React + TypeScript web app for the Aeternity ecosystem that brings together:
- DEX trading and liquidity management
- On-chain governance views and participation
- Trendminer analytics: trending tokens, charts, and real‑time data
- Social posting and tipping with wallet‑based identity
This repository contains the Vite-powered frontend whose runtime configuration lives in src/config.ts (with optional Vite env overrides).
# Install dependencies
npm install
# Start the dev server
npm run dev
# Build for production (outputs to dist/)
npm run build
# Preview the production build locally
npm run preview
# Run unit/component tests
npm test
# Run e2e tests (starts dev server automatically)
npm run test:e2e- DEX: swap, add/remove liquidity, token selection, route info, settings
- Governance: proposals, voting views, accounts and activity
- Trendminer: trending lists, mini charts, candles, and live updates via WebSocket
- Social: create posts, tip users, profile and identity components
- Wallet: connect via supported Aeternity wallets, balances, and fiat value helpers
Key modules live under:
src/components/dex/*— DEX UI, hooks, and widgetssrc/components/explore/*— token and pair explorationsrc/components/pool/*— liquidity managementsrc/components/Trendminer/*— analytics UI (charts, trending, carousels)src/views/*— routed pages
Configuration is defined in code at src/config.ts via the exported CONFIG object. Adjust endpoints and feature flags by editing that file, then rebuild/restart the app. Keys commonly used:
BACKEND_URL— application backendSUPERHERO_API_URL/SUPERHERO_WS_URL— analytics REST and WebSocket endpointsNODE_URL/MIDDLEWARE_URL— Aeternity node and middlewareWALLET_URL— default wallet endpointGOVERNANCE_API_URL— governance backendEXPLORER_URL— block explorer base URLJITSI_DOMAIN— conferencing domain for meeting linksDEX_BACKEND_URL,MAINNET_DEX_BACKEND_URL,TESTNET_DEX_BACKEND_URL— DEX servicesX_OAUTH_CLIENT_ID— public X OAuth client id used by Connect X flowPROFILE_REGISTRY_CONTRACT_ADDRESS— profile registry contract address
You can override some values at build time using Vite env vars:
# Example overrides at build/dev time
VITE_SUPERHERO_API_URL=https://api.example.com \
VITE_SUPERHERO_WS_URL=wss://ws.example.com \
VITE_X_OAUTH_CLIENT_ID=your_x_oauth_client_id \
VITE_PROFILE_REGISTRY_CONTRACT_ADDRESS=ct_your_profile_registry_contract \
npm run dev
# Or for a production build
VITE_SUPERHERO_API_URL=https://api.example.com \
VITE_SUPERHERO_WS_URL=wss://ws.example.com \
VITE_X_OAUTH_CLIENT_ID=your_x_oauth_client_id \
VITE_PROFILE_REGISTRY_CONTRACT_ADDRESS=ct_your_profile_registry_contract \
npm run build- React 18 + TypeScript, Vite
- State: Redux Toolkit (global app state) and Zustand (local stores where applicable)
- Routing: React Router v6
- Styles: SCSS and Tailwind CSS
- i18n: i18next
- Testing: Vitest + Testing Library (unit/component), Playwright (e2e)
Defined in package.json:
dev— run the Vite dev serverbuild— production buildpreview— preview thedist/buildtest— run unit and component teststest:e2e— run e2e tests in Docker (same environment as CI; use for consistent screenshots)test:e2e:ui— run e2e tests in Playwright UI mode (watch, pick tests, debug)test:e2e:update-snapshots— update screenshot baselines in Docker (writes toe2e/on the host)test:e2e:host— run e2e tests on the host (starts dev server if needed)test:e2e:host:update-snapshots— update screenshot baselines on the host (visual regression)
E2e tests use Playwright and live in e2e/. They run against the Vite dev server (started automatically unless one is already running).
Screenshot tests (visual regression) should be run in Docker so CI and local runs produce identical results. Use these commands for anything that uses toHaveScreenshot:
# Run e2e (including screenshot comparison) — same as CI
npm run test:e2e
# Update screenshot baselines after intentional UI changes (writes to e2e/ on your machine)
npm run test:e2e:update-snapshotsRunning e2e on the host (no Docker) is still supported for quick iteration, but screenshot pixels may differ from CI (fonts, OS, DPI). For host runs:
First-time setup — install browsers (once per machine):
npx playwright install chromiumRun all e2e tests on the host:
npm run test:e2e:hostInteractive mode (pick tests, watch, debug):
npm run test:e2e:uiUpdate screenshot baselines on the host:
npm run test:e2e:host:update-snapshotsConfig: playwright.config.ts. Failure artifacts are under test-results/; the default reporter prints to the terminal.
This app is a static site once built. You can deploy the dist/ directory to any static host (Netlify, Vercel, S3, nginx, etc.).
- Netlify configuration is included:
netlify.tomlandpublic/_redirectsfor SPA routing - Typical build settings: build command
npm run build, publish directorydist
- Create a feature branch from
main - Commit with conventional messages (e.g.,
feat:,fix:,docs:) - Open a pull request
Unless stated otherwise by the project owners, this repository is provided as‑is under its respective license. Consult project maintainers for details.