OKX Cosmos is a modern, high-performance cryptocurrency trading platform built with cutting-edge technologies. The platform features real-time market data, advanced charting, secure authentication, and a responsive design optimized for both desktop and mobile trading.
- Real-time Market Data: Live price updates via SignalR
- Advanced Trading Interface: Professional-grade charts and order management
- Multi-theme Support: Light, dark, and custom themes
- Responsive Design: Optimized for all devices
- Secure Authentication: JWT-based authentication with refresh tokens
- Performance Optimized: Code splitting, lazy loading, and caching
- Accessibility First: WCAG 2.1 AA compliant
- Enterprise Ready: Production-grade security and monitoring
nextjs-frontend/
βββ src/
β βββ app/ # App Router pages
β βββ components/ # React components
β βββ lib/ # Utilities and configurations
β βββ hooks/ # Custom React hooks
β βββ stores/ # Zustand stores
β βββ types/ # TypeScript definitions
β βββ styles/ # Global styles
βββ public/ # Static assets
βββ docs/ # Documentation
src/
βββ Api/ # ASP.NET Core Web API
βββ Shared/ # Shared libraries
βββ Worker.Ingestion/ # Background services
βββ Frontend/ # Legacy Blazor (deprecated)
- Framework: Next.js 15 with App Router
- UI Library: React 19
- Language: TypeScript 5
- Styling: Tailwind CSS 4
- UI Components: Radix UI primitives
- State Management: Zustand
- Data Fetching: SWR
- Real-time: SignalR
- Charts: Recharts
- Forms: React Hook Form + Zod
- Icons: Lucide React
- Framework: ASP.NET Core 8.0
- ORM: Entity Framework Core 9.0
- Database: SQLite (dev), SQL Server (prod)
- Authentication: JWT Bearer tokens
- Real-time: SignalR
- API Documentation: Swagger/OpenAPI
- Node.js 18+
- .NET 8 SDK
- Git
-
Clone the repository
git clone https://github.com/your-org/okx-cosmos.git cd okx-cosmos -
Setup Backend
cd src/Api dotnet restore dotnet ef database update dotnet run -
Setup Frontend
cd nextjs-frontend npm install npm run dev -
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/swagger
- API Documentation
- Frontend Development Guide
- Backend Development Guide
- Deployment Guide
- Migration Guide
- Contributing Guidelines
Frontend:
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 type-check # Run TypeScript checks
npm run test # Run testsBackend:
dotnet run # Start development server
dotnet build # Build project
dotnet test # Run tests
dotnet ef migrations add <name> # Add migration
dotnet ef database update # Update databaseCreate .env.local in the frontend directory:
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_SIGNALR_URL=http://localhost:5000/hubs
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=http://localhost:3000npm run test # Unit tests
npm run test:e2e # End-to-end tests
npm run test:a11y # Accessibility tests
npm run test:perf # Performance testsdotnet test # All tests
dotnet test --filter Category=Unit # Unit tests only
dotnet test --filter Category=Integration # Integration tests only# Frontend
npm run build
npm run start
# Backend
dotnet publish -c Releasedocker-compose up -dnpm run deploy:vercelSee Deployment Guide for detailed instructions.
- JWT authentication with refresh tokens
- HTTPS enforcement
- CORS configuration
- Input validation and sanitization
- CSP headers
- Rate limiting
- SQL injection prevention
- Lighthouse Score: 95+ across all metrics
- Core Web Vitals: Optimized for LCP, FID, CLS
- Bundle Size: < 200KB gzipped
- Load Time: < 2s on 3G networks
- Chrome 90+
- Firefox 88+
- Safari 14+
- Edge 90+
Please read our Contributing Guidelines before submitting pull requests.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Next.js - The React framework
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Low-level UI primitives
- Zustand - State management
- SWR - Data fetching library
Made with β€οΈ by the OKX Cosmos Team