feat: initialize lux docs site with fumadocs

- Fumadocs-based documentation site
- Uses @luxfi/brand for styling
- Pure black/white minimalist theme
This commit is contained in:
2025-12-14 21:27:13 -08:00
commit af5f04a630
17 changed files with 4555 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
# Dependencies
node_modules/
.pnpm-store/
# Build outputs
.next/
out/
dist/
.source/
# Environment
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
# IDE
.vscode/
.idea/
*.swp
*.swo
# OS
.DS_Store
Thumbs.db
# Debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# TypeScript
*.tsbuildinfo
next-env.d.ts
+56
View File
@@ -0,0 +1,56 @@
# Lux Network Documentation
Official documentation for Lux Network - Post-quantum secure blockchain infrastructure.
Built with [Fumadocs](https://fumadocs.dev) and the Hanzo Docs framework.
## Getting Started
```bash
# Install dependencies
pnpm install
# Start development server
pnpm dev
# Build for production
pnpm build
```
## Documentation Structure
```
content/
└── docs/
├── index.mdx # Welcome page
├── learn/ # Learning resources
│ ├── introduction/ # Introduction to Lux
│ ├── architecture/ # Architecture deep-dive
│ └── consensus/ # Consensus mechanisms
├── build/ # Developer guides
│ ├── quickstart/ # Quick start guide
│ ├── sdk/ # SDK documentation
│ └── contracts/ # Smart contract development
├── nodes/ # Node operation
│ ├── run/ # Running a node
│ ├── validators/ # Validator setup
│ └── staking/ # Staking guide
└── reference/ # API reference
├── api/ # REST/RPC API
└── cli/ # CLI reference
```
## Contributing
1. Fork the repository
2. Create your feature branch
3. Add or modify documentation in `content/docs/`
4. Submit a pull request
## License
MIT © Lux Network
---
Part of the Hanzo Docs ecosystem.
+60
View File
@@ -0,0 +1,60 @@
import { source } from '@/lib/source';
import {
DocsPage,
DocsBody,
} from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import { Callout } from 'fumadocs-ui/components/callout';
import { TypeTable } from 'fumadocs-ui/components/type-table';
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion';
export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
const { body: Mdx, toc } = await page.data.load();
return (
<DocsPage toc={toc}>
<h1 className="text-2xl font-bold mb-4">{page.data.title}</h1>
{page.data.description && (
<p className="text-fd-muted-foreground mb-6">{page.data.description}</p>
)}
<DocsBody>
<Mdx
components={{
...defaultMdxComponents,
Tab,
Tabs,
Callout,
TypeTable,
Accordion,
Accordions,
}}
/>
</DocsBody>
</DocsPage>
);
}
export async function generateStaticParams() {
return source.generateParams();
}
export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();
return {
title: page.data.title,
description: page.data.description,
};
}
+37
View File
@@ -0,0 +1,37 @@
import type { ReactNode } from 'react';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { source } from '@/lib/source';
export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout
tree={source.pageTree}
nav={{
title: (
<>
<LuxIcon className="size-5" />
<span className="font-medium">Lux Docs</span>
</>
),
}}
sidebar={{
defaultOpenLevel: 1,
}}
>
{children}
</DocsLayout>
);
}
function LuxIcon({ className }: { className?: string }) {
return (
<svg
className={className}
viewBox="0 0 24 24"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
</svg>
);
}
+16
View File
@@ -0,0 +1,16 @@
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
@import '@luxfi/brand/styles/docs.css';
@theme inline {
--default-mono-font-family: var(--font-mono);
}
html {
scrollbar-gutter: stable;
}
body {
background-color: var(--color-fd-background);
}
+54
View File
@@ -0,0 +1,54 @@
import './global.css';
import type { Viewport, Metadata } from 'next';
import type { ReactNode } from 'react';
import { Geist, Geist_Mono } from 'next/font/google';
import { RootProvider } from 'fumadocs-ui/provider/next';
export const metadata: Metadata = {
title: {
template: '%s | Lux Docs',
default: 'Lux Docs',
},
description: 'Documentation for Lux Network - Post-quantum secure blockchain infrastructure.',
openGraph: {
title: 'Lux Docs',
description: 'Documentation for Lux Network - Post-quantum secure blockchain infrastructure.',
url: 'https://docs.lux.network',
siteName: 'Lux Docs',
},
twitter: {
card: 'summary_large_image',
creator: '@luxnetwork',
},
};
const geist = Geist({
variable: '--font-sans',
subsets: ['latin'],
});
const mono = Geist_Mono({
variable: '--font-mono',
subsets: ['latin'],
});
export const viewport: Viewport = {
themeColor: [
{ media: '(prefers-color-scheme: dark)', color: '#0A0A0A' },
{ media: '(prefers-color-scheme: light)', color: '#fff' },
],
};
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html
lang="en"
className={`${geist.variable} ${mono.variable} brand-lux`}
suppressHydrationWarning
>
<body className="flex flex-col min-h-screen">
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}
+59
View File
@@ -0,0 +1,59 @@
import Link from 'next/link';
export default function HomePage() {
return (
<main className="flex flex-1 flex-col items-center justify-center text-center px-4">
<div className="max-w-3xl space-y-8">
<div className="space-y-4">
<h1 className="text-4xl font-bold tracking-tight sm:text-6xl">
Lux Network
</h1>
<p className="text-xl text-fd-muted-foreground">
Post-quantum secure, multi-consensus blockchain infrastructure
</p>
</div>
<p className="text-lg text-fd-muted-foreground max-w-2xl mx-auto">
Build scalable, secure applications on Lux Network with our comprehensive
documentation, SDKs, and developer tools.
</p>
<div className="flex flex-wrap justify-center gap-4">
<Link
href="/docs"
className="inline-flex items-center justify-center rounded-md bg-fd-primary text-fd-primary-foreground px-6 py-3 text-sm font-medium shadow transition-colors hover:bg-fd-primary/90"
>
Get Started
</Link>
<Link
href="https://github.com/luxfi"
className="inline-flex items-center justify-center rounded-md border border-fd-border bg-fd-background px-6 py-3 text-sm font-medium shadow-sm transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground"
>
View on GitHub
</Link>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 pt-8">
<div className="p-6 rounded-lg border border-fd-border bg-fd-card">
<h3 className="font-semibold mb-2">Learn</h3>
<p className="text-sm text-fd-muted-foreground">
Understand Lux Network architecture, consensus, and post-quantum security.
</p>
</div>
<div className="p-6 rounded-lg border border-fd-border bg-fd-card">
<h3 className="font-semibold mb-2">Build</h3>
<p className="text-sm text-fd-muted-foreground">
Deploy smart contracts and build dApps with our SDKs and tools.
</p>
</div>
<div className="p-6 rounded-lg border border-fd-border bg-fd-card">
<h3 className="font-semibold mb-2">Run</h3>
<p className="text-sm text-fd-muted-foreground">
Operate validators, run nodes, and participate in the network.
</p>
</div>
</div>
</div>
</main>
);
}
+54
View File
@@ -0,0 +1,54 @@
---
title: Welcome to Lux Docs
description: Documentation for Lux Network - Post-quantum secure blockchain infrastructure
---
# Welcome to Lux Network
Lux Network is a post-quantum secure, multi-consensus blockchain platform designed for the future of decentralized applications.
## Key Features
- **Post-Quantum Security**: Built with post-quantum cryptographic primitives
- **Multi-Consensus**: Support for multiple consensus mechanisms
- **High Performance**: Scalable architecture for enterprise applications
- **EVM Compatible**: Full Ethereum compatibility for easy migration
## Quick Links
<Cards>
<Card title="Learn" href="/docs/learn">
Understand Lux Network architecture and concepts
</Card>
<Card title="Build" href="/docs/build">
Start building applications on Lux
</Card>
<Card title="Run a Node" href="/docs/nodes">
Operate a node or become a validator
</Card>
<Card title="API Reference" href="/docs/reference">
Complete API and CLI documentation
</Card>
</Cards>
## Getting Started
```bash
# Install the Lux CLI
npm install -g @lux/cli
# Initialize a new project
lux init my-project
# Start development
cd my-project && lux dev
```
## Community
Join our community to get help and stay updated:
- [GitHub](https://github.com/luxfi) - Source code and issues
- [Discord](https://discord.gg/lux) - Real-time chat
- [Twitter](https://twitter.com/luxnetwork) - Announcements
- [Forum](https://forum.lux.network) - Discussions
+15
View File
@@ -0,0 +1,15 @@
{
"title": "Documentation",
"pages": [
"---Getting Started---",
"index",
"---Learn---",
"learn/...",
"---Build---",
"build/...",
"---Run Nodes---",
"nodes/...",
"---Reference---",
"reference/..."
]
}
+7
View File
@@ -0,0 +1,7 @@
import { docs } from '@/.source';
import { loader } from 'fumadocs-core/source';
export const source = loader({
baseUrl: '/docs',
source: docs.toFumadocsSource(),
});
+9
View File
@@ -0,0 +1,9 @@
import defaultComponents from 'fumadocs-ui/mdx';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function useMDXComponents(components: Record<string, any>): Record<string, any> {
return {
...defaultComponents,
...components,
};
}
+10
View File
@@ -0,0 +1,10 @@
import { createMDX } from 'fumadocs-mdx/next';
import type { NextConfig } from 'next';
const config: NextConfig = {
reactStrictMode: true,
};
const withMDX = createMDX();
export default withMDX(config);
+38
View File
@@ -0,0 +1,38 @@
{
"name": "lux-docs",
"version": "0.1.0",
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"lint": "fumadocs-mdx && next lint",
"start": "next start",
"types:check": "fumadocs-mdx && tsc --noEmit"
},
"dependencies": {
"@luxfi/brand": "file:../brand",
"@fumadocs/mdx-remote": "^1.2.0",
"fumadocs-core": "^15.0.0",
"fumadocs-mdx": "^12.0.0",
"fumadocs-ui": "^16.0.0",
"lucide-react": "^0.561.0",
"next": "16.0.10",
"next-themes": "^0.4.6",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"tailwind-merge": "^3.4.0",
"zod": "^4.1.13"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.18",
"@types/node": "^24.10.2",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3",
"postcss": "^8.5.6",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3"
},
"browserslist": [
"extends browserslist-config-baseline/2024"
]
}
+4034
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -0,0 +1,5 @@
export default {
plugins: {
'@tailwindcss/postcss': {},
},
};
+24
View File
@@ -0,0 +1,24 @@
import { defineConfig, defineDocs, frontmatterSchema, metaSchema } from 'fumadocs-mdx/config';
import { z } from 'zod';
export const docs = defineDocs({
docs: {
schema: frontmatterSchema.extend({
preview: z.string().optional(),
index: z.boolean().default(false),
}),
async: true,
},
meta: {
schema: metaSchema.extend({
description: z.string().optional(),
}),
},
});
export default defineConfig({
mdxOptions: {
remarkPlugins: [],
rehypePlugins: [],
},
});
+42
View File
@@ -0,0 +1,42 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"paths": {
"@/*": [
"./*"
]
}
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".source/**/*.ts",
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}