This is what an AI/RAG pipeline sees when it indexes this page — the same output served at https://camelmind-docs.vercel.app/api/llms/getting-started/project-structure.Back to doc

Rendered doc

Project Structure

A tour of the folders and files in a CamelMind site — what each one does and which ones you'll actually edit.

Every CamelMind project follows the same directory structure. Most of your work will happen in certain folders, while the rest powers the framework behind the scenes.

This guide explains what each folder is for and when you'll need to edit it.

text
my-docs/
ā”œā”€ā”€ app/                      # Next.js routes and rendering
ā”œā”€ā”€ components/               # UI and MDX components
ā”œā”€ā”€ content/                  # Documentation pages
ā”œā”€ā”€ lib/                      # Internal utilities
ā”œā”€ā”€ nav/
│   └── nav.yml               # Sidebar navigation
ā”œā”€ā”€ public/                   # Images and downloads
ā”œā”€ā”€ scripts/                  # Build utilities
ā”œā”€ā”€ camelmind.config.ts       # Site configuration
ā”œā”€ā”€ versions.yml              # Documentation versions
ā”œā”€ā”€ next.config.ts            # Next.js configuration
ā”œā”€ā”€ .env.example              # Configuration template; duplicate to .env.local before running
ā”œā”€ā”€ package.json
└── tsconfig.json
Tip

Most documentation work only involves these folders:

Want to...Edit
Write documentationcontent/
Organize the sidebarnav/nav.yml
Add images or assetspublic/
Change the site titlecamelmind.config.ts

CamelMind content directory structure

The CamelMind content/ directory stores every MDX documentation page for your site structure and authoring workflow.

text
content/
ā”œā”€ā”€ getting-started/
│   └── overview.mdx
ā”œā”€ā”€ guides/
│   └── writing-docs.mdx
└── reference/
    └── configuration.mdx

Unlike other documentation frameworks, CamelMind does not derive URLs from your folder structure. Define your URLs directly in nav.yml to take complete control over your site's navigation.


The nav/nav.yml file

nav.yml serves as the single source of truth for your sidebar menu and page URLs. Every entry maps a slug (the public URL) to a file (the MDX source):

yaml
nav:
  - label: "Getting Started"
    dropdown: false
    noDropdown: true
    items:
      - label: "Project Structure"
        slug: /getting-started/project-structure
        file: content/getting-started/project-structure.mdx
        roles: []

Register every content/ page here to make it reachable; you can also assign a page to multiple slugs using distinct labels or roles. See Configure Navigation reference for every field.


CamelMind versions.yml file configuration

The CamelMind versions.yml configuration file defines all published documentation versions and multi-version site settings.

yaml
versions:
  - id: "latest"
    label: "Latest"
    stable: true
    nav: nav/nav.yml

A fresh scaffold ships with a single latest version. Add entries here when you're ready to publish multiple versions side by side.


CamelMind primary configuration file camelmind.config.ts

The camelmind.config.ts file acts as the primary configuration blueprint for CamelMind site settings, authentication options, and global properties.

typescript
const config: CamelMindConfig = {
  title: "My Docs",
  tagline: "Documentation made simple.",
  url: process.env.CAMELMIND_URL ?? "http://localhost:3000",

  contentDir: "content",
  navFile: "nav/nav.yml",
  versionsFile: "versions.yml",

  auth: { enabled: false, requireLogin: false, provider: "dev-mock", /* ... */ },
  links: { github: "https://github.com/you/your-repo" },
  ai: { llmsTxt: { enabled: false, directive: "" } },
}

CamelMind reads most secrets and environment-specific values (auth toggles, the site URL) from environment variables in .env.example / .env.local rather than hardcoding them here.


The CamelMind app/ application directory

The app/ directory contains the Next.js application routes and logic that power your CamelMind documentation site.

PathPurpose
app/[...slug]/page.tsxThe catch-all route that renders every doc page — resolves the slug against nav.yml, loads the MDX file, and applies auth checks
app/api-reference/Route for the OpenAPI-powered API reference
app/api/auth/Login, logout, and OIDC callback route handlers
app/api/search/Full-text search endpoint
app/api/llms/, app/llms.txt/AI-readable documentation output (/llms.txt and /api/llms)
app/home/page.tsxThe homepage
app/layout.tsxRoot layout — theming, fonts, global providers
app/globals.cssGlobal styles (Tailwind)
Warning

