How eclipse-laboratories-inc/eclipse-bridge-ux works
Project type and purpose
• This is a Next.js 13 “App Router” full-stack React application.
• It provides a UI for bridging tokens (Ethereum, Solana, tETH mint-redeem flows, gas-station, third-party bridges) and exposes a small backend via Next.js API routes under app/api/*.
• It integrates with blockchain RPCs (Ethereum, Solana), smart-contracts (via ABIs in mint-teth/abis and app/components/constants/abi.json), third-party bridge endpoints, and instrumentation/telemetry services.
File structure
• Top-level:
• app/ – Next.js App Router directories: pages (page.tsx), layouts (layout.tsx), API routes (app/api/.../route.ts), error handling (global-error.tsx).
• app/contexts & app/context.tsx – React contexts for network, sidebar, wallets.
• app/hooks – Domain hooks (wallet management, gas-station modal, transactions).
• app/providers – Providers for Wagmi (Ethereum), RelayKit, Gas Providers, Dynamic configuration.
• app/bridge, app/gas-station, app/mint-teth – Feature modules with pages, components, constants, hooks, utils.
• lib/ – Shared utility libraries (network, price, relay, solana, withdraw, wallet client).
• public/ – Static assets (fonts, thirdparty-bridges JSON).
• Config: next.config.js, tsconfig.json, .env.example, Tailwind, ESLint, GitHub workflows.
• Architectural patterns:
• React component hierarchy with a global layout.
• Context + Provider pattern for dependency injection.
• Feature-based module folders (bridge, gas-station, mint-teth).
• Next.js API routes for server-side data fetching/relay.
Key insights from README
• Standard Next.js setup; uses next/font to optimize custom fonts.
• Deployed typically on Vercel; no external DB—state is on-chain or in‐memory on the client.
Detailed coverage
• Break the Next.js Server block into sub-blocks:
• App Router (Pages + Layouts)
• API Routes (/api/ethereum-data, /api/get-transactions)
• Middleware & Error boundary (global-error.tsx)
• Under the Client block, illustrate the Context/Provider stack:
• WagmiProvider → RelayKitProvider → GasProviders → DynamicProvider → NetworkContext
• Under Feature modules, group each user flow:
• Deposit/Withdraw
• Gas Station
• Mint & Redeem tETH