Phase 1 - Content & Data Architecture
Overview
Section titled “Overview”- Track: Both (MVP & Showcase)
- Duration: 1-2 days
- Dependencies: Phase 0 (Foundation) completed
- Deliverables: Content schema, TypeScript types, URL strategy, content fixtures
Entry Criteria
Section titled “Entry Criteria”- [x] Astro project initialized
- [x] TypeScript configured in strict mode
- [x] Development environment functional
- [x] Content requirements gathered
Implementation Steps
Section titled “Implementation Steps”| Step | Task | MVP | Showcase | Notes |
|---|---|---|---|---|
| 1.01 | Inventory content types | ✅ | ✅ | List all content needs |
| 1.02 | Design URL structure | ✅ | ✅ | SEO-friendly paths |
| 1.03 | Create content collections | ✅ | ✅ | Define in config.ts |
| 1.04 | Define collection schemas | ✅ | ✅ | Zod schemas |
| 1.05 | Add draft mechanism | ✅ | ✅ | Boolean field |
| 1.06 | Generate TypeScript types | ✅ | ✅ | Auto from schemas |
| 1.07 | Create slug utilities | ✅ | ✅ | Consistent URL generation |
| 1.08 | Set up MDX components | ✅ | ✅ | Custom elements |
| 1.09 | Create content fixtures | ✅ | ✅ | One per type |
| 1.10 | Add frontmatter validation | ✅ | ✅ | astro check |
| 1.11 | Document content model | ✅ | ✅ | CHANGELOG.md |
| 1.12 | Create content guidelines | ✅ | ✅ | For authors |
Common Pitfalls
Section titled “Common Pitfalls”-
Overly Complex Schemas: Starting with too many fields
- Solution: Add fields as needed, start minimal
-
Missing Draft Field: Accidentally publishing unfinished content
- Solution: Make draft:true the default, explicitly set to false
-
Inconsistent Slugs: URLs that change breaking links
- Solution: Generate slugs once, store in frontmatter
-
Type Mismatches: Schema doesn’t match actual content
- Solution: Use fixtures to test schemas early
Exit Criteria
Section titled “Exit Criteria”- [x] All content types identified and documented
- [x] URL structure defined and consistent
- [x] Content collections configured with schemas
- [x] TypeScript types generating correctly
- [x] Draft mechanism implemented and tested
- [x] Slug generation utilities working
- [x] MDX components configured
- [x] At least one fixture per content type
- [x] Validation passing with
astro check - [x] Content model changelog created
- [x] Author guidelines documented
Rollback Strategy
Section titled “Rollback Strategy”If content architecture needs changes:
-
Schema Changes:
Terminal window # Create migration scriptnode scripts/migrate-content.js --from v1 --to v2 -
URL Structure Changes:
- Set up redirects in
astro.config.mjs - Update all internal links
- Submit new sitemap
- Set up redirects in
-
Collection Rename:
- Move files to new location
- Update imports
- Clear
.astrocache
AI Assistant Notes
Section titled “AI Assistant Notes”Key Files to Reference
Section titled “Key Files to Reference”src/content/config.ts- Collection schemassrc/utils/url-utils.ts- URL patternssrc/content/*/- Content examples- Content model changelog
Common Prompts for This Phase
Section titled “Common Prompts for This Phase”- “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”
Context Requirements
Section titled “Context Requirements”- Types of content (blog, portfolio, etc.)
- URL preferences (with/without dates)
- Required metadata fields
- Future content plans
References
Section titled “References”- Astro Content Collections Documentation
- Zod Schema Validation
- SEO-Friendly URL Structure Best Practices
Return to Phase 0: Foundation Decisions | Proceed to Phase 2: Design System Tokens