Skip to content

Commit d376d50

Browse files
committed
feat: add fumadocs documentation app
1 parent 8c4f31b commit d376d50

File tree

24 files changed

+915
-15
lines changed

24 files changed

+915
-15
lines changed

apps/fumadocs/.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# deps
2+
/node_modules
3+
4+
# generated content
5+
.source
6+
7+
# test & build
8+
/coverage
9+
/.next/
10+
/out/
11+
/build
12+
*.tsbuildinfo
13+
14+
# misc
15+
.DS_Store
16+
*.pem
17+
/.pnp
18+
.pnp.js
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
# others
24+
.env*.local
25+
.vercel
26+
next-env.d.ts

apps/fumadocs/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# fumadocs
2+
3+
This is a Next.js application generated with
4+
[Create Fumadocs](https://github.com/fuma-nama/fumadocs).
5+
6+
Run development server:
7+
8+
```bash
9+
npm run dev
10+
# or
11+
pnpm dev
12+
# or
13+
yarn dev
14+
```
15+
16+
Open http://localhost:3000 with your browser to see the result.
17+
18+
## Explore
19+
20+
In the project, you can see:
21+
22+
- `lib/source.ts`: Code for content source adapter, [`loader()`](https://fumadocs.dev/docs/headless/source-api) provides the interface to access your content.
23+
- `lib/layout.shared.tsx`: Shared options for layouts, optional but preferred to keep.
24+
25+
| Route | Description |
26+
| ------------------------- | ------------------------------------------------------ |
27+
| `app/(home)` | The route group for your landing page and other pages. |
28+
| `app/docs` | The documentation layout and pages. |
29+
| `app/api/search/route.ts` | The Route Handler for search. |
30+
31+
### Fumadocs MDX
32+
33+
A `source.config.ts` config file has been included, you can customise different options like frontmatter schema.
34+
35+
Read the [Introduction](https://fumadocs.dev/docs/mdx) for further details.
36+
37+
## Learn More
38+
39+
To learn more about Next.js and Fumadocs, take a look at the following
40+
resources:
41+
42+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
43+
features and API.
44+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
45+
- [Fumadocs](https://fumadocs.dev) - learn about Fumadocs
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Hello World
3+
description: Your first document
4+
---
5+
6+
Welcome to the docs! You can start writing documents in `/content/docs`.
7+
8+
## What is Next?
9+
10+
<Cards>
11+
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
12+
<Card title="Learn more about Fumadocs" href="https://fumadocs.dev" />
13+
</Cards>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: Components
3+
description: Components
4+
---
5+
6+
## Code Block
7+
8+
```js
9+
console.log('Hello World');
10+
```
11+
12+
## Cards
13+
14+
<Cards>
15+
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
16+
<Card title="Learn more about Fumadocs" href="https://fumadocs.dev" />
17+
</Cards>

apps/fumadocs/next.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { createMDX } from "fumadocs-mdx/next";
2+
3+
const withMDX = createMDX();
4+
5+
/** @type {import('next').NextConfig} */
6+
const config = {
7+
reactStrictMode: true,
8+
devIndicators: false,
9+
};
10+
11+
export default withMDX(config);

apps/fumadocs/package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "fumadocs",
3+
"version": "0.0.0",
4+
"private": true,
5+
"scripts": {
6+
"build": "next build",
7+
"dev": "next dev --port=3001",
8+
"start": "next start",
9+
"types:check": "fumadocs-mdx && tsc --noEmit",
10+
"postinstall": "fumadocs-mdx"
11+
},
12+
"dependencies": {
13+
"fumadocs-core": "16.1.0",
14+
"fumadocs-mdx": "14.0.3",
15+
"fumadocs-ui": "16.1.0",
16+
"lucide-react": "^0.552.0",
17+
"next": "16.0.1",
18+
"react": "^19.2.0",
19+
"react-dom": "^19.2.0"
20+
},
21+
"devDependencies": {
22+
"@tailwindcss/postcss": "^4.1.16",
23+
"@types/mdx": "^2.0.13",
24+
"@types/node": "^24.10.0",
25+
"@types/react": "^19.2.2",
26+
"@types/react-dom": "^19.2.2",
27+
"postcss": "^8.5.6",
28+
"tailwindcss": "^4.1.16",
29+
"typescript": "^5.9.3"
30+
}
31+
}

apps/fumadocs/postcss.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
plugins: {
3+
"@tailwindcss/postcss": {},
4+
},
5+
};

apps/fumadocs/source.config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {
2+
defineConfig,
3+
defineDocs,
4+
frontmatterSchema,
5+
metaSchema,
6+
} from "fumadocs-mdx/config";
7+
8+
// You can customise Zod schemas for frontmatter and `meta.json` here
9+
// see https://fumadocs.dev/docs/mdx/collections
10+
export const docs = defineDocs({
11+
dir: "content/docs",
12+
docs: {
13+
schema: frontmatterSchema,
14+
postprocess: {
15+
includeProcessedMarkdown: true,
16+
},
17+
},
18+
meta: {
19+
schema: metaSchema,
20+
},
21+
});
22+
23+
export default defineConfig({
24+
mdxOptions: {
25+
// MDX options
26+
},
27+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { HomeLayout } from "fumadocs-ui/layouts/home";
2+
import { baseOptions } from "@/lib/layout.shared";
3+
4+
export default function Layout({ children }: LayoutProps<"/">) {
5+
return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;
6+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Link from "next/link";
2+
3+
export default function HomePage() {
4+
return (
5+
<div className="flex flex-1 flex-col justify-center text-center">
6+
<h1 className="mb-4 font-bold text-2xl">Hello World</h1>
7+
<p>
8+
You can open{" "}
9+
<Link className="font-medium underline" href="/docs">
10+
/docs
11+
</Link>{" "}
12+
and see the documentation.
13+
</p>
14+
</div>
15+
);
16+
}

0 commit comments

Comments
 (0)