Documentation
Overview of the documentation system built with Fumadocs.
Optional Feature
Documentation is not included by default to keep the core lean. Install it if you need documentation for your saas.
Documentation Overview
StarterKitPro's documentation is powered by Fumadocs, a modern documentation framework built for Next.js.
Key Features:
- MDX Support: Write documentation using Markdown with embedded React components for rich content.
- Shadcn UI & Tailwind CSS: Beautiful and customizable design out-of-the-box, leveraging popular styling solutions.
- React Server Components: Optimized for performance, delivering fast load times with minimal client-side JavaScript.
- Optimized Images: Automatic image optimization for better performance.
- SEO Optimized: Handles metadata and SSG for improved search engine visibility and rich results.
- App Router Compatibility: Seamlessly integrates with the Next.js App Router.
- Flexible Layout Integration: Works with existing layouts or can be used independently. You can use your own header/footer, though integrating with the default layout is generally recommended for consistency.
- Full-Text Search: Built-in search functionality to help users find information quickly.
- Custom React Components: Import and render your own Next.js components directly within .mdx files just like you would in any other part of your application.
- Direct HTML: You can write standard HTML tags directly within your MDX content if needed.
Setup
It's very easy to setup because we already have whole setup for blog in deafult starterkitpro. Now just copy and past files for documentation. Let's set up Documentation step by step:
1. Configure Source Files
Update your configuration and source helper files:
source.config.ts
lib/source.ts
Add the following configuration to load your documentation source:
Potential Errors
May be you face error during copy and paste just ignore them as for now it will be soved at the end
2. Create Layout and Page Files
Let's now create this structure for docs:
app/docs/layout.tsx
Create this file and paste this content. In this file now you can uncomment and comment the specific values and can see their effect.
Info
If you use the nav with component and pass custom header. Then you need to override --fd-nav-height to the exact height of your custom navbar, this can be done with a CSS stylesheet (e.g. in global.css)
app/docs/[[...slug]]/page.tsx
3. Add Search
Create the file app/api/docs/search/route.ts
4. Add Docs to sitemap
4. Add Example Content
In app/docs/_content/
here we write the docs in .mdx
files.
app/docs/_content/index.mdx
app/docs/_content/setup/installation.mdx
5. Final Installation
Now after all this run:
With this all the typescript errors will disapper.
6. Static Assets (Images)
And if use images you can place in:
public/docs/
6. Further Customization
And for more customization you can visit: https://fumadocs.vercel.app/docs
And specifically need help in side bar routing and folders check this: https://fumadocs.vercel.app/docs/ui/page-conventions