How drizzle-team/drizzle-orm-docs works
Project Type and Purpose
• This is a content-driven static documentation website built with Astro.
• It uses MDX for docs content, custom Astro/React components for UI, and PNPM scripts for build and development.
• The site surfaces Drizzle ORM/Kit documentation, announcements, benchmarks, and a landing page.
Main Architectural Components
a. Content Sources
• Markdown/MDX files in src/content/docs and src/content/announcements
• Static data files in src/data (YAML, TS modules for sponsors, roadmap, tweets)
b. Presentation Layer
• Astro pages in src/pages drive routing
• Shared UI components in src/ui (Astro React/TSX) and src/mdx for MDX-specific wrappers
c. Build System
• Astro compiler (astro.config.mjs) orchestrates MDX → HTML, TSX → JS, CSS bundling
• PostCSS, ESLint, Prettier, Vitest for linting/tests, TS config
• PNPM scripts: dev server, build to ./dist, preview
d. Deployment & Delivery
• Static output in dist/ served via CDN or static host (Netlify, Vercel, Cloudflare)
• Client browser requests pre-rendered HTML/CSS/JS assets
Relationships and Data Flow
1. Developer edits MDX content or UI components
2. PNPM run dev triggers Astro dev server:
– Reads src/content, src/mdx, src/ui, src/assets
– Pipes through Astro’s MDX parser and bundler → in-memory HTML/CSS/JS
– Live-reload served to browser
3. PNPM run build runs Astro’s static site generator:
– Transforms all inputs into a flat tree of HTML/CSS/JS in dist/
4. Dist/ deployed to static hosting → CDN distributes assets
5. End user’s browser fetches HTML pages, which reference static assets (CSS, JS, images)
Key Architectural Patterns & Principles
• Static Site Generation (SSG) with Astro
• Component-driven UI (Astro/React/TSX) + MDX templates
• “Content-as-code” (docs in Git, versioned like software)
• Single-responsibility components (src/ui vs. src/mdx vs. src/pages vs. src/data)