This repository contains the source code and content for the Flare Developer Hub – the decentralized origin for Flare builders ☀️
This site is built with Docusaurus, a modern static site generator.
Follow these steps to set up a local development environment for previewing changes or contributing.
- Node.js v20 with nvm.
- uv, Cargo and go for language specific development.
-
Clone the repository:
git clone https://github.com/flare-foundation/developer-hub.git cd developer-hub -
Install dependencies:
npm install
-
Start the local development server:
npm run start
This launches the development server and automatically opens your default browser. Live reloading ensures changes appear instantly.
flare-foundation/developer-hub/
├── .github/ # GitHub Actions workflows, issue templates, etc.
├── automations/ # Scripts & data for automating content updates (feeds, tables).
├── docgen/ # Tools for auto-generating Solidity documentation.
├── docs/ # The core documentation content in Markdown (.mdx).
├── examples/ # Code examples in various languages (Python, JS, Rust, Go, Solidity).
├── src/ # Docusaurus site source: custom components, pages, CSS, theme overrides.
├── static/ # Static assets (images, PDFs, OpenAPI specs) served directly.
├── CONTRIBUTING.md # Guidelines for contributors.
├── docusaurus.config.ts # Main Docusaurus site configuration.
└── sidebars.ts # Defines the structure of the documentation sidebar.
Common tasks when developing or contributing content.
The examples/ directory contains code snippets demonstrating how to interact with Flare protocols.
Each language subdirectory often has its own README.md with setup instructions.
Supported languages:
- Python
- JavaScript/TypeScript
- Rust
- Go
Ensure consistent formatting using Prettier:
npm run formatNote: Prettier support for MDXv3 is evolving (tracking issue). If needed, bypass Prettier by using:
{/* prettier-ignore */}
Code examples within the examples/ directory follow language-specific formatting standards:
gofmtfor Gocargo fmtfor Rustrufffor Python
To generate Solidity documentation:
-
Switch to Node.js v18:
nvm use 18
-
Run the Documentation Generator:
cd docgen chmod +x generate-solidity-docs.sh ./generate-solidity-docs.shThis pulls the latest smart contracts and generates docs.
-
Switch Back to Node.js v20:
nvm use 20
-
Update addresses and feeds:
This script updates JSON files used by custom components (e.g., feed tables, contract address lists) by fetching data from the
ContractRegistryonchain and referencing risk data defined inautomations/*_risk.json.npm run automations
-
Update language dependencies:
This script runs package manager updates within the various language subdirectories under
examples/to refresh their dependencies.npm run update-deps
To create a production-ready build:
npm run buildThe static files are generated in the build directory. To serve the production build locally:
npm run serveNote: Search only works in production builds.
Contributions are highly welcome! Whether it's fixing a typo, improving documentation clarity, adding new examples, or enhancing the site itself, your help is appreciated. Before your first PR, read the CONTRIBUTING.md.