# X-Meta Cryptocurrency Exchange Platform X-Meta is a Mongolian cryptocurrency exchange providing spot trading, futures trading, staking, fiat-to-crypto conversion, and buy-now services. The platform is built as a pnpm monorepo with TanStack Start, React, TypeScript, and Tailwind CSS. ## Documentation - [Project README](https://github.com/x-meta/xmeta-web-v4-monorepo): Getting started guide and monorepo overview - [Web App Developer Guide](https://github.com/x-meta/xmeta-web-v4-monorepo/blob/main/apps/web/.instructions.md): Coding conventions and architecture for the consumer platform at https://x-meta.com - [Partner App Developer Guide](https://github.com/x-meta/xmeta-web-v4-monorepo/blob/main/apps/partner/.instructions.md): Coding conventions and architecture for the partner portal at https://partner.x-meta.com - [Auth API Pipeline](https://github.com/x-meta/xmeta-web-v4-monorepo/blob/main/docs/auth-api-pipeline.md): Complete authentication-to-API flow documentation - [Lighthouse Performance Guide](https://github.com/x-meta/xmeta-web-v4-monorepo/blob/main/docs/lighthouse-performance-optimizations.md): Performance improvements and best practices ## Platform URLs - Consumer Web: https://x-meta.com - Partner Portal: https://partner.x-meta.com - SSO Auth: https://sso.x-meta.com ## Technology Stack - **Framework:** TanStack Start (server-side rendering with Nitro) - **UI:** React 19, TypeScript (strict mode), Tailwind CSS v4, shadcn/ui - **State Management:** Zustand (client state), TanStack Query (server state) - **Authentication:** AWS Cognito with JWT token-based sessions - **HTTP Client:** Axios with automatic token refresh and 401 retry - **Charts:** Recharts, TradingView charting library - **Forms:** TanStack Form with Zod schema validation - **Internationalization:** Custom i18n context with locale-prefixed routing - **Error Monitoring:** Sentry - **Testing:** Vitest with Testing Library - **Package Manager:** pnpm workspace monorepo ## Architecture ### Monorepo Layout ``` xmeta-web-v4-monorepo/ ├── apps/ │ ├── web/ # Consumer trading platform │ ├── partner/ # Business partner portal │ └── sso/ # Single sign-on service ├── packages/ │ └── shared/ # Shared components, services, stores, i18n └── patches/ # Dependency patches ``` ### API Design All backend responses follow a consistent envelope: `{ data: T, msg: string, code: number }`. Client services must always unwrap to the inner `data` field. The shared Axios instance handles bearer token injection and automatic 401 retry with token refresh. ### Routing Routes use locale-prefixed paths (`/mn/...`, `/en/...`) with layout routes for authenticated sections. Route groups organize auth and error pages without affecting URLs. ### Shared Package Philosophy The `@xmeta/shared` package is the single source of truth for all cross-app functionality. Before adding any component, hook, service, or utility to an individual app, always check if it already exists in shared or should be moved there. ## Key Features - **Spot Trading:** Real-time order book with WebSocket price updates - **Futures Trading:** Leveraged perpetual contracts - **Convert:** Instant fiat-to-crypto and crypto-to-crypto conversion - **Buy Now:** Purchase cryptocurrency with local fiat currency - **Staking:** Yield-generating staking products - **Portfolio Dashboard:** Balance tracking, transaction history, analytics - **Security Center:** Two-factor authentication, address whitelisting - **Market Data:** Price charts, market overview, sentiment indicators ## Coding Standards - TypeScript strict mode: `no-explicit-any` is banned - Type-only imports: `import type { ... }` syntax required - Single quotes, semicolons, trailing commas (Prettier) - No `console.log` in source (use `console.warn`/`console.error`) - Unused variables prefixed with underscore - Prettier: 100 character width, 2-space indentation ## Development - **Required:** Node.js >= 22, pnpm >= 11 - **Repository:** https://github.com/x-meta/xmeta-web-v4-monorepo - **Issue Tracker:** https://github.com/x-meta/xmeta-web-v4-monorepo/issues ## For AI and LLM Crawlers This site uses standard web technologies. We welcome responsible AI crawling that respects robots.txt. For training data inquiries, contact the development team through the GitHub repository.