Skip to content

Commit 60f0863

Browse files
committed
feat: start Developer Hub app with Fumadocs integration
1 parent 741ed86 commit 60f0863

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3517
-345
lines changed

apps/developer-hub/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.env*.local
2+
.source

apps/developer-hub/.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.next/
2+
coverage/
3+
node_modules/
4+
*.tsbuildinfo
5+
.env*.local
6+
.env
7+
.DS_Store
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Entropy How-To Guide
3+
description: A placeholder docs page
4+
---
5+
6+
# How To
7+
8+
Build secure smart contracts with provably random numbers from Pyth Entropy. Launch NFTs, games, and other unique experiences that your users trust with seamless UX.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Overview
3+
description: A placeholder landing page
4+
icon: CardsThree
5+
full: true
6+
---
7+
8+
# Secure On-Chain Randomness
9+
10+
Build secure smart contracts with provably random numbers from Pyth Entropy. Launch NFTs, games, and other unique experiences that your users trust with seamless UX.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": true,
3+
"title": "Entropy",
4+
"description": "Random numbers for smart contracts",
5+
"icon": "Shuffle",
6+
"pages": ["index", "---Guides---", "how-to-guides"]
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Express Relay How-To Guide
3+
description: A placeholder docs page
4+
---
5+
6+
# How To
7+
8+
Integrate directly with searchers to recapture MEV. Go to market faster. Accelerate your protocol's growth.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Overview
3+
description: A placeholder landing page
4+
icon: CardsThree
5+
full: true
6+
---
7+
8+
# Take Back Control with Express Relay
9+
10+
Integrate directly with searchers to recapture MEV. Go to market faster. Accelerate your protocol's growth.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": true,
3+
"title": "Express Relay",
4+
"description": "Eliminate MEV",
5+
"icon": "Gavel",
6+
"pages": ["index", "---Guides---", "how-to-guides"]
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Lazer How-To Guide
3+
description: A placeholder docs page
4+
---
5+
6+
# How To
7+
8+
Pyth Lazer is a low latency, highly customizable price oracle. It offers a customizable set of price feeds, target chains (EVM or Solana) and channels (real time or fixed rate)
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Overview
3+
description: A placeholder landing page
4+
icon: CardsThree
5+
full: true
6+
---
7+
8+
# Low latency, highly customizable price oracle
9+
10+
Pyth Lazer is a low latency, highly customizable price oracle. It offers a customizable set of price feeds, target chains (EVM or Solana) and channels (real time or fixed rate)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": true,
3+
"title": "Lazer",
4+
"description": "Low latency, highly customizable price oracle",
5+
"icon": "Lightning",
6+
"pages": ["index", "---Guides---", "how-to-guides"]
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pages": ["pyth-core", "lazer", "express-relay", "entropy"]
3+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Pyth Core How-To Guide
3+
description: A placeholder docs page
4+
---
5+
6+
# Heading One
7+
8+
The fastest and most reliable data powering more transactions than any other oracle. Permissionless integration on every blockchain.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Overview
3+
description: A placeholder landing page
4+
icon: CardsThree
5+
full: true
6+
---
7+
8+
# Real-time data from financial institutions
9+
10+
The fastest and most reliable data powering more transactions than any other oracle. Permissionless integration on every blockchain.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"root": true,
3+
"title": "Pyth Core",
4+
"description": "Real-time data from financial institutions",
5+
"icon": "ChartLine",
6+
"pages": ["index", "---Guides---", "how-to-guides"]
7+
}

apps/developer-hub/eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { nextjs as default } from "@cprussin/eslint-config";

apps/developer-hub/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { nextjs as default } from "@cprussin/jest-config/next";