Customizing files in app/ is an advanced use case. Changes here can be overwritten or need manual reconciliation when you run camelmind update — see Update CamelMind for the --ignore-file flag if you need to protect a customized file.


CamelMind components directory and React UI modules

The components/ directory contains all React UI components, layout elements, and custom MDX widgets used throughout your CamelMind site.

  • Site chrome — Nav/, Sidebar/, Toc/, Breadcrumbs/, PageNav/, Search/, SectionCards/, ApiReference/, and similar folders render the surrounding site UI (top nav, sidebar, table of contents, search modal).
  • components/mdx/ — the components available directly inside your .mdx content: Callout, Steps, Tabs, Details, Icon, LLMOnly, and LLMIgnore.

See Use MDX Components for how to use each one in your content.


The CamelMind lib/ utility directory

The lib/ directory contains core TypeScript modules responsible for parsing content and navigation in CamelMind.

FileResponsibility
lib/mdx.tsReads an MDX file, parses frontmatter, extracts the table of contents
lib/nav.ts, lib/nav-types.tsParses nav.yml, resolves slugs to entries, builds breadcrumbs
lib/versions.tsResolves which version's nav applies to a given URL
lib/config.ts, lib/config-types.tsLoads and types camelmind.config.ts
lib/auth.ts, lib/auth-roles.ts, lib/auth-providers/Session handling and role-based access control
lib/api-reference.ts, lib/api-types.ts, lib/api-utils.tsOpenAPI spec parsing for the API reference

CamelMind scripts/ build and export utilities

The scripts/ directory houses standalone automation scripts for generating offline release artifacts in CamelMind.

ScriptPurpose
scripts/build-offline.shBuilds a static, ZIP-packaged offline version of the site
scripts/build-search-index.tsPre-generates the search index used by offline builds
scripts/generate-pdfs.ts, scripts/generate-master-pdf.tsGenerate per-page and combined PDF exports
scripts/build-pdf.shWraps the PDF generation scripts into a single build step

See Offline Package and PDF Export for how these fit into a release workflow.


CamelMind root configuration files

The following table outlines the purpose of each root configuration file in your CamelMind project:

FilePurpose
package.jsonProject dependencies and CLI script runners (dev, build, start, lint).
next.config.tsNext.js compilation options, security headers, and static export toggles.
tsconfig.jsonGlobal TypeScript compiler settings.
eslint.config.mjsProject code quality and linting rules.
.env.exampleLocal environment configuration blueprint. Duplicate to .env.local to start.
vercel.jsonOptimized deployment configurations specific to Vercel.
Note

After running camelmind update, you may see a .camelmind-update-backup/ folder appear — it holds a timestamped copy of any files the updater overwrote. It's safe to delete once you've confirmed the update looks correct.


Explore these resources to continue building and customizing your CamelMind documentation site.

GoalWhere to go
Write and organize pagesWriting Content
Use Callout, Steps, Tabs, and moreMDX Components
Change the sidebar and URLsConfigure Navigation
Publish multiple doc versionsConfigure Multiple Documentation Sites
Gate pages by user roleAuth and RBAC

What the AI sees

