How asyncapi/website works
Main Components
• Next.js Web Application:
– Pages directory: The “pages” folder (with subdirectories for blog, community, casestudies, etc.) shows that the site’s routing and view layers are built with Next.js React pages.
– Context Providers: React context files (in “context”) that manage global state like AppContext, BlogContext, DocsContext, etc.
– MDX and Markdown Docs: Markdown files in “markdown” directories that provide the content for blog posts and documentation, with the ability to import shared fragments from “assets/docs/fragments”.
– Styling: CSS with Tailwind (tailwind.config.ts and styles) that styles the components.
• Build and Deployment Pipeline:
– Scripts folder: Custom scripts (e.g., build-docs.ts, build-pages.ts, etc.) to process markdown, build RSS feeds, dashboards, and more.
– GitHub Workflows: A whole suite of CI/CD workflows under “.github/workflows” that handle tests, builds, auto-deployment, labeling issues, and even custom tasks like regenerating meeting videos.
– Docker and Netlify: Dockerfile and netlify configuration files (netlify.toml, netlify/functions, etc.) indicating containerized development and serverless function support.
• Supporting Infrastructure and Tools:
– Storybook: The “.storybook” directory allows for development and documentation of UI components.
– Configuration Files: The “config” folder holds static JSON/YAML data (e.g., finance data, case studies, etc.) that the site uses to dynamically render pages.
– Testing and Type Systems: “tests” directory with multiple tests and “types” directory for TypeScript definitions that ensure code integrity.
Relationships and Data Flows
• Frontend Layer:
– The Next.js application uses React components, which are organized as pages and shared components.
– Pages load content from static markdown files and imported configuration data, then pass that to React components through context providers.
• Build Process:
– Custom scripts in the “scripts” folder pre-process markdown content and configuration files before the Next.js build.
– GitHub Workflows automatically trigger testing (including linting and unit tests) and then build the production version of the website.
• Deployment and External Integrations:
– The built site is deployed to Netlify, which uses additional Netlify Functions (in “netlify/functions” and “netlify/edge-functions”) for specific backend tasks such as serving schema files and handling newsletter subscriptions.
– Docker is supported for local development to mimic production-like deployments.
Important Architectural Patterns and Technologies
• Component-Based Architecture: Using a large collection of reusable components.
• Static Site Generation and Incremental Static Regeneration: Leveraging Next.js to serve pre-built pages for performance.
• CI/CD Patterns: Automated testing, linting, and deployment workflows via GitHub Actions.
• Serverless Functions: Utilization of Netlify Functions to extend backend capabilities without a traditional server.
• Theming and Styling: Tailwind CSS is used for styling, often coupled with Storybook to iterate on component design.