apps/developer-hub/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/developer-hub/next.config.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import createBundleAnalyzer from "@next/bundle-analyzer";
2+
import { createMDX } from "fumadocs-mdx/next";
3+
4+
const withAnalyzer = createBundleAnalyzer({
5+
enabled: process.env.ANALYZE === "true",
6+
});
7+
8+
const config = {
9+
reactStrictMode: true,
10+
turbopack: {
11+
resolveExtensions: [".mdx", ".tsx", ".ts", ".jsx", ".js", ".mjs", ".json"],
12+
rules: {
13+
"*.svg": {
14+
loaders: ["@svgr/webpack"],
15+
as: "*.js",
16+
},
17+
},
18+
},
19+
20+
pageExtensions: ["ts", "tsx", "mdx"],
21+
22+
experimental: {
23+
useCache: true,
24+
},
25+
26+
logging: {
27+
fetches: {
28+
fullUrl: true,
29+
},
30+
},
31+
32+
webpack(config) {
33+
config.module.rules.push({
34+
test: /\.svg$/i,
35+
use: ["@svgr/webpack"],
36+
});
37+
38+
config.resolve.extensionAlias = {
39+
".js": [".js", ".ts", ".tsx"],
40+
};
41+
42+
return config;
43+
},
44+
45+
headers: async () => [
46+
{
47+
source: "/:path*",
48+
headers: [
49+
{
50+
key: "X-XSS-Protection",
51+
value: "1; mode=block",
52+
},
53+
{
54+
key: "Referrer-Policy",
55+
value: "strict-origin-when-cross-origin",
56+
},
57+
{
58+
key: "Strict-Transport-Security",
59+
value: "max-age=2592000",
60+
},
61+
{
62+
key: "X-Content-Type-Options",
63+
value: "nosniff",
64+
},
65+
{
66+
key: "Permissions-Policy",
67+
value:
68+
"vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
69+
},
70+
],
71+
},
72+
],
73+
};
74+
75+
const withMDX = createMDX();
76+
77+
export default withAnalyzer(withMDX(config));

apps/developer-hub/package.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"name": "@pythnetwork/developer-hub",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"engines": {
7+
"node": "22"
8+
},
9+
"scripts": {
10+
"build:vercel": "next build",
11+
"build:analyze": "ANALYZE=true next build",
12+
"fix:format": "prettier --write .",
13+
"fix:lint:eslint": "eslint --fix .",
14+
"fix:lint:stylelint": "stylelint --fix 'src/**/*.scss'",
15+
"pull:env": "[ $CI ] || VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID=prj_TBkf9EyQjQF37gs4Vk0sQKJj97kE vercel env pull",
16+
"start:dev": "next dev --port 3003",
17+
"start:prod": "next start --port 3003",
18+
"test:format": "prettier --check .",
19+
"test:lint:eslint": "eslint . --max-warnings 0",
20+
"test:lint:stylelint": "stylelint 'src/**/*.scss' --max-warnings 0",
21+
"test:types": "tsc"
22+
},
23+
"dependencies": {
24+
"@phosphor-icons/react": "catalog:",
25+
"@pythnetwork/component-library": "workspace:*",
26+
"@react-hookz/web": "catalog:",
27+
"clsx": "catalog:",
28+
"fumadocs-core": "catalog:",
29+
"fumadocs-mdx": "catalog:",
30+
"fumadocs-ui": "catalog:",
31+
"next": "catalog:",
32+
"next-themes": "catalog:",
33+
"nuqs": "catalog:",
34+
"react": "catalog:",
35+
"react-aria": "catalog:",
36+
"react-dom": "catalog:",
37+
"zod": "catalog:",
38+
"zod-validation-error": "catalog:"
39+
},
40+
"devDependencies": {
41+
"@cprussin/eslint-config": "catalog:",
42+
"@cprussin/jest-config": "catalog:",
43+
"@cprussin/prettier-config": "catalog:",
44+
"@cprussin/tsconfig": "catalog:",
45+
"@next/bundle-analyzer": "catalog:",
46+
"@svgr/webpack": "catalog:",
47+
"@tailwindcss/postcss": "catalog:",
48+
"@types/jest": "catalog:",
49+
"@types/mdx": "catalog:",
50+
"@types/node": "catalog:",
51+
"@types/react": "catalog:",
52+
"@types/react-dom": "catalog:",
53+
"autoprefixer": "catalog:",
54+
"eslint": "catalog:",
55+
"jest": "catalog:",
56+
"postcss": "catalog:",
57+
"prettier": "catalog:",
58+
"sass": "catalog:",
59+
"stylelint": "catalog:",
60+
"stylelint-config-standard-scss": "catalog:",
61+
"tailwindcss": "^4.1.6",
62+
"typescript": "catalog:",
63+
"vercel": "catalog:"
64+
}
65+
}

