Context8登录页面
使用React 19、Vite 6、Tailwind CSS v4和Framer Motion 12构建的现代终端美学登录页面。
特性
- 深色主题:具有自定义调色板的终端风格UI
- 平滑动画:使用Framer Motion实现60fps滚动触发效果
- 响应式设计:移动优先,所有设备都有断点
- 性能优化:捆绑包大小\<200KB,Lighthouse得分90+
- 无障碍:WCAG 2.1 AA兼容键盘导航
- 类型安全:带有路径别名的完全TypeScript严格模式
- 已测试:单元测试(Vitest)和E2E测试(剧作家)
- 加密货币支付:多链订阅支付(以太坊、Polygon、BSC)
- 订阅管理:支持自动付款验证的专业计划
技术栈
- 反应19 -并发渲染和最新功能
- 快6 -闪电般快速的开发服务器和优化的构建
- 顺风CSS v4 -实用程序优先CSS与自定义深色主题
- Framer Motion 12 -制作就绪动画库
- TypeScript 5.3+ -严格的型号安全模式
- Vitest -使用jsdom进行快速单元测试
- 剧作家 -跨浏览器E2E测试
快速开始
# Install dependencies
npm install
# Start dev server (http://localhost:5173)
npm run dev
# Run type checking
npm run typecheck
# Run unit tests
npm run test
# Run E2E tests
npm run test:e2e
# Build for production
npm run build
# Preview production build
npm run preview加密货币支付设置
Context8支持在三个区块链上使用稳定币(USDT/USDC)支付专业订阅:
先决条件
- 配置了Auth的Supabase项目
- 以太坊、Polygon和BSC的静态加密钱包地址
- 用于付款验证的管理员电子邮件
1.数据库设置
在Supabase Dashboard中运行迁移→ SQL编辑器:
-- Copy entire content from the database contract (removed from repo with Specify specs cleanup)为您的电子邮件授予管理员角色:
UPDATE auth.users
SET raw_user_meta_data = raw_user_meta_data || '{"is_admin": true}'::jsonb
WHERE email = 'your-admin@email.com';2.配置钱包地址
更新 src/data/walletAddresses.ts 使用您的真实钱包地址:
export const WALLET_ADDRESSES: WalletAddresses = {
ethereum: {
usdt: '0xYourEthereumUSDTAddress',
usdc: '0xYourEthereumUSDCAddress'
},
polygon: {
usdt: '0xYourPolygonUSDTAddress',
usdc: '0xYourPolygonUSDCAddress'
},
bsc: {
usdt: '0xYourBSCUSDTAddress',
usdc: '0xYourBSCUSDCAddress'
}
}3.管理工作流程
- 使用管理员帐户登录
- 引导到
/admin - 审查待付款
- 点击Etherscan/Polygonscan/BSCScan链接以验证交易
- 批准或拒绝备注
- 批准的付款会自动激活专业版订阅(30天)
有关详细的实施指南,请参阅 docs/.
4.API集成
上下文8是API优先。在中生成API密钥 /dashboard/settings 并使用Bearer-auth调用API:
curl https://api.context8.markets/v1/signals \
-H "Authorization: Bearer ctx8_sk_..." \
-d '{"asset": "BTC", "modules": "all"}'发展
# Run tests in watch mode
npm run test:watch
# Run E2E tests with UI
npm run test:e2e:ui
# Format code
npm run format
# Lint code
npm run lint项目结构
frontend-v2/
├── src/
│ ├── components/
│ │ ├── terminal/ # Terminal-themed components
│ │ ├── code/ # Code display components
│ │ ├── sections/ # Page section components
│ │ ├── ui/ # Reusable UI components
│ │ └── layout/ # Layout components
│ ├── hooks/ # Custom React hooks
│ ├── data/ # Static content and configuration
│ ├── styles/ # Global styles and fonts
│ ├── lib/ # Utilities and helpers
│ ├── App.tsx # Root component
│ └── main.tsx # Entry point
├── public/
│ ├── fonts/ # Self-hosted fonts
│ └── images/ # Static images
├── tests/
│ ├── unit/ # Vitest unit tests
│ └── e2e/ # Playwright E2E tests
└── vite.config.ts # Vite configuration绩效目标
- 捆绑尺寸:\<200KB(gzip)
- 灯塔分数:90+(性能、可访问性、最佳实践、SEO)
- 动画:现代设备上为60fps
- 首次内容绘制:\<1.5秒
- 互动时间:\<3.5秒
浏览器支持
- Chrome/Edge(最近两个版本)
- Firefox(最近两个版本)
- Safari浏览器(最近两个版本)
- 移动浏览器(iOS Safari、Chrome Mobile)
许可证
麻省理工学院
