Skip to content

Commit af0448f

Browse files
authored
Merge pull request #2672 from pyth-network/devhub-boilerplate
Add Developer Hub to monorepo
2 parents 0ddd8eb + 3914dcc commit af0448f

Some content is hidden

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

59 files changed

+3402
-345
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ __pycache__
2525
.turbo/
2626
.cursorrules
2727
.corepack
28+
justfile

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: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { createMDX } from "fumadocs-mdx/next";
2+
3+
const config = {
4+
reactStrictMode: true,
5+
pageExtensions: ["ts", "tsx", "mdx"],
6+
7+
logging: {
8+
fetches: {
9+
fullUrl: true,
10+
},
11+
},
12+
13+
webpack(config) {
14+
config.module.rules.push({
15+
test: /\.svg$/i,
16+
use: ["@svgr/webpack"],
17+
});
18+
19+
return config;
20+
},
21+
22+
headers: async () => [
23+
{
24+
source: "/:path*",
25+
headers: [
26+
{
27+
key: "X-XSS-Protection",
28+
value: "1; mode=block",
29+
},
30+
{
31+
key: "Referrer-Policy",
32+
value: "strict-origin-when-cross-origin",
33+
},
34+
{
35+
key: "Strict-Transport-Security",
36+
value: "max-age=2592000",
37+
},
38+
{
39+
key: "X-Content-Type-Options",
40+
value: "nosniff",
41+
},
42+
{
43+
key: "Permissions-Policy",
44+
value:
45+
"vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
46+
},
47+
],
48+
},
49+
],
50+
};
51+
52+
const withMDX = createMDX();
53+
54+
export default withMDX(config);

apps/developer-hub/package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
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": "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+
"start:dev": "next dev --port 3627",
16+
"start:prod": "next start --port 3627",
17+
"test:format": "prettier --check .",
18+
"test:lint:eslint": "eslint . --max-warnings 0",
19+
"test:lint:stylelint": "stylelint 'src/**/*.scss' --max-warnings 0",
20+
"test:types": "tsc"
21+
},
22+
"dependencies": {
23+
"@phosphor-icons/react": "catalog:",
24+
"@pythnetwork/component-library": "workspace:*",
25+
"@react-hookz/web": "catalog:",
26+
"clsx": "catalog:",
27+
"fumadocs-core": "catalog:",
28+
"fumadocs-mdx": "catalog:",
29+
"fumadocs-ui": "catalog:",
30+
"next": "catalog:",
31+
"next-themes": "catalog:",
32+
"nuqs": "catalog:",
33+
"react": "catalog:",
34+
"react-aria": "catalog:",
35+
"react-dom": "catalog:",
36+
"zod": "catalog:",
37+
"zod-validation-error": "catalog:"
38+
},
39+
"devDependencies": {
40+
"@cprussin/eslint-config": "catalog:",
41+
"@cprussin/jest-config": "catalog:",
42+
"@cprussin/prettier-config": "catalog:",
43+
"@cprussin/tsconfig": "catalog:",
44+
"@svgr/webpack": "catalog:",
45+
"@tailwindcss/postcss": "catalog:",
46+
"@types/jest": "catalog:",
47+
"@types/mdx": "catalog:",
48+
"@types/node": "catalog:",
49+
"@types/react": "catalog:",
50+
"@types/react-dom": "catalog:",
51+
"autoprefixer": "catalog:",
52+
"eslint": "catalog:",
53+
"jest": "catalog:",
54+
"postcss": "catalog:",
55+
"prettier": "catalog:",
56+
"sass": "catalog:",
57+
"stylelint": "catalog:",
58+
"stylelint-config-standard-scss": "catalog:",
59+
"tailwindcss": "^4.1.6",
60+
"typescript": "catalog:",
61+
"vercel": "catalog:"
62+
}
63+
}

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

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import type { MetadataRoute } from "next";
2+
3+
import { IS_PRODUCTION_SERVER } from "../config/server";
4+
5+
const robots = (): MetadataRoute.Robots => ({
6+
rules: {
7+
userAgent: "*",
8+
...(IS_PRODUCTION_SERVER ? { allow: "/" } : { disallow: "/" }),
9+
},
10+
});
11+
export default robots;

0 commit comments

Comments
 (0)