1> For a complete documentation index, see /llms.txt. To read any public page as Markdown, append .md to the URL.
2Ā 
3Every CamelMind project follows the same directory structure. Most of your work will happen in certain folders, while the rest powers the framework behind the scenes.
4Ā 
5This guide explains what each folder is for and when you'll need to edit it.
6Ā 
7```text
8my-docs/
9ā”œā”€ā”€ app/ # Next.js routes and rendering
10ā”œā”€ā”€ components/ # UI and MDX components
11ā”œā”€ā”€ content/ # Documentation pages
12ā”œā”€ā”€ lib/ # Internal utilities
13ā”œā”€ā”€ nav/
14│ └── nav.yml # Sidebar navigation
15ā”œā”€ā”€ public/ # Images and downloads
16ā”œā”€ā”€ scripts/ # Build utilities
17ā”œā”€ā”€ camelmind.config.ts # Site configuration
18ā”œā”€ā”€ versions.yml # Documentation versions
19ā”œā”€ā”€ next.config.ts # Next.js configuration
20ā”œā”€ā”€ .env.example # Configuration template; duplicate to .env.local before running
21ā”œā”€ā”€ package.json
22└── tsconfig.json
23```
24Ā 
25<Callout type="tip">
26Ā 
27Most documentation work only involves these folders:
28Ā 
29| Want to... | Edit |
30|------------|------|
31| Write documentation | `content/` |
32| Organize the sidebar | `nav/nav.yml` |
33| Add images or assets | `public/` |
34| Change the site title | `camelmind.config.ts` |
35Ā 
36</Callout>
37Ā 
38---
39Ā 
40## CamelMind content directory structure
41Ā 
42The CamelMind `content/` directory stores every MDX documentation page for your site structure and authoring workflow.
43Ā 
44```text
45content/
46ā”œā”€ā”€ getting-started/
47│ └── overview.mdx
48ā”œā”€ā”€ guides/
49│ └── writing-docs.mdx
50└── reference/
51 └── configuration.mdx
52```
53Ā 
54Unlike other documentation frameworks, CamelMind does not derive URLs from your folder structure. Define your URLs directly in `nav.yml` to take complete control over your site's navigation.
55Ā 
56---
57Ā 
58## The nav/nav.yml file
59Ā 
60`nav.yml` serves as the single source of truth for your sidebar menu and page URLs. Every entry maps a `slug` (the public URL) to a `file` (the MDX source):
61Ā 
62```yaml
63nav:
64 - label: "Getting Started"
65 dropdown: false
66 noDropdown: true
67 items:
68 - label: "Project Structure"
69 slug: /getting-started/project-structure
70 file: content/getting-started/project-structure.mdx
71 roles: []
72```
73Ā 
74Register every `content/` page here to make it reachable; you can also assign a page to multiple slugs using distinct labels or roles. See [Configure Navigation](/getting-started/navigation) reference for every field.
75Ā 
76---
77Ā 
78## CamelMind versions.yml file configuration
79Ā 
80The CamelMind `versions.yml` configuration file defines all published documentation versions and multi-version site settings.
81Ā 
82```yaml
83versions:
84 - id: "latest"
85 label: "Latest"
86 stable: true
87 nav: nav/nav.yml
88```
89Ā 
90A fresh scaffold ships with a single `latest` version. Add entries here when you're ready to publish multiple versions side by side.
91Ā 
92---
93Ā 
94## CamelMind primary configuration file camelmind.config.ts
95Ā 
96The `camelmind.config.ts` file acts as the primary configuration blueprint for CamelMind site settings, authentication options, and global properties.
97Ā 
98```typescript
99const config: CamelMindConfig = {
100 title: "My Docs",
101 tagline: "Documentation made simple.",
102 url: process.env.CAMELMIND_URL ?? "http://localhost:3000",
103Ā 
104 contentDir: "content",
105 navFile: "nav/nav.yml",
106 versionsFile: "versions.yml",
107Ā 
108 auth: { enabled: false, requireLogin: false, provider: "dev-mock", /* ... */ },
109 links: { github: "https://github.com/you/your-repo" },
110 ai: { llmsTxt: { enabled: false, directive: "" } },
111}
112```
113Ā 
114CamelMind reads most secrets and environment-specific values (auth toggles, the site URL) from environment variables in `.env.example` / `.env.local` rather than hardcoding them here.
115Ā 
116---
117Ā 
118## The CamelMind app/ application directory
119Ā 
120The `app/` directory contains the Next.js application routes and logic that power your CamelMind documentation site.
121Ā 
122| Path | Purpose |
123|---|---|
124| `app/[...slug]/page.tsx` | The catch-all route that renders every doc page — resolves the slug against `nav.yml`, loads the MDX file, and applies auth checks |
125| `app/api-reference/` | Route for the OpenAPI-powered API reference |
126| `app/api/auth/` | Login, logout, and OIDC callback route handlers |
127| `app/api/search/` | Full-text search endpoint |
128| `app/api/llms/`, `app/llms.txt/` | AI-readable documentation output (`/llms.txt` and `/api/llms`) |
129| `app/home/page.tsx` | The homepage |
130| `app/layout.tsx` | Root layout — theming, fonts, global providers |
131| `app/globals.css` | Global styles (Tailwind) |
132Ā 
133<Callout type="warning">
134Customizing files in `app/` is an advanced use case. Changes here can be overwritten or need manual reconciliation when you run `camelmind update` — see [Update CamelMind](/getting-started/installation#update-camelmind) for the `--ignore-file` flag if you need to protect a customized file.
135</Callout>
136Ā 
137---
138Ā 
139## CamelMind components directory and React UI modules
140Ā 
141The `components/` directory contains all React UI components, layout elements, and custom MDX widgets used throughout your CamelMind site.
142Ā 
143- **Site chrome** — `Nav/`, `Sidebar/`, `Toc/`, `Breadcrumbs/`, `PageNav/`, `Search/`, `SectionCards/`, `ApiReference/`, and similar folders render the surrounding site UI (top nav, sidebar, table of contents, search modal).
144- **`components/mdx/`** — the components available directly inside your `.mdx` content: `Callout`, `Steps`, `Tabs`, `Details`, `Icon`, `LLMOnly`, and `LLMIgnore`.
145Ā 
146See [Use MDX Components](/getting-started/mdx-components) for how to use each one in your content.
147Ā 
148---
149Ā 
150## The CamelMind lib/ utility directory
151Ā 
152The `lib/` directory contains core TypeScript modules responsible for parsing content and navigation in CamelMind.
153Ā 
154| File | Responsibility |
155|---|---|
156| `lib/mdx.ts` | Reads an MDX file, parses frontmatter, extracts the table of contents |
157| `lib/nav.ts`, `lib/nav-types.ts` | Parses `nav.yml`, resolves slugs to entries, builds breadcrumbs |
158| `lib/versions.ts` | Resolves which version's nav applies to a given URL |
159| `lib/config.ts`, `lib/config-types.ts` | Loads and types `camelmind.config.ts` |
160| `lib/auth.ts`, `lib/auth-roles.ts`, `lib/auth-providers/` | Session handling and role-based access control |
161| `lib/api-reference.ts`, `lib/api-types.ts`, `lib/api-utils.ts` | OpenAPI spec parsing for the API reference |
162Ā 
163---
164Ā 
165## CamelMind scripts/ build and export utilities
166Ā 
167The `scripts/` directory houses standalone automation scripts for generating offline release artifacts in CamelMind.
168Ā 
169| Script | Purpose |
170|---|---|
171| `scripts/build-offline.sh` | Builds a static, ZIP-packaged offline version of the site |
172| `scripts/build-search-index.ts` | Pre-generates the search index used by offline builds |
173| `scripts/generate-pdfs.ts`, `scripts/generate-master-pdf.ts` | Generate per-page and combined PDF exports |
174| `scripts/build-pdf.sh` | Wraps the PDF generation scripts into a single build step |
175Ā 
176See [Offline Package and PDF Export](/features/offline-package-and-pdf-export) for how these fit into a release workflow.
177Ā 
178---
179Ā 
180## CamelMind root configuration files
181Ā 
182The following table outlines the purpose of each root configuration file in your CamelMind project:
183Ā 
184| File | Purpose |
185|---|---|
186| `package.json` | Project dependencies and CLI script runners (`dev`, `build`, `start`, `lint`). |
187| `next.config.ts` | Next.js compilation options, security headers, and static export toggles. |
188| `tsconfig.json` | Global TypeScript compiler settings. |
189| `eslint.config.mjs` | Project code quality and linting rules. |
190| `.env.example` | Local environment configuration blueprint. Duplicate to `.env.local` to start. |
191| `vercel.json` | Optimized deployment configurations specific to Vercel. |
192Ā 
193<Callout type="note">
194After running `camelmind update`, you may see a `.camelmind-update-backup/` folder appear — it holds a timestamped copy of any files the updater overwrote. It's safe to delete once you've confirmed the update looks correct.
195</Callout>
196Ā 
197---
198Ā 
199## CamelMind next steps and related resources
200Ā 
201Explore these resources to continue building and customizing your CamelMind documentation site.
202Ā 
203| Goal | Where to go |
204|---|---|
205| Write and organize pages | [Writing Content](/getting-started/writing-content) |
206| Use Callout, Steps, Tabs, and more | [MDX Components](/getting-started/mdx-components) |
207| Change the sidebar and URLs | [Configure Navigation](/getting-started/navigation) |
208| Publish multiple doc versions | [Configure Multiple Documentation Sites](/getting-started/multiple-doc-sites) |
209| Gate pages by user role | [Auth and RBAC](/features/auth-rbac) |

Issues (0)

No AI-friendliness issues found.