In December 2025, we scrapped the COD3X frontend and rebuilt it from scratch.
Not a refactor. Not a migration. A ground-up rewrite on an entirely new stack — new framework, new UI system, new architecture. The old codebase had carried us through the first year of the platform, but it was becoming the bottleneck.
Why Rewrite#
The V1 frontend was built fast to support rapid product iteration. That speed came with debt:
- Performance — Page loads were slow. Large bundle sizes. Excessive re-renders. The trading terminal, in particular, struggled under real-time data pressure.
- Component sprawl — After a year of feature additions, the component tree was tangled. Modifying one panel broke three others. New developers needed weeks to navigate the codebase.
- Stale patterns — V1 was built on React 17 patterns. The ecosystem had moved forward — Server Components, React Compiler, concurrent features — and the old architecture couldn't take advantage of any of it.
- Mobile gaps — The V1 frontend was desktop-first. Mobile was an afterthought, and it showed. Responsive breakpoints were patched in rather than designed for.
The tipping point: adding the credit system would have required touching nearly every page in the app. At that point, rebuilding was faster than retrofitting.
The New Stack#
Next.js 16 + React 19#
The V2 frontend is built on Next.js 16 with React 19 and the experimental React Compiler. This gives us:
- Server Components by default — Data fetching happens on the server. The client receives rendered HTML, not a blank page that bootstraps itself.
- React Compiler — Automatic memoization. No more manual
useMemo/useCallbackoptimization. The compiler handles it. - Turbopack — Sub-second hot reloads in development. Dramatically faster production builds.
- Streaming — Pages stream to the client as they render. Users see content immediately, not after the entire page has computed.
Tailwind CSS V4 + shadcn/ui#
The design system is built on Tailwind CSS V4 with shadcn/ui components (Radix primitives):
- Consistent design language — Every component follows the same visual system. No more one-off styles.
- Dark mode native — Theme-aware from day one, not bolted on.
- Accessible by default — Radix primitives handle keyboard navigation, focus management, and screen reader support out of the box.
TanStack Query + Zustand#
Data management was completely rearchitected:
- TanStack Query V5 — Server state management with automatic caching, background refetching, and stale-while-revalidate patterns. The trading terminal stays current without manual polling.
- Zustand — Minimal client state for UI-only concerns. No more global Redux store holding everything.
- nuqs — URL state management. Filter states, sort orders, and pagination are in the URL — so links to specific views actually work.
Real-Time Architecture#
Socket.IO integration was rebuilt as a first-class provider:
- Global socket context — Any component can subscribe to real-time events without prop drilling
- Automatic reconnection — Network drops are handled transparently
- Event-specific subscriptions — Components only receive events they care about, reducing unnecessary renders
What Changed for Users#
Speed#
Everything is faster. Page transitions are instant. The trading terminal renders in milliseconds. Chart data loads in the background while you're already interacting with the UI.
Mobile#
V2 was designed mobile-first. Every feature works on phone screens — not as a compromised version, but as a genuine interface. The agent dashboard, trading terminal, portfolio view, and staking panel are all fully responsive.
Progressive Web App#
V2 is a PWA. Install it on your phone or desktop for a native-like experience: offline caching, push notifications, and app-shell architecture that loads instantly.
Unified Navigation#
The V1 navigation grew organically and became inconsistent. V2 has a structured layout:
- Dashboard — Overview of agents, positions, and portfolio
- Terminal — Full trading interface with charts and order management (powered by Hyperliquid)
- Agents — Create, configure, and monitor autonomous agents
- Operations — Platform metrics, staking, and tokenomics
Migration#
The V2 rewrite launched as a complete replacement. No gradual migration, no feature flags, no dual-running systems. The old frontend was retired and the new one went live in its place.
Users who had bookmarked specific pages were redirected to their V2 equivalents. All functionality from V1 was preserved — nothing was removed, everything was rebuilt better.
The Result#
V2 shipped with every V1 feature plus:
- Credit-based billing integration
- Agent version control
- Trading journal
- Goal chaining
- ICT indicators
- Rebuilt portfolio and staking panels
- Operations dashboard
The rewrite wasn't just about new technology. It was about building a foundation that can support the next year of development without accumulating the same debt that forced the first rewrite.
COD3X V2 is live at app.cod3x.org. Faster, responsive, and built to last.