How raydium-io/raydium-ui-v3-public works
Project type and purpose
• This is a Next.js-based, React/TypeScript web application (“Raydium UI”) that provides a front-end interface to on-chain DeFi features (swap, farming, liquidity, launchpad, wallets) across Solana and EVM-compatible chains. It uses SSR/SSG for pages, dynamic routing, client-side hydration, and interactive state via Zustand.
File structure
• Top-level “pages” directory: Next.js routes, server-rendered or statically generated.
• “src/components”: shared UI primitives (Buttons, Charts, Modals) built with Chakra UI.
• “src/features”: domain modules (Swap, Farm, Pools, Launchpad) each containing pages, components, hooks, utils.
• “src/hooks”: reusable React hooks for fetching data, detecting viewport, event handling.
• “src/api”: Axios wrappers for third-party services (RPC nodes, BirdEye, transaction service).
• “src/provider”: React Context providers (Theme, Wallet, Ledger polyfills).
• “src/store”: Zustand stores for global state (markets, liquidity, swaps, settings).
• “src/utils”: generic helpers (date, number formatting, PDAs).
• Config files: next.config.js, TypeScript configs, Sentry configs.
README for additional insights
• Confirms folder conventions (components pure, features domain-oriented, store via createStore, providers wrapped in _app.tsx).
• Emphasizes separation of UI, logic, and async operations (Zustand actions in stores, hooks just invoke stores).
Detail is key—capture each layer and its connections
• “public/” as static asset server
• “pages/api/*” (if present) for serverless functions
• Sentry and Monitoring as sidecar to server and client
• I18n and theme providers as wrappers around the React tree
• Cluster feature sub-systems (Swap, Farm, Liquidity, Pool, Launchpad) to demonstrate modular structure