How oraidex/oraiswap-frontend works
Project type and purpose
• This is a single-page React application (“Oraidex’s Frontend”) designed as the user interface for a decentralized exchange on Oraichain. It is not a traditional full-stack server-side app but a front-end heavy DApp that interacts with smart contracts and multiple blockchain networks via REST, GraphQL, and on-chain libraries.
File structure
• Top-level config and tool files (.eslintrc, vite.config.ts, babel.config.js, etc.) support build and CI.
• Public & index.html deliver the HTML shell.
• src/index.tsx bootstraps the React app.
• src/components and src/pages hold UI components and page containers (e.g., Balance, Pools, Staking, UniversalSwap).
• src/store, src/reducer, src/routes.tsx define Redux state management and routing.
• src/rest and src/gql contain data-access layers: REST API clients and GraphQL codegen.
• src/libs and src/hooks include blockchain integrations (Metamask, Keplr, cw-bitcoin, nomic, Solana, TON, TronLink) and custom React hooks.
• CI workflows in .github/workflows automate lint/test/deploy.
README for additional insights
• Confirms this is purely frontend with NodeJS, building via Yarn/Vite.
• Mentions dependence on on-chain contracts (oraiswap).
• No server-side logic here; all business logic lives client-side or in on-chain contracts.
Detail
• Major folder’s role (e.g., src/pages vs. src/components).
• Distinguish between on-chain vs off-chain data sources.
• Middleware or codegen steps as part of the build pipeline.