Getting Started
Set up Docs Kit locally and start building your documentation site
Choose your preferred method to set up Docs Kit:
Clone the repository using Git:
git clone https://github.com/your-org/docs-kit.git my-docs
cd my-docsThis method is recommended as it maintains git history and makes updates easier.
cd path/to/my-docsgit clone https://github.com/your-username/your-docs.git
cd your-docsNavigate to your project directory and install dependencies:
This will install all required dependencies including Next.js, Chakra UI, and content processing libraries.
Launch the development server:
Your documentation site will be available at http://localhost:3000. The development server includes:
Understanding the project structure:
docs-kit/
├── app/ # Next.js App Router
│ ├── layout.tsx # Root layout with providers
│ ├── page.tsx # Home page (redirects)
│ ├── global.css # Global styles
│ └── [...slug]/ # Dynamic catch-all routes
│ ├── layout.tsx # Docs layout
│ └── page.tsx # Page renderer
│
├── components/ # React components
│ ├── docs-layout.tsx # Main layout wrapper
│ ├── mdx-page.tsx # MDX renderer
│ ├── api-page/ # OpenAPI components
│ ├── navigation/ # Nav, sidebar, search, TOC
│ ├── mdx/ # MDX components
│ ├── openapi/ # Interactive API docs
│ ├── page/ # Page components
│ └── ui/ # UI utilities
│
├── content/ # Content files (MDX)
│ ├── docs/ # Documentation pages
│ ├── api-reference/ # API documentation
│ └── changelog/ # Changelog entries
│
├── lib/ # Utility functions
│ ├── docs.ts # Content loading
│ ├── routes.ts # Navigation routing
│ ├── openapi.ts # OpenAPI utilities
│ ├── search.ts # Search functionality
│ └── code-generator.ts # Code examples
│
├── config/
│ └── docs.config.ts # Site configuration
│
├── public/ # Static assets
│ ├── logo/ # Logo files
│ └── static/
│ └── openapi.json # OpenAPI specification
│
├── types/ # TypeScript types
├── velite.config.ts # Content processing config
├── next.config.mjs # Next.js configuration
├── tsconfig.json # TypeScript config
└── package.json # Dependencies
Before you start, configure your site in config/docs.config.ts:
{
"name": "Your Documentation",
"description": "Your site description",
"logo": {
"light": "/logo/light.svg",
"dark": "/logo/dark.svg"
},
"colorPalette": "teal"
}
After changing configuration, restart the development server to see changes take effect.
When you're ready to deploy, create a production build:
bun run build
This command:
The output is placed in the .next directory.
Preview the production build locally:
bun run start
This starts a production server on http://localhost:3000 to verify everything works correctly.
Create a .env.local file for environment-specific configuration:
# Site URL (used for canonical URLs and SEO)
NEXT_PUBLIC_SITE_URL=https://docs.yoursite.com
# Optional: Analytics
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
Environment variables prefixed with NEXT_PUBLIC_ are exposed to the browser.
Deploy your documentation site to your preferred platform:
Run bun run build to create production build
Deploy to Vercel, Netlify, Cloudflare Pages, or any platform supporting Next.js
Set environment variables in your platform's dashboard
Push to your repository or use platform CLI
The easiest deployment option:
# Install Vercel CLI
bun add -g vercel
# Deploy
vercel
bun run build.nextDocs Kit works on any platform that supports Next.js, including:
If port 3000 is taken, specify a different port:
bun dev -p 3001
Clear cache and reinstall:
rm -rf node_modules .next
bun install
Check that all content files have valid frontmatter:
---
title: "Page Title"
description: "Page description"
published: true
---
Follow the Quick Start guide to create your first page
Set up navigation structure in docs.config.ts
content/ directoryAdjust colors, fonts, and styling to match your brand