---
title: "Setting Up Multiple Collections"
description: "Learn how to configure and manage multiple independent documentation systems"
---

Multiple collections allow you to run different documentation systems from one codebase. Each collection is completely independent with its own folder, routes, and navigation.

## Why Multiple Collections?

You might need multiple collections for:

- User documentation + API reference
- Documentation for different products
- Different versions of documentation
- Multiple audience types (beginners vs. advanced)
- Separate internal and public docs

## Basic Setup

### Step 1: Register Collections

In `data/config.ts`, add to `CONTENT.systems`:

```typescript
export const CONTENT: ContentConfig = {
    systems: [
        {
            id: "docs",
            dir: "content/docs",
            defaultDocRedirect: "/docs/introduction",
            route: "/docs",
        },
        {
            id: "api",
            dir: "content/api",
            defaultDocRedirect: "/api/overview",
            route: "/api",
        },
        {
            id: "guides",
            dir: "content/guides",
            defaultDocRedirect: "/guides/getting-started",
            route: "/guides",
        },
    ],
};
```

### Step 2: Create Content Folders

```bash
mkdir -p content/docs
mkdir -p content/api
mkdir -p content/guides
```

### Step 3: Configure Navigation

Each collection needs its own navigation in `SIDEBAR_NAVIGATION`:

```typescript
export const SIDEBAR_NAVIGATION = {
    docs: {
        defaultTab: { label: "Docs", icon: "�" },
        groups: [
            /* docs navigation */
        ],
    },
    api: {
        defaultTab: { label: "API", icon: "" },
        groups: [
            /* api navigation */
        ],
    },
    guides: {
        defaultTab: { label: "Guides", icon: "" },
        groups: [
            /* guides navigation */
        ],
    },
};
```

### Step 4: Add Content

Create markdown files in each collection folder. They'll automatically be discoverable and routed correctly.

## Three-Collection Example

A typical multi-collection setup:

```
docs/                    -> /docs/*
��� getting-started/
��� features/
���� help/

api/                     -> /api/*
��� v1/
��� v2/
���� authentication/

guides/                  -> /guides/*
��� tutorials/
��� patterns/
���� examples/
```

Each collection appears at its own route and has independent navigation.

## Collections with Different Configurations

Each collection can have completely different structures:

**Collection 1 (docs):** Simple auto-generated structure

```typescript
docs: {
    defaultTab: { label: "Learn" },
    groups: [
        { id: "guides", label: "Guides", autoGenerated: true }
    ],
}
```

**Collection 2 (api):** Complex with tabs and nesting

```typescript
api: {
    defaultTab: { label: "v2" },
    groups: [
        {
            id: "v2",
            label: "v2 Current",
            tab: true,
            groups: [
                { id: "endpoints", label: "Endpoints", autoGenerated: true },
                { id: "auth", label: "Auth", autoGenerated: true },
            ],
        },
    ],
}
```

## URL Structure

With this setup, URLs map automatically:

```
File: content/docs/getting-started/intro.md
URL: /docs/getting-started/intro

File: content/api/v2/endpoints/users.md
URL: /api/v2/endpoints/users

File: content/guides/tutorials/first-app.md
URL: /guides/tutorials/first-app
```

## Next Steps

Learn about:

- [Independent Navigation](/docs/advanced-topics/multiple-collections/independent-navigation)
- [Multi-Collection Use Cases](/docs/advanced-topics/multiple-collections/use-cases)
