中文 | English
World-class developer documentation for the {xpay✦} ecosystem and x402 protocol
This repository contains the official documentation for {xpay✦}, the leading platform for autonomous AI agent payments built on the x402 protocol. Our documentation covers:
- x402 Protocol - The foundation for autonomous payments
- Smart Proxy - Cost control and spending limits for AI agents
- Paywall-as-a-Service - API monetization made simple
- Transaction Explorer - Real-time payment monitoring and analytics
- Developer Resources - SDKs, code examples, and integration guides
- ⚡️ Next.js 15 + TypeScript - Modern React framework with type safety
- 🎨 TailwindCSS 4 - Utility-first CSS for rapid UI development
- 🧩 Shadcn UI - Beautiful, accessible component library
- 📚 Nextra 4 - Next.js-based static site generator optimized for documentation
- 🌐 i18n Support - Multi-language documentation (English, Chinese)
- 🔍 Built-in Search - Fast, client-side search powered by Nextra
- 📱 Responsive Design - Optimized for all devices
- ⚡ Turbopack - Ultra-fast build tool for development
- Node.js >= 20.x
- npm or pnpm
- Git
# Clone the repository
git clone https://github.com/xpaysh/docs.git
cd docs
# Install dependencies
npm install
# or
pnpm install
# Start development server
npm run dev
# or
pnpm devOpen http://localhost:8000 to view the documentation site.
# Development
npm run dev # Start development server with Turbopack
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint├── src/
│ ├── content/ # Documentation content
│ │ ├── en/ # English documentation
│ │ │ ├── index.mdx # Homepage
│ │ │ ├── getting-started/
│ │ │ ├── x402-protocol/
│ │ │ ├── products/
│ │ │ ├── developer-resources/
│ │ │ └── community/
│ │ └── zh/ # Chinese documentation
│ ├── components/ # React components
│ │ ├── ui/ # Shadcn UI components
│ │ └── CustomFooter/ # Custom footer component
│ ├── app/ # Next.js app directory
│ │ └── [lang]/ # Internationalized routing
│ └── lib/ # Utilities and configurations
├── public/ # Static assets
│ ├── logo-*.png # {xpay✦} logos (light/dark variants)
│ └── favicon.ico # Site favicon
└── package.json # Dependencies and scripts
-
Create MDX files in the appropriate language directory:
src/content/en/your-section/new-page.mdx -
Update navigation in the corresponding
_meta.tsfile:export default { 'existing-page': 'Existing Page', 'new-page': 'New Page' }
-
Use proper formatting with frontmatter:
# Page Title Your content here...
- Use
{xpay✦}for brand references (properly escaped in MDX) - Include code examples for technical concepts
- Add proper headings for navigation
- Use callouts and alerts for important information
- Maintain consistency across languages
- English (
/en) - Primary language, complete documentation - Chinese (
/zh) - Simplified Chinese, selected content
-
Create language directory:
mkdir src/content/[locale]
-
Add to Next.js config:
// next.config.ts i18n: { locales: ['en', 'zh', 'new-locale'], defaultLocale: 'en', }
-
Translate content and navigation
The site uses TailwindCSS with custom {xpay✦} branding:
- Primary Color:
#00DC9C(Xpay green) - Font: DM Sans
- Dark Mode: Automatic theme switching
Custom components are built with Shadcn UI:
# Add new UI components
pnpm dlx shadcn@latest add [component-name]The site is automatically deployed when changes are pushed to main branch.
# Build and export
npm run build
npm run export
# Deploy to your hosting platformFor production deployment, set these environment variables:
NEXT_PUBLIC_SITE_URL=https://docs.xpay.sh
NEXT_PUBLIC_GA_ID=your-analytics-id# Start development server
npm run dev
# Open in browser
open http://localhost:8000# Lint code
npm run lint
# Fix linting issues
npm run lint --fix
# Type checking
npx tsc --noEmit- Lighthouse Score: 100/100 across all metrics
- Core Web Vitals: Optimized for speed and user experience
- SEO: Structured data and meta tags included
- Accessibility: WCAG 2.1 AA compliant
We welcome contributions to improve our documentation!
- Fork the repository
- Create a feature branch
- Make your changes
- Test locally
- Submit a pull request
- 🐛 Bug fixes - Fix typos, broken links, or errors
- 📝 Content improvements - Better explanations, examples
- 🌐 Translations - Help with internationalization
- ✨ New features - Additional functionality or pages
- Discord: Join our community
- GitHub Discussions: Ask questions
- Twitter: @xpaysh
- Documentation Issues: GitHub Issues
- Bug Reports: Use issue templates
- Feature Requests: Discuss in GitHub Discussions first
This project is licensed under the MIT License - see the LICENSE file for details.
Ready to build with {xpay✦}? Visit our getting started guide to begin your journey with autonomous AI payments.