Skip to content

Phase 1 - Content & Data Architecture

Done

  • Tier: Foundation (Phase 1 of 12)
  • Scope: Essential — every project completes this phase (scope labels follow ADR-033)
  • Duration: 1-2 days
  • Dependencies: Phase 0 (Foundation) completed
  • Deliverables: Content schema, TypeScript types, URL strategy, content fixtures
  • Code examples: Phase 1 - Code Examples
  • Astro project initialized
  • TypeScript configured in strict mode
  • Development environment functional
  • Content requirements gathered
StepTaskScopeNotes
1.01Inventory content typesEssentialList all content needs
1.02Design URL structureEssentialSEO-friendly paths
1.03Create content collectionsEssentialDefine in src/content.config.ts
1.04Define collection schemasEssentialZod schemas
1.05Add draft mechanismEssentialBoolean field
1.06Generate TypeScript typesEssentialAuto from schemas
1.07Create slug utilitiesEssentialConsistent URL generation
1.08Set up MDX componentsEssentialCustom elements
1.09Create content fixturesEssentialOne per type
1.10Add frontmatter validationEssentialastro check
1.11Document content modelEssentialContent model changelog (see code examples)
1.12Create content guidelinesEssentialFor authors
  1. Overly Complex Schemas: Starting with too many fields

    • Solution: Add fields as needed, start minimal
  2. Missing Draft Field: Accidentally publishing unfinished content

    • Solution: Make draft:true the default, explicitly set to false
  3. Inconsistent Slugs: URLs that change breaking links

    • Solution: Generate slugs once, store in frontmatter
  4. Type Mismatches: Schema doesn’t match actual content

    • Solution: Use fixtures to test schemas early
  • All content types identified and documented
  • URL structure defined and consistent
  • Content collections configured with schemas
  • TypeScript types generating correctly
  • Draft mechanism implemented and tested
  • Slug generation utilities working
  • MDX components configured
  • At least one fixture per content type
  • Validation passing with astro check
  • Content model changelog created
  • Author guidelines documented

If content architecture needs changes:

  1. Schema Changes:

    Terminal window
    # Illustrative — the starter ships no migration script. Project scripts live
    # in scripts/src/*.ts and run with tsx (ADR-052), so one would look like:
    pnpm exec tsx scripts/src/migrate-content.ts --from v1 --to v2
  2. URL Structure Changes:

    • Set up redirects in astro.config.mjs
    • Update all internal links
    • Submit new sitemap
  3. Collection Rename:

    • Move files to new location
    • Update imports
    • Clear .astro cache
  • src/content.config.ts - Collection schemas (Content Layer)
  • src/utils/url-utils.ts - URL patterns
  • src/content/*/ - Content examples
  • Content model changelog
  • “Create Astro content collection schema for [type]”
  • “Generate TypeScript types from content schema”
  • “Set up MDX components for rich content”
  • “Create URL structure for SEO”
  • Types of content (blog, portfolio, etc.)
  • URL preferences (with/without dates)
  • Required metadata fields
  • Future content plans

Return to Phase 0: Foundation Decisions | Proceed to Phase 2: Design System & Tokens