Skip to main content
Deriverse is a trading analytics platform built on Next.js that provides comprehensive analysis of Solana blockchain trading activity. It integrates real-time blockchain data with persistent storage to offer personalized trading journals.

System Overview

The application follows a modern client-server architecture with blockchain integration:

Architecture Layers

The presentation layer built with React 19 and Next.js 16 App Router.
  • User Interface: TailwindCSS with Framer Motion animations
  • State Management: React hooks with custom useWalletConnection
  • Routing: Next.js App Router for server-side rendering
  • Wallet Integration: Jupiter Wallet Adapter for unified wallet support
Business logic and external API integration located in src/services/.
  • SupabaseWalletService: Wallet persistence and lookup
  • SupabaseTradeService: Trade data caching and retrieval
  • HeliusService: Blockchain transaction fetching
  • DeriverseTradeService: Trade analytics processing
PostgreSQL database managed by Supabase with Row Level Security.
  • Persistence: User wallets and trade data
  • Caching: 24-hour cache for blockchain data
  • Security: RLS policies ensure data isolation

Component Structure

The codebase is organized following a feature-based architecture:
src/
├── app/                    # Next.js App Router
│   ├── layout.tsx         # Root layout with providers
│   ├── page.tsx           # Home page
│   └── providers.tsx      # Wallet & context providers
├── components/
│   ├── features/         # Feature-specific components
│   │   ├── Home.tsx      # Dashboard view
│   │   ├── Journal.tsx   # Trade journal
│   │   └── TradeHistory.tsx  # Trade list
│   ├── layout/           # Layout components
│   │   ├── GlassmorphismNavbar.tsx
│   │   └── TabNavigation.tsx
│   └── ui/               # Atomic UI components
│       ├── NewUserModal.tsx
│       └── LoadingScreen.tsx
├── lib/                  # Utilities & hooks
│   ├── hooks/            # Custom React hooks
│   ├── constants.ts      # App-wide configuration
│   └── tradeFilters.ts   # Filtering logic
└── services/             # API & DB clients
The component structure follows atomic design principles with clear separation between features, layout, and reusable UI elements.

Technology Stack

Core Framework

Next.js 16

App Router for server-side rendering, routing, and API routes.

React 19

Latest React with improved concurrency and suspense features.

Infrastructure

Supabase

PostgreSQL database with real-time subscriptions and authentication.

Solana Web3.js

Blockchain interaction and transaction parsing.

Jupiter Wallet Adapter

Unified wallet connection supporting Phantom, Solflare, and more.

Frontend Technologies

TechnologyPurposeVersion
TypeScriptType safety across the codebase5.x
TailwindCSSUtility-first styling system4.x
Framer MotionAnimation library for smooth transitions12.x
Geist FontsUnified typography (Sans, Mono, Pixel Grid)1.7
RechartsData visualization for analytics3.7
SonnerToast notifications2.0

Data Flow Patterns

Wallet Connection Flow

The application uses a unified wallet connection flow that handles both new and returning users:
1

Connect

User triggers Jupiter Wallet Adapter through the UI. Supported wallets include Phantom, Solflare, and manual address entry.
2

Verify

SupabaseWalletService checks if the wallet exists in the database (user_wallets table).
3

Register

New users are guided through NewUserModal for registration with network selection and wallet provider metadata.
4

Activate

App switches to active mode, fetching real data from blockchain via Helius and Deriverse SDK.

Data Modes

Deriverse operates in two distinct modes:
Local Development & Demos
  • Uses mockData.ts for rapid UI testing
  • No blockchain or database connection required
  • Ideal for exploring features without wallet setup
  • Banner indicates mock data is active

Trade Data Pipeline

Trade data flows through multiple processing stages:
The caching strategy balances data freshness with RPC efficiency. Trades older than 24 hours show a “Refresh” button to fetch updated data.

State Management

Connection State

The useWalletConnection hook wraps Jupiter’s wallet adapter and provides:
interface WalletConnectionState {
  walletAddress: string | null;
  connected: boolean;
  isWalletModalOpen: boolean;
  connect: () => void;
  disconnect: () => void;
}

Persistence Strategy

User Wallets

Stored in Supabase user_wallets table for cross-device persistence and recent wallet tracking.

Trades

Cached in trades table after blockchain fetch. Filtered locally for real-time analytics.

Annotations

Journal entries stored in trade_annotations table, synced from localStorage fallback.

UI State

Ephemeral React state for filters, modals, and temporary data. Cleared on navigation.

Security & Authentication

Deriverse does not implement user authentication. Wallet addresses serve as unique identifiers, with data isolation enforced through Supabase Row Level Security policies.

Security Measures

  • Environment Variables: Sensitive keys (RPC URLs, Supabase credentials) stored in .env.local
  • RLS Policies: Users can only access trades associated with their wallet address
  • JWT Tokens: Secure communication between frontend and Supabase
  • No Private Keys: Wallet adapters handle signing; private keys never leave user’s wallet

Local Development

Run the development server with:
npm run dev
Access the app at http://localhost:3000. Hot module reloading is enabled for rapid iteration.
Use mock data mode (default) for UI development without blockchain connectivity. Switch to real mode by connecting a wallet.

Performance Considerations

Optimization Strategies

  1. Static Generation: Next.js pre-renders pages at build time where possible
  2. Incremental Loading: Trades load in batches to prevent UI blocking
  3. Client-Side Caching: Supabase caches reduce redundant blockchain queries
  4. Lazy Loading: Wallet adapter and heavy components load on-demand
  5. Code Splitting: Next.js automatically splits code by route

Resource Usage

ResourceLimit (Free Tier)Usage Pattern
Supabase DB500 MB~420 KB per 1,000 trades
RPC CallsVaries by providerCached 24 hours
Vercel Bandwidth100 GB/monthMinimal (static assets)

Last Updated: February 2026 For database schema details, see Database. For deployment configuration, see Deployment.

Build docs developers (and LLMs) love