File Structure

  • πŸ“‚ sanitypress/
    β”œβ”€β”€ public/                        # Static assets (favicon, etc.)
    β”œβ”€β”€ 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
    β”‚   β”‚   β”‚       └── revalidate/    # ISR revalidation
    β”‚   β”‚   β”œβ”€β”€ (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
    β”‚   β”‚   β”‚   β”œβ”€β”€ search/            # Search form + results
    β”‚   β”‚   β”‚   └── custom-html/       # Custom HTML/CSS/JS injection
    β”‚   β”‚   β”œβ”€β”€ header/                # Header, navigation, megamenu
    β”‚   β”‚   β”œβ”€β”€ footer/                # Footer and link list
    β”‚   β”‚   β”œβ”€β”€ table-of-contents/     # Auto-generated TOC for long pages
    β”‚   β”‚   └── ...                    # 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
    β”‚   β”‚   β”œβ”€β”€ structure.ts           # Studio sidebar layout
    β”‚   β”‚   └── types.ts               # Auto-generated TypeScript types (via TypeGen)
    β”‚   β”œβ”€β”€ lib/                       # Shared app utilities and env helpers
    β”‚   β”œβ”€β”€ hooks/                     # Custom React hooks
    β”‚   └── types/                     # Global TypeScript declarations
    β”œβ”€β”€ .env.example                   # Environment variable template
    β”œβ”€β”€ next.config.ts                 # Next.js configuration
    β”œβ”€β”€ sanity.config.ts               # Sanity Studio configuration
    β”œβ”€β”€ sanity.cli.ts                  # Sanity CLI configuration
    └── package.json

    Build with confidence

    SanityPress gives you a modern, scalable starting point that stays out of your way.