File Structure

  • ♣️ sanitypress/
    β”œβ”€ πŸ“ src/
    β”‚ β”œβ”€ πŸ“ app/              # Next.js App Router
    β”‚ β”‚ β”œβ”€ πŸ“ (frontend)/     # Public-facing site
    β”‚ β”‚ β”‚ β”œβ”€ layout.tsx       # Frontend root layout
    β”‚ β”‚ β”‚ β”œβ”€ not-found.tsx    # 404 page
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ [[...slug]]/  # Catch-all for all standard pages
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ blog/[slug]/  # Individual blog post pages
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ blog/rss.xml/ # RSS feed endpoint
    β”‚ β”‚ β”‚ └─ πŸ“ api/          # API route handlers
    β”‚ β”‚ β”‚ β”‚ β”œβ”€ πŸ“ draft-mode/ # Enable/disable Sanity draft mode
    β”‚ β”‚ β”‚ β”‚ └─ πŸ“ og/         # Open Graph image generation
    β”‚ β”‚ β”œβ”€ πŸ“ (studio)/admin/ # Sanity Studio (CMS editor UI)
    β”‚ β”‚ └─ sitemap.ts         # Auto-generated sitemap
    β”‚ β”œβ”€ πŸ“ ui/               # React components
    β”‚ β”‚ β”œβ”€ πŸ“ modules/        # One component per Sanity module
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ blog/         # Blog-specific components (post list, filters, etc.)
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ prose/        # Rich text components / portable text renderer
    β”‚ β”‚ β”‚ └─ ...              # Modules
    β”‚ β”‚ β”œβ”€ πŸ“ header/         # Header, navigation, megamenu
    β”‚ β”‚ β”œβ”€ πŸ“ footer/         # Footer and link list
    β”‚ β”‚ └─ ...                # Shared components (CTA, Img, Logo, etc.)
    β”‚ β”œβ”€ πŸ“ sanity/           # Sanity CMS configuration
    β”‚ β”‚ β”œβ”€ πŸ“ schemaTypes/
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ documents/    # Top-level content types (page, blog.post, site, navigation…)
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ modules/      # Page-building blocks (heroes, grids, prose, search…)
    β”‚ β”‚ β”‚ β”œβ”€ πŸ“ objects/      # Reusable field groups (cta, link, metadata…)
    β”‚ β”‚ β”‚ └─ πŸ“ fragments/    # Shared GROQ fragment definitions
    β”‚ β”‚ β”œβ”€ πŸ“ lib/            # Queries, fetch helpers, image builder
    β”‚ β”‚ β”œβ”€ πŸ“ ui/             # Custom Studio UI components
    β”‚ β”‚ └─ ...                # Sanity files
    β”‚ β”œβ”€ πŸ“ lib/              # Shared app utilities and env helpers
    β”‚ β”œβ”€ πŸ“ hooks/            # Custom React hooks
    β”‚ └─ πŸ“ types/            # Global TypeScript declarations
    β”œβ”€ πŸ“ public/             # Static assets (favicon, etc.)
    β”œβ”€ .env.*                 # Environment variable template
    β”œβ”€ next.config.ts         # Next.js configuration
    β”œβ”€ sanity.config.ts       # Sanity Studio configuration
    β”œβ”€ sanity.cli.ts          # Sanity CLI configuration
    └─ package.json

    Stop Scaffolding. Start Shipping.

    Clone SanityPress and have your first page live today.