How anyproto/anytype-api works
Project type and purpose
• This is a static documentation website (developer portal) built with Docusaurus (a React‐based SSG).
• It pulls in OpenAPI specs to generate API reference pages, MDX/Markdown for guides & examples, and custom React components for features like the changelog.
File structure
• Top-level project root contains:
– Configuration: docusaurus.config.ts, sidebars.ts, openapi.config.ts, Dockerfile, GitHub Actions workflows
– docs/: all MDX docs (guides, examples, reference versions, OpenAPI YAML)
– src/: React components, CSS, pages for the site theme
– static/: images & other static assets
• package.json defines dependencies (Docusaurus, plugins for OpenAPI).
• .github/workflows includes CI jobs for building, testing, and deploying the site.
Readme insights
• Describes the purpose (guides, API reference, examples)
• Instructs on local dev (npm run start), build & serve (npm run build + npm run serve)
• Mentions search index generation at build time
Main components and relationships
a. Authoring & Source Content
– MDX/Markdown files in docs/ (guides, examples, reference)
– OpenAPI YAML specs in docs/reference & openapi.config.ts (to feed the OpenAPI plugin)
– React components in src/components (ChangelogSection, HomepageFeatures)
– Static assets in static/img
b. Build Toolchain
– Docusaurus SSG (driven by docusaurus.config.ts & sidebars.ts)
– OpenAPI plugin reads specs → generates API pages
– Webpack/Babel from Docusaurus compiles React + CSS → static assets + HTML
– Search index generator (built in during npm run build)
c. CI/CD Pipeline
– GitHub Actions (stainless.yml, deploy_released.yml)
– Steps: checkout → install deps → lint/test → npm run build → publish to hosting (e.g., GitHub Pages, Netlify, or Docker image from Dockerfile)
d. Runtime / Hosting
– Static hosting (CDN) serves the built files
– Browser clients request HTML/CSS/JS → dynamic client-side routing & search
Important patterns & design principles
• Static Site Generation (no server runtime)
• Component-based UI (React)
• Plugin architecture (Docusaurus + OpenAPI plugin)
• Clear separation: Content (docs/) vs. Presentation (src/) vs. Configuration (config files)
• CI/CD for reproducible builds → automatic publishing
Don’t overthink—capture every logical component
• Source content (MDX, YAML, React code, assets)
• Build/configuration (TS config files, package.json)
• Plugins & frameworks (Docusaurus core, OpenAPI plugin)
• CI/CD orchestration
• Deployment & hosting
• End-user consumption