Insight is a professional oracle data analytics platform that provides comprehensive analysis and comparison of mainstream oracle protocols including Chainlink, Band Protocol, UMA, Pyth, API3, RedStone, DIA, Tellor, Chronicle, 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
- Market Overview - Track Total Value Secured (TVS) and market metrics
- 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) - Custom oracle clients for all supported providers
- 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 |
insight/
├── src/
│ ├── app/ # Next.js App Router pages and API routes
│ │ ├── [locale]/ # Localized pages (next-intl)
│ │ │ ├── alerts/ # Alerts management page
│ │ │ ├── api3/ # API3 oracle page
│ │ │ ├── band-protocol/ # Band Protocol oracle page
│ │ │ ├── chainlink/ # Chainlink oracle page
│ │ │ ├── chronicle/ # Chronicle oracle page
│ │ │ ├── cross-chain/ # Cross-chain analysis page
│ │ │ ├── cross-oracle/ # Cross-oracle comparison page
│ │ │ ├── dia/ # DIA oracle page
│ │ │ ├── favorites/ # User favorites page
│ │ │ ├── home-components/# Homepage components
│ │ │ ├── login/ # Login page
│ │ │ ├── market-overview/# Market overview page
│ │ │ ├── methodology/ # Methodology page
│ │ │ ├── price-query/ # Price query page
│ │ │ ├── pyth-network/ # Pyth oracle page
│ │ │ ├── redstone/ # RedStone oracle page
│ │ │ ├── register/ # Registration page
│ │ │ ├── settings/ # User settings page
│ │ │ ├── snapshot/ # Shared snapshots page
│ │ │ ├── tellor/ # Tellor oracle page
│ │ │ ├── uma/ # UMA oracle page
│ │ │ └── winklink/ # WINkLink oracle 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
│ │ │ ├── oracles/ # Oracle data API
│ │ │ │ └── [provider]/ # Provider-specific endpoints
│ │ │ ├── snapshots/ # User snapshots API
│ │ │ │ └── [id]/ # Individual snapshot endpoints
│ │ │ ├── cron/ # Scheduled tasks
│ │ │ └── health/ # Health check endpoint
│ │ ├── error.tsx # Error boundary
│ │ ├── global-error.tsx # Global error handler
│ │ ├── layout.tsx # Root layout
│ │ ├── not-found.tsx # 404 page
│ │ ├── page.tsx # Home page
│ │ ├── globals.css # Global styles
│ │ └── favicon.ico # Favicon
│ ├── components/ # React components
│ │ ├── accessibility/ # Accessibility components
│ │ ├── alerts/ # Alert components
│ │ ├── charts/ # Chart components
│ │ ├── comparison/ # Comparison components
│ │ ├── data-transparency/ # Data transparency components
│ │ ├── export/ # Export components
│ │ ├── favorites/ # Favorite components
│ │ ├── layout/ # Layout components
│ │ ├── mobile/ # Mobile components
│ │ ├── navigation/ # Navigation components
│ │ ├── oracle/ # Oracle-specific components
│ │ │ ├── charts/ # Oracle chart components
│ │ │ ├── common/ # Common oracle components
│ │ │ ├── forms/ # Form components
│ │ │ └── indicators/ # Technical indicators
│ │ ├── search/ # Search components
│ │ ├── settings/ # Settings components
│ │ ├── ui/ # Reusable UI components
│ │ ├── AppInitializer.tsx # App initializer
│ │ ├── ErrorBoundaries.tsx # Error boundaries
│ │ ├── Footer.tsx # Footer component
│ │ ├── GaugeChart.tsx # Gauge chart
│ │ ├── LanguageSwitcher.tsx# Language switcher
│ │ └── Navbar.tsx # Navigation bar
│ ├── lib/ # Core libraries
│ │ ├── analytics/ # Analytics utilities
│ │ ├── api/ # API utilities
│ │ ├── config/ # Configuration files
│ │ ├── constants/ # Application constants
│ │ ├── di/ # Dependency injection
│ │ ├── errors/ # Error handling
│ │ ├── export/ # Data export utilities
│ │ ├── hooks/ # Custom React hooks
│ │ ├── indicators/ # Technical indicators
│ │ ├── monitoring/ # Performance monitoring
│ │ ├── oracles/ # Oracle client implementations
│ │ ├── queries/ # React Query keys
│ │ ├── realtime/ # Real-time communication
│ │ ├── services/ # External services
│ │ ├── snapshots/ # Snapshot management
│ │ ├── supabase/ # Supabase client and utilities
│ │ └── utils/ # Utility functions
│ ├── types/ # TypeScript type definitions
│ │ ├── oracle/ # Oracle types
│ │ ├── api/ # API types
│ │ ├── ui/ # UI types
│ │ ├── auth/ # Auth types
│ │ └── common/ # Common types
│ ├── i18n/ # Internationalization
│ │ ├── messages/ # Translation messages
│ │ │ ├── common.json
│ │ │ ├── home.json
│ │ │ ├── navigation.json
│ │ │ ├── oracles/ # Oracle-specific translations
│ │ │ └── components/ # Component translations
│ │ ├── config.ts
│ │ └── i18n.ts
│ └── providers/ # React providers
│ └── ReactQueryProvider.tsx
├── supabase/
│ └── migrations/ # Database migrations
│ └── 001_initial_schema.sql
├── public/ # Static assets
│ └── logos/ # Logo assets
│ ├── cryptos/ # Cryptocurrency logos
│ └── oracles/ # Oracle logos
├── scripts/ # Utility scripts
├── next.config.ts # Next.js configuration
├── tailwind.config.ts # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
├── jest.config.js # Jest configuration
└── eslint.config.mjs # ESLint configuration
- 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: Cosmos, Osmosis, Juno, Ethereum, Polygon, Avalanche, Fantom, Cronos, Injective, Sei, Kava
- Features: Validator analytics, cross-chain data feeds
- Supported Chains: Ethereum, Arbitrum, Optimism, Polygon, Base, BNB Chain, Avalanche, Fantom, Gnosis
- Features: Optimistic oracle, dispute resolution, validator analytics
- 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, Fantom, Cronos, Moonbeam, Gnosis, Kava
- Features: Open-source cross-chain oracle, NFT data feeds, transparent methodology
- Supported Chains: Ethereum, Arbitrum, Optimism, Polygon, Base, Avalanche, BNB Chain, Fantom, Moonbeam, Gnosis
- Features: Stake-based reporting, dispute mechanism, mining rewards
- Supported Chains: Ethereum, Arbitrum, Optimism, Polygon, Base, BNB Chain, Avalanche, Fantom, Gnosis
- Features: MakerDAO native oracle, Scuttlebutt protocol, on-chain verification
- 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/snapshots- List user snapshotsPOST /api/snapshots- Create snapshotGET /api/snapshots/[id]- Get specific snapshotDELETE /api/snapshots/[id]- Delete snapshotPOST /api/snapshots/[id]/share- Share snapshot
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 checkGET /api/cron/cleanup- Cleanup expired records
本项目采用严格的代码质量标准,确保代码的可维护性和可靠性:
- ESLint: 使用 TypeScript ESLint 规则集,包含严格的类型检查
- Prettier: 统一的代码格式化配置
- TypeScript: 严格的类型检查配置 (
strict: true) - 命名规范: 统一的文件和变量命名约定
# 运行 ESLint 检查
npm run lint
# 自动修复 ESLint 问题
npm run lint:fix
# 运行类型检查
npm run typecheck
# 运行所有测试
npm run test
# 运行测试覆盖率检查
npm run test:coverage
# 运行完整验证(lint + typecheck + test)
npm run validate
# 检查命名规范
npm run naming:check- 测试覆盖率: 目标 80%+
- 类型安全: 100% TypeScript 覆盖
- Lint 通过率: 零错误,最小化警告
- 构建成功率: 100%
- 定期运行
npm run validate确保代码质量 - 使用
npm run lint:fix自动修复格式问题 - 提交前确保所有测试通过
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - 确保代码通过所有质量检查 (
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.
- Chainlink - Decentralized oracle network
- Band Protocol - Cross-chain data oracle
- UMA - Optimistic oracle
- Pyth Network - High-frequency oracle
- API3 - First-party oracle solution
- RedStone - Modular oracle
- DIA - Open-source oracle
- Tellor - Decentralized oracle
- Chronicle - MakerDAO oracle
- WINkLink - TRON ecosystem oracle