pnpm --filter @darkpool/frontend dev locally (port 5173).
Stack
| Layer | Choice |
|---|---|
| Bundler | Vite + @vitejs/plugin-react |
| UI | React 18 + Tailwind CSS (dark theme tokens) |
| Routing | React Router v6 with 10 routes under one <Layout /> |
| Wallet | dApp Kit (@mysten/dapp-kit) for browser wallets |
| zkLogin | Enoki (@mysten/enoki) for Google sign-in |
| Data | TanStack Query for REST + WS-pushed state |
| Charts | lightweight-charts v5 (baseline / candle) + TradingView widget toggle |
| Animation | framer-motion with restrained primitives (see lib/motion.ts) |
Provider tree (main.tsx)
Routes
| Route | Page | Purpose |
|---|---|---|
/ | Landing | Hero + live market previews + feature cards |
/markets | Markets | Every market kind (categories + filters + ?q= search) |
/markets/:oracleId | MarketDetail | Chart + strike book + buy/range panels |
/event-markets/:id | EventMarketDetail | V3 swap + mint/burn pair + redeem + OO panel |
/dark-pool | DarkPool | Vault UI |
/positions | Positions | Live mark-to-market position table |
/agents | Agents | Hero stats + fleet cards + leaderboard + Create wizard |
/agents/:agentId | AgentDetail | Per-agent detail page |
/profile | Profile | Portfolio dashboard + activity + managers + agents |
/auth/callback | AuthCallback | Enoki zkLogin redirect |
/event-markets route 301s to /markets. Event markets live as a category tab on the main markets page.
Layout
Layout.tsx is the app shell:
- Fixed
LiveTickerstrip at the very top (Pyth Hermes SSE). - Sticky header with logo, global market search (submits to
/markets?q=, preserving the?cattab), nav, andAccountChip. - Mobile drawer.
<Outlet />for the active route.- Footer.
Configuration
Vite’senvDir: "../../" walks up to the repo-root .env. Frontend-visible vars are prefixed VITE_:
Build for production
packages/frontend/dist/. Deploy to Walrus Sites or any static host.