Skip to content

Add Developer Hub to monorepo #2672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ __pycache__
.turbo/
.cursorrules
.corepack
justfile
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm what is this? Is it intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, justfile is like a Makefile (but with a simplified syntax) it's a local command runner I use in terminal which probably isn't helpful to commit

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

totally reasonable, feel free to commit files like this if you think they may be useful for others, for instance I've committed my nix files (flake.nix etc) -- maybe in a separate commit though

2 changes: 2 additions & 0 deletions apps/developer-hub/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env*.local
.source
7 changes: 7 additions & 0 deletions apps/developer-hub/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.next/
coverage/
node_modules/
*.tsbuildinfo
.env*.local
.env
.DS_Store
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Entropy How-To Guide
description: A placeholder docs page
---

# How To

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.
10 changes: 10 additions & 0 deletions apps/developer-hub/content/docs/entropy/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Overview
description: A placeholder landing page
icon: CardsThree
full: true
---

# Secure On-Chain Randomness

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.
7 changes: 7 additions & 0 deletions apps/developer-hub/content/docs/entropy/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"title": "Entropy",
"description": "Random numbers for smart contracts",
"icon": "Shuffle",
"pages": ["index", "---Guides---", "how-to-guides"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Express Relay How-To Guide
description: A placeholder docs page
---

# How To

Integrate directly with searchers to recapture MEV. Go to market faster. Accelerate your protocol's growth.
10 changes: 10 additions & 0 deletions apps/developer-hub/content/docs/express-relay/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Overview
description: A placeholder landing page
icon: CardsThree
full: true
---

# Take Back Control with Express Relay

Integrate directly with searchers to recapture MEV. Go to market faster. Accelerate your protocol's growth.
7 changes: 7 additions & 0 deletions apps/developer-hub/content/docs/express-relay/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"title": "Express Relay",
"description": "Eliminate MEV",
"icon": "Gavel",
"pages": ["index", "---Guides---", "how-to-guides"]
}
8 changes: 8 additions & 0 deletions apps/developer-hub/content/docs/lazer/how-to-guides/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Lazer How-To Guide
description: A placeholder docs page
---

# How To

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)
10 changes: 10 additions & 0 deletions apps/developer-hub/content/docs/lazer/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Overview
description: A placeholder landing page
icon: CardsThree
full: true
---

# Low latency, highly customizable price oracle

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)
7 changes: 7 additions & 0 deletions apps/developer-hub/content/docs/lazer/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"title": "Lazer",
"description": "Low latency, highly customizable price oracle",
"icon": "Lightning",
"pages": ["index", "---Guides---", "how-to-guides"]
}
3 changes: 3 additions & 0 deletions apps/developer-hub/content/docs/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"pages": ["pyth-core", "lazer", "express-relay", "entropy"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: Pyth Core How-To Guide
description: A placeholder docs page
---

# Heading One

The fastest and most reliable data powering more transactions than any other oracle. Permissionless integration on every blockchain.
10 changes: 10 additions & 0 deletions apps/developer-hub/content/docs/pyth-core/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Overview
description: A placeholder landing page
icon: CardsThree
full: true
---

# Real-time data from financial institutions

The fastest and most reliable data powering more transactions than any other oracle. Permissionless integration on every blockchain.
7 changes: 7 additions & 0 deletions apps/developer-hub/content/docs/pyth-core/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"root": true,
"title": "Pyth Core",
"description": "Real-time data from financial institutions",
"icon": "ChartLine",
"pages": ["index", "---Guides---", "how-to-guides"]
}
1 change: 1 addition & 0 deletions apps/developer-hub/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { nextjs as default } from "@cprussin/eslint-config";
1 change: 1 addition & 0 deletions apps/developer-hub/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { nextjs as default } from "@cprussin/jest-config/next";
5 changes: 5 additions & 0 deletions apps/developer-hub/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
54 changes: 54 additions & 0 deletions apps/developer-hub/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { createMDX } from "fumadocs-mdx/next";

const config = {
reactStrictMode: true,
pageExtensions: ["ts", "tsx", "mdx"],

logging: {
fetches: {
fullUrl: true,
},
},

webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
use: ["@svgr/webpack"],
});

return config;
},

headers: async () => [
{
source: "/:path*",
headers: [
{
key: "X-XSS-Protection",
value: "1; mode=block",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "Strict-Transport-Security",
value: "max-age=2592000",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "Permissions-Policy",
value:
"vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
},
],
},
],
};

const withMDX = createMDX();

