Insight is a professional oracle data analytics platform that provides comprehensive analysis and comparison of mainstream oracle protocols including Chainlink, Pyth, API3, RedStone, DIA, and WINkLink.
- Real-time Price Monitoring - Live price feeds from multiple oracle providers with real-time updates
- Cross-Oracle Price Comparison - Compare prices across different oracles for the same asset
- Cross-Chain Performance Analysis - Analyze oracle performance across multiple blockchain networks
- Price Alerts & Notifications - Configure custom price alerts with multiple trigger conditions
- User Favorites & Snapshots - Save and share price snapshots and favorite configurations
- Data Export - Export data in CSV, JSON, Excel, PDF, and PNG formats
- Internationalization - Full support for English and Chinese (zh-CN)
- Anomaly Detection - Automatic detection of price anomalies and outliers
- Technical Indicators - RSI, MACD, Bollinger Bands, ATR, and more
- Data Transparency - Data source indicators and update time tracking
- Accessibility Support - Keyboard navigation, colorblind mode, screen reader support
- Framework: Next.js 16.1.6 (App Router)
- UI Library: React 19.2.3
- Language: TypeScript 5.x
- Styling: Tailwind CSS 4.x
- State Management: React Query 5.90.21, Zustand 5.0.11
- Charts: Recharts 3.8.0
- Animations: Framer Motion 12.36.0
- Internationalization: next-intl 4.8.3
- API: Next.js API Routes
- Database: Supabase 2.98.0 (PostgreSQL with Row Level Security)
- Authentication: Supabase Auth with OAuth support
- Real-time: WebSocket, Supabase Realtime
- Error Tracking: Sentry 10.43.0
- Pyth Hermes Client (
@pythnetwork/hermes-client2.0.0) - Pyth Price Service SDK (
@pythnetwork/price-service-sdk1.8.0) - API3 Contracts (
@api3/contracts27.0.0) - Custom oracle clients for all supported providers (Chainlink, Pyth, API3, RedStone, DIA, WINkLink)
- Node.js 18.x or higher
- npm or yarn
- Supabase account (for database and authentication)
-
Clone the repository:
git clone <repository-url> cd insight
-
Install dependencies:
npm install
-
Set up environment variables (see Environment Variables section below)
-
Run the development server:
npm run dev
Create a .env.local file in the root directory with the following variables:
| Variable | Description | Required |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase project URL | Yes |
NEXT_PUBLIC_SUPABASE_ANON_KEY |
Supabase anonymous key | Yes |
NEXT_PUBLIC_APP_URL |
Application base URL | No |
NEXT_PUBLIC_WS_URL |
WebSocket server URL | No |
NEXT_PUBLIC_ENABLE_REALTIME |
Enable real-time features (default: true) | No |
NEXT_PUBLIC_ENABLE_ANALYTICS |
Enable Vercel Analytics | No |
NEXT_PUBLIC_ENABLE_PERFORMANCE_MONITORING |
Enable performance monitoring (Speed Insights) | No |
Example .env.local:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXT_PUBLIC_WS_URL=ws://localhost:3001
NEXT_PUBLIC_ENABLE_REALTIME=true
NEXT_PUBLIC_ENABLE_ANALYTICS=true
NEXT_PUBLIC_ENABLE_PERFORMANCE_MONITORING=true| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run start |
Start production server |
npm run lint |
Run ESLint |
npm run lint:fix |
Run ESLint with auto-fix |
npm run format |
Format code with Prettier |
npm run format:check |
Check code formatting with Prettier |
npm run typecheck |
Run TypeScript type checking |
npm run validate |
Run lint, typecheck, and tests |
npm run test |
Run Jest tests |
npm run test:watch |
Run tests in watch mode |
npm run test:coverage |
Run tests with coverage report |
npm run test:e2e |
Run Playwright E2E tests |
npm run test:e2e:ui |
Run Playwright E2E tests with UI |
npm run clean:dev |
Clean .next and start dev server |
npm run clean:start |
Clean .next, build and start server |
npm run perf:test |
Run performance tests |
npm run perf:quick |
Run quick performance check |
npm run i18n:types |
Generate i18n types |
npm run i18n:check |
Check i18n translations |
npm run i18n:validate |
Validate i18n translations |
npm run naming:check |
Check naming conventions |
npm run prepare |
Prepare husky git hooks |
insight/
βββ src/
β βββ app/ # Next.js App Router pages and API routes
β β βββ [locale]/ # Localized pages (next-intl)
β β β βββ alerts/ # Alerts management page
β β β βββ auth/ # Authentication pages
β β β β βββ forgot-password/
β β β β βββ resend-verification/
β β β β βββ reset-password/
β β β β βββ verify-email/
β β β βββ cross-chain/ # Cross-chain analysis page
β β β βββ cross-oracle/ # Cross-oracle comparison page
β β β βββ docs/ # Documentation page
β β β βββ favorites/ # User favorites page
β β β βββ home-components/# Homepage components
β β β βββ login/ # Login page
β β β βββ price-query/ # Price query page
β β β βββ register/ # Registration page
β β β βββ settings/ # User settings page
β β βββ api/ # API endpoints
β β β βββ alerts/ # Price alerts API
β β β β βββ batch/ # Batch alert operations
β β β β βββ events/ # Alert events API
β β β β βββ [id]/ # Individual alert endpoints
β β β βββ auth/ # Authentication callbacks
β β β βββ favorites/ # User favorites API
β β β βββ health/ # Health check endpoint
β β β βββ oracles/ # Oracle data API
β β β β βββ [provider]/ # Provider-specific endpoints
β β β βββ prices/ # Prices API
β β βββ error.tsx # Error boundary
β β βββ global-error.tsx # Global error handler
β β βββ layout.tsx # Root layout
β β βββ not-found.tsx # 404 page
β β βββ globals.css # Global styles
β β βββ favicon.ico # Favicon
β βββ components/ # React components
β β βββ accessibility/ # Accessibility components
β β βββ alerts/ # Alert components
β β βββ charts/ # Chart components
β β βββ data-transparency/ # Data transparency components
β β βββ error-boundary/ # Error boundary components
β β βββ export/ # Export components
β β βββ favorites/ # Favorite components
β β βββ navigation/ # Navigation components
β β βββ realtime/ # Real-time components
β β βββ search/ # Search components
β β βββ settings/ # Settings components
β β βββ shortcuts/ # Keyboard shortcuts
β β βββ ui/ # Reusable UI components
β β β βββ DataTablePro/ # Advanced data table
β β β βββ selectors/ # Selector components
β β βββ AppInitializer.tsx # App initializer
β β βββ Footer.tsx # Footer component
β β βββ LanguageSwitcher.tsx# Language switcher
β β βββ Navbar.tsx # Navigation bar
β β βββ PerformanceMetricsCollector.tsx
β βββ hooks/ # Custom React hooks
β β βββ data/ # Data fetching hooks
β β βββ oracles/ # Oracle-specific hooks
β β βββ ui/ # UI hooks
β β βββ utils/ # Utility hooks
β βββ lib/ # Core libraries
β β βββ analytics/ # Analytics utilities
β β βββ api/ # API utilities
β β β βββ client/ # API client with interceptors
β β β βββ middleware/ # API middleware (auth, rate limit, validation)
β β β βββ recovery/ # Error recovery
β β β βββ response/ # Response builders
β β β βββ retry/ # Retry logic
β β β βββ types/ # API types
β β β βββ validation/ # Validation schemas (Zod)
β β β βββ versioning/ # API versioning
β β βββ config/ # Configuration files
β β βββ constants/ # Application constants
β β βββ di/ # Dependency injection
β β βββ errors/ # Error handling
β β βββ export/ # Data export utilities
β β βββ i18n/ # i18n provider
β β βββ indicators/ # Technical indicators
β β βββ logger/ # Logging utilities
β β βββ monitoring/ # Performance monitoring
β β βββ oracles/ # Oracle client implementations
β β β βββ api3/ # API3 client and services
β β β βββ base/ # Base oracle client
β β β βββ constants/ # Oracle constants
β β β βββ pyth/ # Pyth client and services
β β β βββ api3.ts # API3 client
β β β βββ base.ts # BaseOracleClient abstract class
β β β βββ chainlink.ts # Chainlink client
β β β βββ colors.ts # Oracle colors
β β β βββ dia.ts # DIA client
β β β βββ diaDataService.ts
β β β βββ diaNFTService.ts
β β β βββ diaNetworkService.ts
β β β βββ diaPriceService.ts
β β β βββ factory.ts # OracleClientFactory
β β β βββ interfaces.ts # Oracle interfaces
β β β βββ memoryManager.ts
β β β βββ oracle-config.ts
β β β βββ oracleDataUtils.ts
β β β βββ performanceMetricsCalculator.ts
β β β βββ pythConstants.ts
β β β βββ pythDataService.ts
β β β βββ pythHermesClient.ts
β β β βββ pythNetwork.ts
β β β βββ pythPublishersData.ts
β β β βββ redstone.ts # RedStone client
β β β βββ redstoneConstants.ts
β β β βββ storage.ts
β β β βββ supportedSymbols.ts
β β β βββ winklink.ts # WINkLink client
β β βββ queries/ # React Query keys and client
β β βββ realtime/ # Real-time communication
β β βββ security/ # Security utilities
β β βββ services/ # External services
β β β βββ marketData/ # Market data services
β β β β βββ defiLlamaApi/
β β β βββ oracle/ # Oracle services
β β βββ snapshots/ # Snapshot management
β β βββ supabase/ # Supabase client and utilities
β β βββ utils/ # Utility functions
β β β βββ chartExport/ # Chart export utilities
β β βββ validation/ # Validation utilities
β βββ stores/ # Zustand stores
β β βββ authStore.ts # Authentication state
β β βββ crossChainStore.ts # Cross-chain analysis state
β β βββ realtimeStore.ts # Real-time data state
β β βββ selectors.ts # Store selectors
β β βββ uiStore.ts # UI state
β βββ types/ # TypeScript type definitions
β β βββ oracle/ # Oracle types
β β βββ api/ # API types
β β βββ ui/ # UI types
β β βββ auth/ # Auth types
β β βββ common/ # Common types
β βββ i18n/ # Internationalization
β β βββ messages/ # Translation messages
β β β βββ en/ # English translations
β β β β βββ components/
β β β β βββ features/
β β β βββ zh-CN/ # Chinese translations
β β β β βββ components/
β β β β βββ features/
β β β βββ common.json
β β β βββ home.json
β β β βββ navigation.json
β β βββ config.ts
β β βββ generated-types.ts
β β βββ request.ts
β β βββ routing.ts
β β βββ types.ts
β βββ __mocks__/ # Test mocks
βββ e2e/ # E2E tests
β βββ home.spec.ts
β βββ oracle-data.spec.ts
β βββ price-query.spec.ts
βββ public/ # Static assets
β βββ logos/ # Logo assets
β βββ cryptos/ # Cryptocurrency logos
β βββ oracles/ # Oracle logos
βββ scripts/ # Utility scripts
β βββ generate-i18n-types.js # i18n type generation
β βββ check-i18n.js # i18n validation
β βββ check-naming-convention.js
β βββ performance-test.ts # Performance testing
β βββ quick-perf.mjs # Quick performance check
βββ next.config.ts # Next.js configuration
βββ tsconfig.json # TypeScript configuration
βββ jest.config.js # Jest configuration
βββ playwright.config.ts # Playwright configuration
βββ eslint.config.mjs # ESLint configuration
βββ .husky/ # Husky git hooks
βββ .trae/rules/ # Trae IDE rules
βββ project_rules.md
βββ ui-redesign-rules.md
- Supported Chains: Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Base, BNB Chain, Fantom, Starknet, Blast, Moonbeam, Kava, Polkadot
- Features: Node analytics, extensive data feeds, high reliability
- Supported Chains: Solana, Ethereum, Arbitrum, Polygon, Optimism, Avalanche, Base, Starknet, Blast, Sui, Aptos, Injective, Sei
- Features: Publisher analytics, high-frequency updates, confidence intervals
- Supported Chains: Ethereum, Arbitrum, Polygon, Avalanche, Base, BNB Chain, Optimism, Moonbeam, Kava, Fantom, Gnosis, Linea, Scroll
- Features: First-party oracle, quantifiable security, Airnode deployments
- Supported Chains: Ethereum, Arbitrum, Optimism, Polygon, Avalanche, Base, BNB Chain, Fantom, Linea, Mantle, Scroll, zkSync, Blast, Starknet, Aptos, Sui
- Features: Modular oracle design, data streams, cross-chain support
- Supported Chains: Ethereum, Arbitrum, Polygon, Avalanche, BNB Chain, Base, Optimism, Fantom, Cronos, Moonbeam, Gnosis, Kava, Solana, Sui, Aptos, Injective, Sei, Cosmos, Osmosis, Juno, Celestia, Tron, TON, Near, Aurora, Celo, Starknet, Blast, Cardano, Polkadot, Mantle, Linea, Scroll, zkSync, Moonriver, Metis, StarkEx
- Features: Open-source cross-chain oracle, NFT floor price data feeds, transparent methodology, comprehensive token on-chain data (supply, market cap, exchange volume)
- Data Services: DIADataService with dedicated PriceService, NFTService, and NetworkService modules
- Supported Chains: BNB Chain, TRON, Ethereum
- Features: TRON ecosystem integration, gaming data feeds, entertainment focus
The application uses Supabase (PostgreSQL) with the following main tables:
user_profiles- User preferences and settingsprice_records- Historical price data from oraclesuser_snapshots- User-saved price snapshotsuser_favorites- User favorite configurationsprice_alerts- Price alert configurationsalert_events- Alert trigger event history
All tables have Row Level Security (RLS) enabled for data protection.
GET /api/auth/callback- OAuth callback handlerGET /api/auth/profile- Get user profile
GET /api/alerts- List user alertsPOST /api/alerts- Create new alertGET /api/alerts/[id]- Get specific alertPUT /api/alerts/[id]- Update alertDELETE /api/alerts/[id]- Delete alertGET /api/alerts/events- List alert eventsPOST /api/alerts/events/[id]/acknowledge- Acknowledge alert eventPOST /api/alerts/batch- Batch alert operations
GET /api/favorites- List user favoritesPOST /api/favorites- Create favoriteGET /api/favorites/[id]- Get specific favoriteDELETE /api/favorites/[id]- Delete favorite
GET /api/oracles- List all oracle providersPOST /api/oracles- Create oracle configurationGET /api/oracles/[provider]- Get specific oracle dataPUT /api/oracles/[provider]- Update oracle configuration
GET /api/health- Health check
This project adopts strict code quality standards to ensure maintainability and reliability:
- ESLint: TypeScript ESLint ruleset with strict type checking
- Prettier: Unified code formatting configuration
- TypeScript: Strict type checking configuration (
strict: true) - Naming Conventions: Unified file and variable naming conventions
# Run ESLint check
npm run lint
# Auto-fix ESLint issues
npm run lint:fix
# Run type checking
npm run typecheck
# Run all tests
npm run test
# Run test coverage check
npm run test:coverage
# Run full validation (lint + typecheck + test)
npm run validate
# Check naming conventions
npm run naming:check- Test Coverage: Target 80%+
- Type Safety: 100% TypeScript coverage
- Lint Pass Rate: Zero errors, minimized warnings
- Build Success Rate: 100%
- Regularly run
npm run validateto ensure code quality - Use
npm run lint:fixto auto-fix formatting issues - Ensure all tests pass before committing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Ensure code passes all quality checks (
npm run validate) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is private and proprietary.