How alexandre-tortoza/astro-launchpad works
Purpose and Entry Points
Astro Launchpad is a pnpm monorepo that publishes an interactive project generator for production-ready Astro landing sites. The user-facing entry point is the create-astro-launchpad package, invoked through npm create or pnpm. Its CLI gathers options, validates the environment, scaffolds a destination, optionally installs dependencies, and initializes Git.
• packages/create-astro-launchpad/src/index.ts
• packages/create-astro-launchpad/src/prompts.ts
• packages/create-astro-launchpad/src/scaffold.ts
CLI Orchestration and Safety Boundary
The generator separates option resolution, interactive prompts, preflight diagnostics, subprocess execution, and filesystem mutation. The destination directory is the primary safety boundary: the CLI does not overwrite a non-empty target. Docker setup, dependency installation, and Git initialization are optional post-scaffold stages.
• packages/create-astro-launchpad/src/options.ts
• packages/create-astro-launchpad/src/doctor.ts
• packages/create-astro-launchpad/src/process.ts
Template Composition Pipeline
Generation begins with the shared Astro base, then composes selected feature overlays and one landing-page preset into the output project. Presets provide starter content/assets; features add CMS, blog, styling, motion, Docker, or AI resources. Build scripts likely package these template inputs for the CLI.
• templates/base
• templates/features
• templates/presets
• scripts/build-presets.mjs
Generated Astro Application Core
Every generated site centers on Astro pages, a shared layout, typed content configuration, and a section renderer. Page content supplies ordered blocks; the renderer resolves them to reusable Astro components. This makes content providers responsible for normalized page data while presentation remains in the base template.
• templates/base/src/pages/index.astro
• templates/base/src/components/SectionRenderer.astro
• templates/base/src/components/blocks
• templates/base/src/layouts/Layout.astro
Content Layer and Validation
The base template defines a provider-facing content abstraction with Markdown and mock implementations, plus block types, schemas, and validation. Selected CMS features replace or extend the content entry point with provider-specific adapters, preserving the generated site's rendering boundary.
• templates/base/src/lib/content/index.ts
• templates/base/src/lib/blocks/schemas.ts
• templates/base/src/lib/blocks/validate.ts
• templates/features/directus/src/lib/content/directus.ts
• templates/features/strapi/src/lib/content/strapi.ts
CMS and Deployment Integrations
Markdown is local-file content. Directus and Strapi are optional external headless CMS runtimes, configured through environment files and seeded with schemas/data; both depend on Docker-backed services and PostgreSQL per the documented generated stack. Strapi includes its CMS application and content-type definitions; Directus ships schema snapshots and seed tooling.
• templates/features/directus/schema/snapshot.json
• templates/features/directus/seed/seed.ts
• templates/features/strapi/cms/src/index.ts
• templates/features/strapi/cms/config/database.ts
• templates/features/docker/docker/nginx.conf
Optional Product Features and AI Resources
Feature overlays add blog routes/RSS, motion primitives, Tailwind styling, and AI-assisted development artifacts. The AI kit is a publishable resource package containing prompts, skills, and JSON schemas rather than a runtime AI service integration.
• templates/features/blog/src/pages/rss.xml.ts
• templates/features/motion/src/components/motion/Fade.astro
• templates/features/tailwind/src/styles/global.css
• packages/ai-kit/src/index.ts
• packages/ai-kit/prompts
Main entry points: features Feature overlays · scaffold.ts Scaffold writer · index.ts create-astro-launchpad CLI · index.astro Astro home page
Components 21
Generator CLI
Interactive project creation and safety checks.
- create-astro-launchpad CLI · User entry point for npm create or pnpm.
packages/create-astro-launchpad/src/index.ts - Option resolution
packages/create-astro-launchpad/src/options.ts - Interactive prompts
packages/create-astro-launchpad/src/prompts.ts - Preflight diagnostics · Validates environment and protects non-empty destinations.
packages/create-astro-launchpad/src/doctor.ts - Scaffold writer · Composes files and runs optional post-scaffold stages.
packages/create-astro-launchpad/src/scaffold.ts - Process runner · Runs package installation and Git initialization.
packages/create-astro-launchpad/src/process.ts
Template Pipeline
Base template composed with selected overlays and presets.
- Template build · Packages preset inputs for the generator.
scripts/build-presets.mjs - Shared Astro base · Common application foundation for every generated site.
templates/base - Feature overlays · Selectable CMS, blog, styling, motion, Docker, and AI resources.
templates/features - Landing presets · Starter page content and assets.
templates/presets
Generated Astro Site
Core runtime structure emitted into each project.
- Astro home page · Supplies ordered page blocks.
templates/base/src/pages/index.astro - Shared layout
templates/base/src/layouts/Layout.astro - Section renderer · Maps normalized blocks to presentation components.
templates/base/src/components/SectionRenderer.astro - Block components
templates/base/src/components/blocks - Content abstraction · Provider-facing entry point for normalized page data.
templates/base/src/lib/content/index.ts - Block schemas and validation
templates/base/src/lib/blocks/validate.ts
Optional Integrations
CMS, deployment, and product feature overlays.
- Directus integration · External CMS with schema snapshot and seed tooling.
templates/features/directus/schema/snapshot.json - Strapi integration · External CMS application with content types and PostgreSQL configuration.
templates/features/strapi/cms/src/index.ts - Docker deployment · Provides container stack and Nginx configuration.
templates/features/docker/docker/nginx.conf - Blog and RSS
templates/features/blog/src/pages/rss.xml.ts - AI kit · Publishable prompts, skills, and schemas; not a runtime AI service.
packages/ai-kit/src/index.ts
Connections 22
- create-astro-launchpad CLI → Option resolution: resolves
- create-astro-launchpad CLI → Interactive prompts: collects choices
- create-astro-launchpad CLI → Preflight diagnostics: checks destination
- create-astro-launchpad CLI → Scaffold writer: creates project
- Scaffold writer → Process runner: optionally invokes
- Template build → Landing presets: packages
- Scaffold writer → Shared Astro base: copies
- Scaffold writer → Feature overlays: applies selected
- Scaffold writer → Landing presets: applies selected
- Shared Astro base → Astro home page: generates
- Astro home page → Shared layout: uses
- Astro home page → Content abstraction: loads content from
- Astro home page → Section renderer: renders blocks through
- Section renderer → Block components: resolves
- Content abstraction → Block schemas and validation: validates with
- Feature overlays → Directus integration: includes option
- Feature overlays → Strapi integration: includes option
- Feature overlays → Docker deployment: includes option
- Feature overlays → Blog and RSS: includes option
- Directus integration → Content abstraction: provides adapter
- Strapi integration → Content abstraction: provides adapter
- AI kit → Feature overlays: supports development