export default withMDX(config);
63 changes: 63 additions & 0 deletions apps/developer-hub/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "@pythnetwork/developer-hub",
"version": "0.0.0",
"private": true,
"type": "module",
"engines": {
"node": "22"
},
"scripts": {
"build": "next build",
"build:analyze": "ANALYZE=true next build",
"fix:format": "prettier --write .",
"fix:lint:eslint": "eslint --fix .",
"fix:lint:stylelint": "stylelint --fix 'src/**/*.scss'",
"start:dev": "next dev --port 3627",
"start:prod": "next start --port 3627",
"test:format": "prettier --check .",
"test:lint:eslint": "eslint . --max-warnings 0",
"test:lint:stylelint": "stylelint 'src/**/*.scss' --max-warnings 0",
"test:types": "tsc"
},
"dependencies": {
"@phosphor-icons/react": "catalog:",
"@pythnetwork/component-library": "workspace:*",
"@react-hookz/web": "catalog:",
"clsx": "catalog:",
"fumadocs-core": "catalog:",
"fumadocs-mdx": "catalog:",
"fumadocs-ui": "catalog:",
"next": "catalog:",
"next-themes": "catalog:",
"nuqs": "catalog:",
"react": "catalog:",
"react-aria": "catalog:",
"react-dom": "catalog:",
"zod": "catalog:",
"zod-validation-error": "catalog:"
},
"devDependencies": {
"@cprussin/eslint-config": "catalog:",
"@cprussin/jest-config": "catalog:",
"@cprussin/prettier-config": "catalog:",
"@cprussin/tsconfig": "catalog:",
"@svgr/webpack": "catalog:",
"@tailwindcss/postcss": "catalog:",
"@types/jest": "catalog:",
"@types/mdx": "catalog:",
"@types/node": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"autoprefixer": "catalog:",
"eslint": "catalog:",
"jest": "catalog:",
"postcss": "catalog:",
"prettier": "catalog:",
"sass": "catalog:",
"stylelint": "catalog:",
"stylelint-config-standard-scss": "catalog:",
"tailwindcss": "^4.1.6",
"typescript": "catalog:",
"vercel": "catalog:"
}
}
5 changes: 5 additions & 0 deletions apps/developer-hub/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
plugins: {
"@tailwindcss/postcss": {},
},
};
1 change: 1 addition & 0 deletions apps/developer-hub/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { base as default } from "@cprussin/prettier-config";
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/developer-hub/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/developer-hub/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/developer-hub/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/developer-hub/public/favicon-light.ico
Binary file not shown.
Binary file added apps/developer-hub/public/favicon.ico
Binary file not shown.
30 changes: 30 additions & 0 deletions apps/developer-hub/source.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
import { z } from "zod";

export const docs = defineDocs({
docs: {
schema: z.object({
title: z.string(),
description: z.string(),
icon: z.string().optional(),
full: z.boolean().default(false),
index: z.boolean().default(false),
}),
},
meta: {
schema: z.object({
title: z.string().optional(),
pages: z.array(z.string()).optional(),
description: z.string().optional(),
root: z.boolean().optional(),
defaultOpen: z.boolean().optional(),
icon: z.string().optional(),
}),
},
});

export default defineConfig({
mdxOptions: {
// MDX options
},
});
24 changes: 24 additions & 0 deletions apps/developer-hub/src/app/(docs)/[section]/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export { DocumentationPage as default } from "../../../../components/Pages/DocumentationPage";
import type { Metadata } from "next";
import { notFound } from "next/navigation";

import { source } from "../../../../source";

export function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ section: string; slug: string[] }>;
}) {
const params = await props.params;

const page = source.getPage([params.section, ...params.slug]);

if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
} satisfies Metadata;
}
23 changes: 23 additions & 0 deletions apps/developer-hub/src/app/(docs)/[section]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export { LandingPage as default } from "../../../components/Pages/LandingPage";
import type { Metadata } from "next";
import { notFound } from "next/navigation";

import { source } from "../../../source";

export function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ section: string }>;
}) {
const params = await props.params;
const page = source.getPage([params.section]);

if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
} satisfies Metadata;
}
8 changes: 8 additions & 0 deletions apps/developer-hub/src/app/(docs)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import type { ReactNode } from "react";

import { docsOptions } from "../../config/layout.config";

export default function Layout({ children }: { children: ReactNode }) {
return <DocsLayout {...docsOptions}>{children}</DocsLayout>;
}
8 changes: 8 additions & 0 deletions apps/developer-hub/src/app/(homepage)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { HomeLayout } from "fumadocs-ui/layouts/home";
import type { ReactNode } from "react";

import { baseOptions } from "../../config/layout.config";

export default function Layout({ children }: { children: ReactNode }) {
return <HomeLayout {...baseOptions}>{children}</HomeLayout>;
}
1 change: 1 addition & 0 deletions apps/developer-hub/src/app/(homepage)/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Homepage as default } from "../../components/Pages/Homepage";
5 changes: 5 additions & 0 deletions apps/developer-hub/src/app/api/search/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFromSource } from "fumadocs-core/search/server";

import { source } from "../../../source";

export const { GET } = createFromSource(source);
2 changes: 2 additions & 0 deletions apps/developer-hub/src/app/layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Root as default } from "../components/Root";
export { metadata, viewport } from "../metadata";
11 changes: 11 additions & 0 deletions apps/developer-hub/src/app/robots.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { MetadataRoute } from "next";

import { IS_PRODUCTION_SERVER } from "../config/server";

const robots = (): MetadataRoute.Robots => ({
rules: {
userAgent: "*",
...(IS_PRODUCTION_SERVER ? { allow: "/" } : { disallow: "/" }),
},
});
export default robots;
Loading
Loading