The official website for Push Chain - the first shared-state blockchain enabling universal apps and seamless cross-chain interactions.
This repository contains the complete source code for the Push Chain website, including:
- Marketing Website: Landing pages, features, and ecosystem information
- Knowledge Base: Technical documentation, tutorials, and guides
- Developer Resources: API docs, SDKs, and integration guides
- Blog System: Latest news, updates, and technical articles
- Multilingual Support: 14 languages with AI-powered translation automation
- Interactive Components: Live demos, code playgrounds, and examples
- Translation Management: Automated translation system with glossary support
- π Quick Start
- π οΈ Development
- ποΈ Architecture
- π Internationalization
- π Translation Management
- π Content Management
- π¨ Styling & Theming
- π Deployment
- π€ Contributing
- π Resources
- Node.js 18+
- Yarn package manager
- Git for version control
# Clone the repository
git clone https://github.com/push-protocol/push-website.git
cd push-website
# Install dependencies
yarn install
# Start development server (full site)
yarn start
# Start development server (lite mode - faster, fewer blog posts)
yarn start:lite
# Translation management
yarn translations:generate # Generate all language translations
yarn translations:generate:specific <lang> # Target specific language (e.g., es, fr, de)
yarn translations:nuke # Clean up auto-translations
yarn translations:help # Show comprehensive translation help
# Build for production
yarn build
# Serve production build locally
yarn serve
# Deploy to production
yarn deploy
The development server supports hot reloading and provides real-time feedback:
yarn start
- Opens browser at
http://localhost:3000
- Auto-reloads on file changes
- Supports live editing of React components
- Real-time translation updates
For faster development with large blog collections:
yarn start:lite
- Temporarily moves all but the 10 most recent blog posts
- Significantly faster startup time
- Automatically restores all blogs when switching back to
yarn start
- Perfect for development work not involving blog content
# Production build
yarn build
# Analyze bundle size
yarn build --analyze
# Build with specific locale
yarn build --locale en
- Framework: Docusaurus 3 - Modern static site generator
- Frontend: React 18+ with TypeScript
- Styling: Styled Components + CSS Modules
- Internationalization: react-i18next with 14 languages and automated translation pipeline
- Content: MDX for documentation, Markdown for blogs
- Animations: GSAP for smooth interactions
- Build: Webpack with optimizations
push-website/
βββ src/
β βββ components/ # Reusable React components
β β βββ Chain/ # Push Chain specific components
β β βββ ExploreCollection/ # Knowledge base grid components
β β βββ SEO/ # SEO and meta components
β βββ pages/ # Static pages
β βββ pages-composition/ # Page composition components
β βββ hooks/ # Custom React hooks
β βββ css/ # Global styles and themes
β βββ config/ # Configuration files
βββ static/
β βββ assets/ # Images, icons, media
β βββ locales/ # Translation files
βββ docs/ # Documentation content
βββ blog/ # Blog posts
βββ content/ # Knowledge base articles
- ExploreCollection: Flexible grid system for displaying content cards
- ExplainerIndexList: Table of contents and content navigation
- ChainKnowledgeBase: Knowledge base components with search and filtering
- SEO Components: Automatic meta tag generation and schema markup
- Notification System: Toast notifications with localization
The website supports 14 languages with full localization:
- English (en) - Base language
- Chinese Simplified (zh-CN)
- Spanish (es)
- Hindi (hi)
- Japanese (ja)
- Korean (ko)
- Portuguese (pt)
- Russian (ru)
- Turkish (tr)
- French (fr)
- Indonesian (id)
- Vietnamese (vi)
- German (de)
- Arabic (ar)
Language selection is automatically persisted using localStorage. The i18n system:
- Detects user language from localStorage first
- Falls back to browser language or English
- Saves language selection across sessions
- Supports real-time language switching
static/locales/en/
βββ translation.json # Main translations automatic script merge
βββ 01-translate/ # This is where all translations are done and edited
βββ 01-homepage.json # Homepage content
βββ 05-components.json # Component strings
βββ 06-notifications.json # Notification messages
import { useTranslation } from 'react-i18next';
const MyComponent = () => {
const { t } = useTranslation();
return <h1>{t('components.my-component.title')}</h1>;
};
The website includes a comprehensive AI-powered translation automation system:
# Generate all language translations
yarn translations:generate
# Target specific language
yarn translations:generate:specific es
yarn translations:generate:specific fr
# Clean up auto-translations and reset
yarn translations:nuke
# Show comprehensive help
yarn translations:help
The translation system supports multiple AI providers:
Windsurf/Anthropic (Default):
AI_PROVIDER=windsurf
REACT_APP_WINDSURF_API_KEY=your_api_key
Local AI (OpenWebUI/Ollama):
AI_PROVIDER=local
LOCAL_AI_BASE_URL=http://localhost:11434
LOCAL_AI_MODEL=llama3.1
# Token and rate limiting
AI_MAX_INPUT_TOKENS=100000 # Maximum input tokens
AI_MAX_CHUNK_TOKENS=2000 # Maximum tokens per chunk
AI_RATE_LIMIT_PER_MINUTE=5 # API calls per minute
AI_REQUEST_TIMEOUT=60000 # Request timeout (ms)
- Automated Translation: AI-powered translation with glossary support
- Chunk Management: Automatic splitting of large translation files
- Progress Tracking: Real-time progress with detailed console output
- Error Handling: Robust error handling with automatic retries
- Missing Key Detection: Identifies and translates missing keys
- Extra Key Cleanup: Removes keys not present in English source
- Rate Limiting: Respects API limits with automatic throttling
Translation glossary is managed in build.translation.automation.glossary.json
:
{
"Push Protocol": "keep",
"blockchain": "transliterate",
"wallet": "transliterate",
"DeFi": "keep"
}
Glossary Rules:
"keep"
: Keep exactly as in source (brand names, technical terms)"transliterate"
: Convert to local script pronunciation- No entry: Translate naturally in context
Location: /docs/
- Use
.mdx
files for rich interactive content - Follow numbered folder structure for organization
- Include frontmatter for metadata:
---
title: 'Your Doc Title'
description: 'Brief description'
image: '/path/to/preview-image.png'
---
Asset Organization:
static/assets/docs/{product}/{category}/{article}/
Location: /blog/
- Folder naming:
yyyy-mm-dd-title-in-kebab-case/
- Include
index.md
with frontmatter - Add authors to
/blog/authors.yml
- Use modern image formats (WebP, AVIF)
Location: /content/
- Structured content for the knowledge base
- Supports hidden sections and dynamic TOC
- Markdown with custom components support
- Colors: Push Chain brand palette with dark theme
- Typography: DM Sans and Glancyr fonts
- Spacing: 8px grid system
- Breakpoints: Mobile-first responsive design
import styled from 'styled-components';
import { device } from '@site/src/config/globals';
const StyledComponent = styled.div`
padding: 24px;
background: #101010;
@media ${device.mobileL} {
padding: 16px;
}
`;
:root {
--ifm-color-primary: #e64de9;
--ifm-color-primary-dark: #d548ec;
--ifm-background-color: #000;
}
The website is automatically deployed on:
- Production: Push to
main
branch - Staging: Push to
develop
branch - Preview: Pull request previews
# Deploy to production
yarn deploy
# Deploy with SSH
USE_SSH=true yarn deploy
# Deploy specific locale
yarn deploy --locale en
# .env.local
GIT_USER=your-github-username
USE_SSH=true
DEPLOYMENT_BRANCH=gh-pages
# Translation system
AI_PROVIDER=windsurf
REACT_APP_WINDSURF_API_KEY=your_api_key
AI_MAX_INPUT_TOKENS=100000
AI_MAX_CHUNK_TOKENS=2000
AI_RATE_LIMIT_PER_MINUTE=5
AI_REQUEST_TIMEOUT=60000
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Update English content in
/static/locales/en/01-translate
- Run translation automation:
yarn translations:generate
- Review generated translations for accuracy
- Update glossary if needed for consistent terminology
- Test language switching and persistence
- Commit all translation files together
- TypeScript: Strict mode enabled
- ESLint: Enforced code quality
- Prettier: Consistent formatting
- Conventional Commits: Semantic commit messages
# Run linting
yarn lint
# Fix linting issues
yarn lint:fix
# Type checking
yarn type-check
# Build test
yarn build
- Place assets in
/static/assets/docs/{product}/{category}/{article}/
- Follow existing numbering and folder structure
- Use modern image formats (WebP, AVIF)
- Include live code examples where applicable
- Maintain consistency with existing documentation
- Follow naming convention:
yyyy-mm-dd-title-in-kebab-case/
- Include proper frontmatter and meta tags
- Add author information to
/blog/authors.yml
- Optimize images for web
- Follow component-based architecture
- Implement responsive design
- Add proper TypeScript types
- Include accessibility features
- Test across different browsers and devices
- Use the automated translation system for new content
- Follow glossary guidelines for consistent terminology
- Test language switching and persistence
- Ensure all new keys are properly structured
- Verify translations maintain technical accuracy
Need help? Here's how to get support:
- Documentation Issues: Open an issue with the
documentation
label - Bug Reports: Use the bug report template
- Feature Requests: Use the feature request template
- General Questions: Join our Discord community
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by the Push Chain team
-
All webpage go in
/src/pages
section. -
All custom components go in
src/components
section. -
You can build
.mdx
markdown page as well. Follow this Docusaurus tutorial on How to build a page for more info. -
Ensure images are of modern format (aivf, webp) and are stored under
/static/assets/website/{relevant_folder}
or for custom components under/static/assets/src/{relevant_folder}
-
Once you are done with the article, raise a PR and a team member will review -> merge -> deploy the website with your newly added blogs.
- Browse to that folder and run
for file in *; do cwebp -q 80 "$file" -o "${file%.*}.webp"; done
https://theochu.com/docusaurus/styling/
This website is built using Docusaurus 2. a modern static website generator.