Official documentation website for Sockeon - A framework-agnostic PHP WebSocket and HTTP server library.
- Versioned Documentation: Supports multiple documentation versions (v1.0, v2.0, and v3.0 draft)
- Modern Stack: Built with VitePress for fast, SEO-friendly documentation
- Algolia Search: Integrated Algolia DocSearch for powerful documentation search
- SEO Optimized: Includes sitemap generation, robots.txt, and proper meta tags
- Responsive Design: Mobile-friendly with a professional, modern UI
- Node.js 18+
- npm or yarn
- Git (for submodule management)
- Clone the repository:
git clone git@github.com:sockeon/website.git
cd website- Initialize and update Git submodules:
git submodule update --init --recursive- Install dependencies:
npm installStart the development server:
npm run docs:devThe documentation will be available at http://localhost:5173
Build the documentation for production:
npm run docs:buildThis will:
- Build the VitePress site
- Generate the sitemap automatically
Preview the production build:
npm run docs:preview.
├── docs/
│ ├── .vitepress/ # VitePress configuration
│ │ ├── config.mts # Main VitePress config
│ │ ├── sidebars.ts # Sidebar navigation
│ │ ├── generate-sitemap.ts # Sitemap generator
│ │ ├── components/ # Vue components
│ │ └── theme/ # Theme customizations
│ ├── v1.0/ # v1.0 documentation (submodule)
│ ├── v2.0/ # v2.0 documentation (submodule)
│ ├── v3.0/ # v3.0 documentation (submodule, draft)
│ ├── index.md # Home page
│ └── public/ # Static assets
├── package.json
└── README.md
The documentation for each version is stored in Git submodules. This allows version-specific documentation to be maintained separately.
- Update submodule content:
cd docs/v1.0 # or docs/v2.0
# Make your changes
git add .
git commit -m "Update documentation"
git push origin v1.0 # or v2.0
cd ../..- Update main repository:
git add docs/v1.0 docs/v2.0
git commit -m "Update documentation submodules"
git push origin mainWhen deploying, update submodules with:
# Ensure submodules exist at the exact commits pinned by this release
git submodule sync --recursive
git submodule update --init --recursiveIf your deploy runner starts from the monorepo root, run:
cd sockeon.github.io
git submodule sync --recursive
git submodule update --init --recursive
npm install
npm run build- Add the version to
docs/.vitepress/versions.json - Add sidebar configuration in
docs/.vitepress/sidebars.ts - Add the submodule:
git submodule add -b vX.X git@github.com:sockeon/docs.git docs/vX.X- Custom components:
docs/.vitepress/components/ - Theme styles:
docs/.vitepress/theme/style.css - Layout:
docs/.vitepress/theme/index.ts
The site uses Algolia DocSearch. Configuration is in docs/.vitepress/config.mts:
search: {
provider: 'algolia',
options: {
appId: 'NDFUG8I0D2',
apiKey: '649717b25060e28c3cef93af26888759',
indexName: 'sockeon',
// ...
}
}- Sitemap: Automatically generated during build (
/sitemap.xml) - Robots.txt: Located at
/public/robots.txt - Meta Tags: Configured in
config.mts - Canonical URLs: Automatically set per page
The built files are in docs/.vitepress/dist/. Deploy this directory to your web server.
Example nginx configuration:
location / {
try_files $uri $uri.html $uri/ /index.html;
}- v2.0 (Current): Stable documentation for the latest release
- v3.0 (Draft): Upcoming engines, Swoole, scaling — not indexed until released
- v1.0 (Legacy): Previous version for reference
Users can switch between versions using the version selector in the navigation bar.
- Make changes to the appropriate documentation submodule
- Commit and push to the submodule repository
- Update the main repository to reference the new submodule commit
- Submit a pull request
This documentation website is part of the Sockeon project.
- Website: https://sockeon.github.io
- GitHub: https://github.com/sockeon/sockeon
- Documentation: https://sockeon.github.io/v2.0/getting-started/installation