Skip to content
STACK IT FAST

Astro

Curated OSSHybridIsland Architecture Web Framework1M+ MAU

Audited from github.com/withastro/astro

Astro is an open-source web framework for building content-driven websites with an islands architecture: pages render to static HTML by default, and interactive UI components from any supported framework hydrate individually only where needed.

Language
TypeScript
Hosting
Cloudflare Workers
Running for
4 years
Team
1M+ MAU

Why this architecture

Vite as a first-class dependency and per-framework, per-host integration packages let Astro ship a fast static-first build while opting into server rendering or client hydration only where a project actually needs it.

Tech stack by layer

8 technologies · audited Sep 17, 2026
Frontend & UI
  • AstroThe framework itself: compiles .astro components and ships an islands-architecture runtime with per-component hydration.
  • ViteAstro's dev server and production bundler; packages/astro depends on Vite 8 directly, not through a plugin.
  • ShikiPowers the built-in syntax highlighter used by Markdown/MDX code blocks.
  • SharpOptional dependency used by Astro's built-in image optimization service.
Backend & APIs
  • ZodValidates Astro config and content-collection frontmatter schemas.
  • esbuildUsed internally by Astro's core for fast TypeScript/JS transforms.
Infrastructure & Deploy
  • Cloudflare Workers@astrojs/cloudflare adapter deploys Astro SSR output to Cloudflare Workers via the official Vite plugin and Wrangler.
  • DockerProvides a devcontainer/example Dockerfile for containerized Astro builds.
Tooling, Testing & Ops
  • pnpmWorkspace package manager for the whole monorepo (pnpm@11.27.0, four workspace globs).
  • TurborepoOrchestrates build/dev/test/lint task graphs across every package and example in the monorepo.
  • VitestUnit, integration and e2e-adjacent test runner for astro, create-astro and the integrations.
  • BiomeFormats code and lints/sorts imports repo-wide, paired with ESLint for deeper rules.
  • PlaywrightEnd-to-end browser tests for packages/astro (test:e2e:chrome/firefox scripts).
  • GitHub ActionsCI, format, continuous-benchmark, release (Changesets), and example-sync workflows.

Astro architecture diagram

Open SVG
Astro architecture diagramcreate-astro → Astro project (scaffold); Astro project → astro core (astro build); astro core → Vite (dev / build); astro core → esbuild (transforms); astro core → Markdown & images (Markdown · images); astro core → Integrations (hooks); Vite → Build output (emit); Integrations → Hosting target (deploy adapter)CLIENTSSERVICESWORKERS & JOBSDATA & STORAGEEXTERNALcreate-astrocli-kit · giget templatesAstro project.astro · MDX · collectionsastro corecompiler · islands runtimeVitedev server · bundleresbuildTS / JS transformsMarkdown & imagesShiki · SharpIntegrationsUI frameworks · adaptersBuild outputstatic HTML · SSR bundleHosting targetCloudflare Workers · othersscaffoldastro builddev / buildtransformsMarkdown · imageshooksemitdeploy adapter
How the main components of Astro connect, drawn from the audited repository.
Diagram as text
  • create-astro (cli-kit · giget templates) → Astro project (.astro · MDX · collections): scaffold
  • Astro project (.astro · MDX · collections) → astro core (compiler · islands runtime): astro build
  • astro core (compiler · islands runtime) → Vite (dev server · bundler): dev / build
  • astro core (compiler · islands runtime) → esbuild (TS / JS transforms): transforms
  • astro core (compiler · islands runtime) → Markdown & images (Shiki · Sharp): Markdown · images
  • astro core (compiler · islands runtime) → Integrations (UI frameworks · adapters): hooks
  • Vite (dev server · bundler) → Build output (static HTML · SSR bundle): emit
  • Integrations (UI frameworks · adapters) → Hosting target (Cloudflare Workers · others): deploy adapter

Key architectural decisions