apps/developer-hub/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/developer-hub/prettier.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { base as default } from "@cprussin/prettier-config";
Loading
Loading
3.22 KB
Loading
965 Bytes
Loading
1.42 KB
Loading
14.7 KB
Binary file not shown.

apps/developer-hub/public/favicon.ico

14.7 KB
Binary file not shown.

apps/developer-hub/source.config.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {
2+
defineConfig,
3+
defineDocs,
4+
frontmatterSchema,
5+
metaSchema,
6+
} from "fumadocs-mdx/config";
7+
import { z } from "zod";
8+
9+
export const docs = defineDocs({
10+
docs: {
11+
schema: frontmatterSchema.extend({
12+
index: z.boolean().default(false),
13+
}),
14+
},
15+
meta: {
16+
schema: metaSchema.extend({
17+
description: z.string().optional(),
18+
}),
19+
},
20+
});
21+
22+
export default defineConfig({
23+
mdxOptions: {
24+
// MDX options
25+
},
26+
});
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { DocumentationPage } from "@/src/components/Pages/DocumentationPage";
2+
import { source } from "@/src/source";
3+
import type { Metadata } from "next";
4+
import { notFound } from "next/navigation";
5+
6+
export async function generateStaticParams() {
7+
return source.generateParams();
8+
}
9+
10+
export async function generateMetadata(props: {
11+
params: Promise<{ section: string; slug: string[] }>;
12+
}) {
13+
const params = await props.params;
14+
15+
const page = source.getPage([params.section, ...params.slug]);
16+
17+
if (!page) notFound();
18+
19+
return {
20+
title: page.data.title,
21+
description: page.data.description,
22+
} satisfies Metadata;
23+
}
24+
25+
export default DocumentationPage;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { LandingPage } from "@/src/components/Pages/LandingPage";
2+
import { source } from "@/src/source";
3+
import type { Metadata } from "next";
4+
import { notFound } from "next/navigation";
5+
6+
export async function generateStaticParams() {
7+
return source.generateParams();
8+
}
9+
10+
export async function generateMetadata(props: {
11+
params: Promise<{ section: string }>;
12+
}) {
13+
const params = await props.params;
14+
const page = source.getPage([params.section]);
15+
16+
if (!page) notFound();
17+
18+
return {
19+
title: page.data.title,
20+
description: page.data.description,
21+
} satisfies Metadata;
22+
}
23+
24+
export default LandingPage;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { docsOptions } from "@/src/config/layout.config";
2+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
3+
import type { ReactNode } from "react";
4+
5+
export default function Layout({ children }: { children: ReactNode }) {
6+
return <DocsLayout {...docsOptions}>{children}</DocsLayout>;
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { baseOptions } from "@/src/config/layout.config";
2+
import { HomeLayout } from "fumadocs-ui/layouts/home";
3+
import type { ReactNode } from "react";
4+
5+
export default function Layout({ children }: { children: ReactNode }) {
6+
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { Homepage } from "@/src/components/Pages/Homepage";
2+
3+
export default Homepage;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { source } from "@/src/source";
2+
import { createFromSource } from "fumadocs-core/search/server";
3+
4+
export const { GET } = createFromSource(source);

apps/developer-hub/src/app/layout.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export { Root as default } from "../components/Root";
2+
export { metadata, viewport } from "../metadata";

0 commit comments

Comments
 (0)