---
title: "File Structure"
description: "An overview of the directories and files of the SanityPress starter template."
---

# 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
│ ├─ modules/          # Colocated modules (schema + UI + optional GROQ + thumbnail)
│ │ ├─ accordion-list/ # e.g. index.tsx, schema.ts, query.ts?, thumbnail.webp
│ │ └─ ...             # One folder per Sanity module `_type`
│ ├─ ui/               # React components
│ │ ├─ modules/        # ModulesResolver + <Module> wrapper
│ │ ├─ blog/           # Shared blog UI helpers (filters, previews, etc.)
│ │ ├─ 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…)
│ │ │ ├─ objects/      # Reusable field groups (cta, link, metadata…)
│ │ │ └─ fragments/    # Shared helpers (define-module, modules field)
│ │ ├─ lib/            # Queries, GROQ fragments, 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, module-thumbnails, 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
```