5 decisions
  1. 01

    The framework is a pnpm + Turborepo monorepo of many small packages

    The root package.json declares workspaces for packages/markdown/*, packages/integrations/*, packages/*, and packages/language-tools/*, and turbo.json defines the task graph (build, dev, test) that Turborepo runs across all of them. The astro package (the compiler/runtime) and create-astro (the scaffolding CLI) are separate publishable packages from every framework integration.

  2. 02

    Vite is a direct dependency of the core, not an optional plugin host

    packages/astro/package.json lists "vite": "^8.0.13" as a normal dependency alongside esbuild and vitefu, so every Astro project gets a Vite dev server and Rollup-based production build without any extra configuration; integrations and adapters plug into Vite through Astro rather than the other way around.

  3. 03

    Each hosting target and UI framework ships as its own scoped package

    packages/integrations holds one package per adapter or framework (for example @astrojs/cloudflare for Cloudflare Workers, seen in packages/integrations/cloudflare/package.json), so a project only installs the runtime code for the platform and UI frameworks it actually uses instead of bundling every possible target.

  4. 04

    Content schemas are validated with Zod, not a custom validator

    packages/astro/package.json depends on "zod": "^4.5.4" directly, which backs the content collections API (defineCollection/z schema helpers) so authors get typed, validated frontmatter without Astro maintaining its own schema language.

  5. 05

    create-astro is a thin, separately versioned scaffolding tool

    packages/create-astro/package.json depends on @astrojs/cli-kit for the interactive prompts and @bluwy/giget-core to fetch example templates from GitHub, keeping the "npm create astro@latest" CLI decoupled from the astro package itself so it can evolve on its own release cadence.

How Astro is built

How Astro is structured

Astro is a pnpm workspace built with Turborepo. The root package.json declares workspace globs for packages/markdown/*, packages/integrations/*, packages/*, and packages/language-tools/*, and turbo.json defines the build, dev, and test task graph that Turborepo runs across all of them with dependency-aware caching. packages/astro is the core compiler and runtime; packages/create-astro is the separately versioned npm create astro scaffolding CLI; packages/integrations holds one package per UI framework or deployment adapter (React, Preact, Solid, Svelte, Vue, Alpine.js, Cloudflare, and others); and packages/language-tools holds the VS Code extension and language server. examples/ contains starter templates (basics, blog, portfolio, with-tailwindcss, and more) that are also used as smoke tests, and benchmark/ holds a dedicated package for performance regression tracking.

Frontend

The .astro component format and its islands-architecture runtime live in packages/astro. Interactivity is opt-in per component through client:* directives, and each supported UI framework (React, Preact, Solid, Svelte, Vue, Alpine.js) is its own @astrojs/* package under packages/integrations rather than being bundled into the core. Content authored in Markdown or MDX is highlighted with Shiki and validated against Zod schemas through the content collections API. Images go through Astro's built-in asset pipeline, which uses the optional sharp dependency declared in packages/astro/package.json for local image optimization.

Backend & APIs

Astro is not itself an application server; server behavior is opt-in per route or per project through the output: 'server' config and an adapter. The core still ships server-side primitives used by SSR routes and API endpoints — Astro Actions and endpoint handlers run inside the adapter's runtime, and zod (a direct dependency of packages/astro) validates action input. hono appears only as a devDependency of packages/astro, used in the project's own tests rather than shipped to end users.

Build, test & deploy

Every project's dev server and production build run on Vite 8, a direct dependency of packages/astro rather than an optional plugin host; esbuild handles fast internal transforms. Within the monorepo itself, biome.jsonc configures Biome for formatting and import linting, paired with ESLint (eslint.config.js) for rules Biome doesn't cover; knip.js finds unused exports. Tests run on Vitest 4 (test:unit, test:integration) plus Playwright for end-to-end browser tests (test:e2e:chrome, test:e2e:firefox) and a dedicated test:types pass with tsc. .github/workflows runs ci.yml on every push, continuous_benchmark.yml to track performance over time, format.yml and zizmor.yml/semgrep.yml for formatting and security scanning, and release.yml, which is driven by Changesets (.changeset/ holds pending release notes).

Self-hosting notes

A default Astro build (astro build) emits static files servable from any static host or CDN, with no runtime requirement. Server-rendered routes need an adapter: @astrojs/cloudflare (in packages/integrations/cloudflare) depends on @cloudflare/vite-plugin and peer-depends on wrangler, so it deploys to Cloudflare Workers through Wrangler; @astrojs/node (not audited in this pass but present under packages/integrations) produces a standalone Node server suitable for a self-managed container. .devcontainer/Dockerfile and the numbered .devcontainer/framework-* folders provide a containerized development environment rather than a production deployment image, so self-hosting a specific output still means choosing and configuring the matching adapter yourself.

What to copy (and what not to)

The pnpm + Turborepo monorepo layout, with one scoped package per adapter or framework integration, is worth copying whenever a framework needs to support many optional runtimes without forcing every user to install code for platforms they don't use. Making Vite a direct, non-optional dependency of the core (rather than an integration users add) is a deliberate simplification that only makes sense if, like Astro, your framework is committed to Vite as its only bundler — a framework that wants to stay bundler-agnostic should not copy this. The islands architecture and per-component hydration directives are Astro's core value proposition and are worth studying closely for any content-heavy site that currently ships a full client-side framework for what is mostly static content.

Sources & repo audit

Audited
Sep 17, 2026
Commit
1aa7ae5
License
NOASSERTION

Independent analysis of repository at github.com/withastro/astro. Spotted an inaccuracy? Use the claim form to request a correction.

Show this stack on your README or website
Tech stack of Astro
[![Tech stack of Astro on STACK IT FAST](https://stackitfast.com/badge/astro.svg)](https://stackitfast.com/project/astro)

Paste it into your README. It shows your current stack and links to this page.

Use this stack

Scaffold it with your agent

Paste this prompt into Claude Code, Cursor, Windsurf or AGY to start a project with Astro's architecture.

  1. 1Copy the promptThe full markdown spec, with every layer and decision.
  2. 2Open your AI toolClaude Code, Cursor, Windsurf or Copilot, in a new repo.
  3. 3Paste and scaffoldUse it as the first instruction; review before you ship.
use-this-stack.md · 59 lines · 7.5 KB
# MISSION: Scaffold "Astro" Production Architecture
You are an expert Senior Staff Software Architect and Full-Stack Engineer. Your mission is to scaffold and implement a production-grade, highly reliable, and modular codebase following the proven architecture of **Astro**.
---
## 1. PROJECT SPECIFICATIONS & BENCHMARK
- **Reference Architecture**: Astro
- **What It Does**: Astro is an open-source web framework for building content-driven websites with an islands architecture: pages render to static HTML by default, and interactive UI components from any supported framework hydrate individually only where needed.
- **Domain & Category**: Island Architecture Web Framework
- **Production Scale**: 1M+ MAU
- **Development Mode**: HYBRID
- **Architectural Rationale**: Vite as a first-class dependency and per-framework, per-host integration packages let Astro ship a fast static-first build while opting into server rendering or client hydration only where a project actually needs it.
- **Live Website Reference**: https://astro.build
- **Source Repository**: https://github.com/withastro/astro
---
## 2. PRODUCTION TECH STACK
- **Full Stack Array**: Astro, TypeScript, Vite, Node.js, pnpm, Turborepo, Vitest, Zod
- **Primary Language(s)**: TypeScript, Astro, JavaScript
- **License of the reference repo**: NOASSERTION
- **Frontend**: Astro — The framework itself: compiles .astro components and ships an islands-architecture runtime with per-component hydration.; Vite — Astro's dev server and production bundler; packages/astro depends on Vite 8 directly, not through a plugin.; Shiki — Powers the built-in syntax highlighter used by Markdown/MDX code blocks.; Sharp — Optional dependency used by Astro's built-in image optimization service.
- **Backend & APIs**: Zod — Validates Astro config and content-collection frontmatter schemas.; esbuild — Used internally by Astro's core for fast TypeScript/JS transforms.
- **Infrastructure & deploy**: Cloudflare Workers — @astrojs/cloudflare adapter deploys Astro SSR output to Cloudflare Workers via the official Vite plugin and Wrangler.; Docker — Provides a devcontainer/example Dockerfile for containerized Astro builds.
- **Tooling, testing & ops**: pnpm — Workspace package manager for the whole monorepo (pnpm@11.27.0, four workspace globs).; Turborepo — Orchestrates build/dev/test/lint task graphs across every package and example in the monorepo.; Vitest — Unit, integration and e2e-adjacent test runner for astro, create-astro and the integrations.; Biome — Formats code and lints/sorts imports repo-wide, paired with ESLint for deeper rules.; Playwright — End-to-end browser tests for packages/astro (test:e2e:chrome/firefox scripts).; GitHub Actions — CI, format, continuous-benchmark, release (Changesets), and example-sync workflows.
---
## 3. KEY ARCHITECTURAL DECISIONS (audited from https://github.com/withastro/astro @ 1aa7ae5)
1. **The framework is a pnpm + Turborepo monorepo of many small packages**: The root package.json declares workspaces for packages/markdown/*, packages/integrations/*, packages/*, and packages/language-tools/*, and turbo.json defines the task graph (build, dev, test) that Turborepo runs across all of them. The astro package (the compiler/runtime) and create-astro (the scaffolding CLI) are separate publishable packages from every framework integration.
2. **Vite is a direct dependency of the core, not an optional plugin host**: packages/astro/package.json lists "vite": "^8.0.13" as a normal dependency alongside esbuild and vitefu, so every Astro project gets a Vite dev server and Rollup-based production build without any extra configuration; integrations and adapters plug into Vite through Astro rather than the other way around.
3. **Each hosting target and UI framework ships as its own scoped package**: packages/integrations holds one package per adapter or framework (for example @astrojs/cloudflare for Cloudflare Workers, seen in packages/integrations/cloudflare/package.json), so a project only installs the runtime code for the platform and UI frameworks it actually uses instead of bundling every possible target.
4. **Content schemas are validated with Zod, not a custom validator**: packages/astro/package.json depends on "zod": "^4.5.4" directly, which backs the content collections API (defineCollection/z schema helpers) so authors get typed, validated frontmatter without Astro maintaining its own schema language.
5. **create-astro is a thin, separately versioned scaffolding tool**: packages/create-astro/package.json depends on @astrojs/cli-kit for the interactive prompts and @bluwy/giget-core to fetch example templates from GitHub, keeping the "npm create astro@latest" CLI decoupled from the astro package itself so it can evolve on its own release cadence.
---
## 4. NON-NEGOTIABLE ARCHITECTURAL GUARDRAILS
1. **Monorepo & Modular Separation**:
   - Structure as a Turborepo monorepo with strict package boundaries:
     - `apps/web`: Application UI, routing, layouts, and server endpoints.
     - `packages/ui`: Shared design tokens, CSS variables, and Radix UI primitive components.
     - `packages/db`: Database schemas, client singleton, declarative migrations, and seed scripts.
     - `packages/config`: Shared TypeScript, ESLint, and build configurations.
2. **Strict Type Safety & Zero `any` Policy**:
   - Enable `strict: true`, `noImplicitAny: true`, and `strictNullChecks: true`.
   - Validate ALL external inputs, API request bodies, and query parameters with **Zod** schemas before execution.
3. **Frontend & Rendering Guidelines**:
   - Leverage Astro's Island Architecture: keep pages static (.astro) by default for zero-JS baseline and instant Google search indexing. Hydrate interactive React components with 'client:load' or 'client:visible' only where needed for user state.
4. **Design System & Aesthetics**:
   - Keep every color, radius, shadow and font in a single token file (CSS variables) and consume tokens everywhere; never hardcode hex values in components.
   - Prefer crisp 1px borders and one subtle shadow scale over blurry default shadows. Pair one sans-serif for body/headings with one monospace for tags, badges, metrics, and code.
5. **Data Layer & Reliability**:
   - Write declarative schema definitions with foreign keys, composite indexes on queried filters, and automated timestamp triggers.
   - Use connection pooling and prepared statements for serverless database execution.
---
## 5. STEP-BY-STEP SCAFFOLDING ROADMAP
- **Phase 1: Workspace & Root Config**: Initialize package manager, monorepo configuration (`turbo.json`, `tsconfig.base.json`, `package.json`).
- **Phase 2: Database Schema & Client**: Set up the data layer: client, connection pool, models, and migration scripts.
- **Phase 3: Design Tokens & UI Primitives**: Build accessible `Button`, `Input`, `Card`, `Badge`, and layout wrappers inside `packages/ui`.
- **Phase 4: Core Application Routes & Handlers**: Implement primary authentication, user session handling, and application routes.
- **Phase 5: Quality Assurance & Build Verification**: Run `tsc --noEmit`, ESLint, Prettier, and smoke test suites to ensure zero compilation or runtime errors.
---
## 6. EXECUTION INSTRUCTIONS
1. Review all specifications, architectural guardrails, and stack choices above.
2. Present the full monorepo directory tree structure.
3. Systematically generate the complete, production-ready codebase according to the 5-phase roadmap above — starting with the root workspace setup, followed by the database schema, UI design system package, and full-stack application routes until the repository is fully scaffolded and ready to run.
Scaffolded something with this prompt?
Would you pick this stack for a island architecture web framework project?

Frequently asked about Astro

What is Astro built with?

Astro's compiler and runtime (packages/astro) are TypeScript, built on Vite 8 for dev serving and bundling, esbuild for fast transforms, Shiki for code highlighting, Zod for content-collection schema validation, and optional Sharp for image processing. The monorepo itself is managed with pnpm workspaces and Turborepo.

Does Astro need a backend?

No, not by default. Astro renders content-driven sites to static HTML at build time; server rendering is opt-in per route through adapters like @astrojs/node, @astrojs/cloudflare, or @astrojs/vercel, which run Astro on a specific server or edge runtime only when you choose SSR.

Can I self-host Astro?

Yes. A static Astro build is plain HTML/CSS/JS that any static host or the included .devcontainer/Dockerfile-style Node setup can serve. For server-rendered routes, the @astrojs/node adapter produces a standalone Node server you can run in your own Docker container or process manager.

Which UI frameworks can I use inside Astro?

Astro supports islands built with React, Preact, Solid, Svelte, Vue, and Alpine.js, each shipped as a separate @astrojs/* integration package under packages/integrations so a project only installs the renderer for the frameworks it actually uses.

One email a month: new deep dives and stack trends

New source-audited architectures, head-to-head comparisons and the monthly stack report. No spam, unsubscribe anytime.

use-this-stack.md