diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..8576c1f --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,32 @@ +name: Check + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +jobs: + links: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build site + run: npm run build + + - name: Check links + uses: lycheeverse/lychee-action@v2 + with: + args: --verbose --no-progress README.md dist/index.html + fail: true diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..2a4c383 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,46 @@ +name: Deploy Pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build site + run: npm run build + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: dist + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ec8e75 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +dist/ +node_modules/ + +.DS_Store +.env +.env.* +*.log diff --git a/README.md b/README.md index 5e4c2ed..660fb5b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Awesome IPFS [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) +# Awesome Libp2p [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) This is a community list of awesome projects, protocols, networks, apps, tools, and services related to libp2p. @@ -6,6 +6,18 @@ This is a community list of awesome projects, protocols, networks, apps, tools, ## Implementations +- [go-libp2p](https://github.com/libp2p/go-libp2p) +- [js-libp2p](https://github.com/libp2p/js-libp2p) +- [rust-libp2p](https://github.com/libp2p/rust-libp2p) +- [py-libp2p](https://github.com/libp2p/py-libp2p) +- [nim-libp2p](https://github.com/vacp2p/nim-libp2p) +- [zig-libp2p](https://github.com/zen-eth/zig-libp2p) +- [cpp-libp2p](https://github.com/libp2p/cpp-libp2p) +- [swift-libp2p](https://github.com/swift-libp2p/swift-libp2p) +- [jvm-libp2p](https://github.com/libp2p/jvm-libp2p) +- [dotnet-libp2p](https://github.com/NethermindEth/dotnet-libp2p) +- [c-libp2p](https://github.com/Pier-Two/c-libp2p) +- [litep2p](https://github.com/paritytech/litep2p) ## Networks / Blockchains @@ -14,30 +26,34 @@ This is a community list of awesome projects, protocols, networks, apps, tools, - [Venus](https://github.com/filecoin-project/venus) - [Forest](https://github.com/ChainSafe/forest) - Ethereum - - https://github.com/sigp/lighthouse - - https://github.com/ChainSafe/lodestar + - [Lighthouse](https://github.com/sigp/lighthouse) + - [lodestar](https://github.com/ChainSafe/lodestar) - Polkadot - - https://github.com/paritytech/polkadot-sdk - - https://github.com/smol-dot/smoldot - - https://github.com/ChainSafe/gossamer + - [polkadot-sdk](https://github.com/paritytech/polkadot-sdk) + - [smoldot](https://github.com/smol-dot/smoldot) + - [gossamer](https://github.com/ChainSafe/gossamer) - [Flow](https://github.com/onflow/flow-go) -- Celestia - https://github.com/celestiaorg/celestia-node -- Starknet - https://github.com/eqlabs/pathfinder -- Pactus - https://github.com/pactus-project/pactus -- Fuel - https://github.com/FuelLabs/fuel-core -- Madara - https://github.com/keep-starknet-strange/madara -- Avail - https://github.com/availproject/avail -- Starcoin - https://github.com/starcoinorg/starcoin -- Magi - https://github.com/a16z/magi -- Spacemesh - https://github.com/spacemeshos/go-spacemesh -- Optimism - https://github.com/ethereum-optimism/optimism -- Mantle - https://github.com/mantlenetworkio/mantle-v2 -- Algorand - https://github.com/algorand/go-algorand +- [Celestia](https://github.com/celestiaorg/celestia-node) +- [Starknet](https://github.com/eqlabs/pathfinder) +- [Pactus](https://github.com/pactus-project/pactus) +- [Fuel](https://github.com/FuelLabs/fuel-core) +- [Madara](https://github.com/keep-starknet-strange/madara) +- [Avail](https://github.com/availproject/avail) +- [Starcoin](https://github.com/starcoinorg/starcoin) +- [Optimism](https://github.com/ethereum-optimism/optimism) +- [Mantle](https://github.com/mantlenetworkio/mantle-v2) +- [Algorand](https://github.com/algorand/go-algorand) ## Apps +- [IPFS Kubo](https://github.com/ipfs/kubo) +- [IPFS Helia](https://github.com/ipfs/helia) +- [Gnosis VPN](https://github.com/gnosis/gnosis_vpn-client/) +- [OrbitDB](https://github.com/orbitdb/orbitdb) +- [Peerbit](https://github.com/dao-xyz/peerbit) +- [Ceramic](https://github.com/ceramicnetwork/js-ceramic) +- [Peergos](https://github.com/Peergos/Peergos) +- [Berty](https://github.com/berty/berty) +- [Hopr](https://github.com/hoprnet/hoprnet) - [Seed Hypermedia](https://github.com/seed-hypermedia/seed) -## Application Developer Tools - -- [Canvas](https://canvas.xyz/) diff --git a/package.json b/package.json new file mode 100644 index 0000000..2dfdc63 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "awesome-libp2p", + "private": true, + "type": "module", + "scripts": { + "build": "node scripts/build-site.mjs" + }, + "engines": { + "node": ">=20" + } +} diff --git a/scripts/build-site.mjs b/scripts/build-site.mjs new file mode 100644 index 0000000..4ae9b22 --- /dev/null +++ b/scripts/build-site.mjs @@ -0,0 +1,165 @@ +import { cp, mkdir, readFile, rm, writeFile } from "node:fs/promises"; +import { dirname, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const source = resolve(root, "site"); +const output = resolve(root, "dist"); +const readmePath = resolve(root, "README.md"); +const indexPath = resolve(output, "index.html"); + +await rm(output, { force: true, recursive: true }); +await mkdir(output, { recursive: true }); +await cp(source, output, { recursive: true }); + +const readme = await readFile(readmePath, "utf8"); +const index = await readFile(indexPath, "utf8"); +const { description, title, sections } = parseReadme(readme); +const projectsHtml = renderProjects(sections); + +await writeFile( + indexPath, + index + .replace(/.*?<\/title>/, `<title>${escapeHtml(title)}`) + .replace(/

.*?<\/h1>/, `

${escapeHtml(title)}

`) + .replace( + /

[\s\S]*?<\/p>/, + `

\n ${escapeHtml(description)}\n

`, + ) + .replace( + /[\s\S]*/, + `\n${projectsHtml}\n `, + ), +); + +console.log(`Built site: ${source} -> ${output}`); + +function parseReadme(markdown) { + const lines = markdown.split(/\r?\n/); + const titleLine = lines.find((line) => line.startsWith("# ")) ?? "# Awesome libp2p"; + const title = stripMarkdown(titleLine.replace(/^#\s+/, "")).trim(); + const description = lines.find((line) => line.trim() && !line.startsWith("#"))?.trim() ?? ""; + const sections = []; + let currentSection = null; + let currentItem = null; + + for (const line of lines) { + const heading = line.match(/^##\s+(.+)$/); + + if (heading) { + currentSection = { items: [], title: heading[1].trim() }; + sections.push(currentSection); + currentItem = null; + continue; + } + + const item = line.match(/^(\s*)-\s+(.+)$/); + + if (!item || !currentSection) { + continue; + } + + const indent = item[1].length; + const text = item[2].trim(); + + if (indent === 0) { + currentItem = { children: [], text }; + currentSection.items.push(currentItem); + continue; + } + + if (currentItem) { + currentItem.children.push(text); + } + } + + return { description, sections, title }; +} + +function renderProjects(sections) { + const renderedSections = sections + .filter((section) => section.items.length > 0) + .map((section, index) => { + const number = String(index + 1).padStart(2, "0"); + const items = section.items.map(renderItem).join("\n"); + + return `

${number} ${escapeHtml(section.title)}

\n `; + }) + .join("\n\n"); + + return `
\n

Projects

\n\n${renderedSections}\n
`; +} + +function renderItem(item) { + if (item.children.length === 0) { + return `
  • ${renderInline(item.text)}
  • `; + } + + return `
  • ${renderInline(item.text)}: ${item.children.map(renderInline).join(", ")}
  • `; +} + +function renderInline(markdown) { + const namedUrl = markdown.match(/^(.+?)\s+-\s+(https?:\/\/\S+)$/); + + if (namedUrl) { + return `${escapeHtml(namedUrl[1])}`; + } + + const parts = []; + let remaining = markdown; + const linkPattern = /\[([^\]]+)\]\(([^)]+)\)|(https?:\/\/[^\s)]+)/; + + while (remaining) { + const match = remaining.match(linkPattern); + + if (!match) { + parts.push(escapeHtml(remaining)); + break; + } + + parts.push(escapeHtml(remaining.slice(0, match.index))); + + const label = match[1] ?? linkLabel(match[3]); + const url = match[2] ?? match[3]; + parts.push(`${escapeHtml(label)}`); + remaining = remaining.slice(match.index + match[0].length); + } + + return parts.join(""); +} + +function linkLabel(url) { + try { + const parsed = new URL(url); + const segments = parsed.pathname.split("/").filter(Boolean); + return humanizeLabel(segments.at(-1) ?? parsed.hostname); + } catch { + return url; + } +} + +function humanizeLabel(value) { + return value + .split(/[-_]/) + .map((part) => (part.length <= 3 ? part.toUpperCase() : `${part[0].toUpperCase()}${part.slice(1)}`)) + .join(" "); +} + +function stripMarkdown(markdown) { + return markdown + .replace(/\[!\[[^\]]*\]\([^)]+\)\]\([^)]+\)/g, "") + .replace(/!\[[^\]]*\]\([^)]+\)/g, "") + .replace(/\[([^\]]+)\]\([^)]+\)/g, "$1"); +} + +function escapeHtml(value) { + return value + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """); +} + +function escapeAttribute(value) { + return escapeHtml(value); +} diff --git a/site/assets/libp2p-logo.png b/site/assets/libp2p-logo.png new file mode 100644 index 0000000..fe82993 Binary files /dev/null and b/site/assets/libp2p-logo.png differ diff --git a/site/index.html b/site/index.html new file mode 100644 index 0000000..71161a5 --- /dev/null +++ b/site/index.html @@ -0,0 +1,65 @@ + + + + + + + Awesome libp2p + + + + + +
    + +
    +

    Projects

    +
    + + +
    +

    Contribute

    +

    + Open a pull request with a focused addition to the awesome list. Prefer active, + source-linked projects with a clear relationship to libp2p. +

    + +
    +
    + + diff --git a/site/styles.css b/site/styles.css new file mode 100644 index 0000000..a0e09f3 --- /dev/null +++ b/site/styles.css @@ -0,0 +1,281 @@ +:root { + --bg: #f7fbff; + --ink: #002256; + --panel: #fffaf0; + --text: #16161f; + --muted: #48505d; + --link: #1a8bc4; + --primary: #24a8e6; + --primary-light: #b3e4f7; + --orange: #ff743e; + --purple: #953a8c; + --border: #c9d8e8; + --shadow: rgba(0, 34, 86, 0.14); + font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} + +* { + box-sizing: border-box; +} + +body { + max-width: 1040px; + margin: 0 auto; + padding: 24px 20px 64px; + color: var(--text); + background: + radial-gradient(circle at top left, rgba(36, 168, 230, 0.18), transparent 26rem), + radial-gradient(circle at top right, rgba(255, 116, 62, 0.14), transparent 24rem), + linear-gradient(90deg, rgba(0, 34, 86, 0.04) 1px, transparent 1px), + linear-gradient(rgba(0, 34, 86, 0.04) 1px, transparent 1px), + var(--bg); + background-size: 32px 32px; + font-size: 16px; + line-height: 1.6; +} + +.site-header, +main { + background: rgba(255, 255, 255, 0.96); + border: 2px solid var(--ink); + box-shadow: 8px 8px 0 var(--primary-light); +} + +.site-header { + margin-bottom: 22px; + overflow: hidden; +} + +main { + padding: 12px 34px 38px; +} + +nav { + display: flex; + justify-content: space-between; + gap: 16px; + padding: 14px 22px; + color: #fff; + background: + linear-gradient(90deg, var(--ink), #123b7a 58%, var(--purple)); + border-bottom: 2px solid var(--ink); +} + +nav div { + display: flex; + gap: 14px; +} + +nav div a { + color: #fff; +} + +a { + color: var(--link); + text-decoration-thickness: 0.08em; + text-underline-offset: 0.18em; +} + +a:hover { + text-decoration: underline; +} + +.brand { + display: inline-flex; + gap: 10px; + align-items: center; + color: #fff; + font-weight: 700; + text-decoration: none; +} + +.brand img, +.hero-logo { + display: block; + object-fit: contain; +} + +.brand img { + width: 28px; + height: 28px; +} + +.hero { + position: relative; + padding: 48px 34px 38px; + background: + radial-gradient(circle at 92% 18%, rgba(255, 116, 62, 0.32), transparent 9rem), + radial-gradient(circle at 80% 82%, rgba(149, 58, 140, 0.16), transparent 11rem), + linear-gradient(135deg, #f4fbff 0%, #ffffff 58%, #fff4ed 100%); +} + +.eyebrow { + margin: 0 0 8px; + color: var(--purple); + font-size: 0.78rem; + font-weight: 700; + letter-spacing: 0.1em; + text-transform: uppercase; +} + +.hero-logo { + width: 64px; + height: 64px; + flex: 0 0 auto; +} + +.hero-title { + display: flex; + gap: 18px; + align-items: center; + margin-bottom: 8px; +} + +h1, +h2, +h3 { + line-height: 1.25; +} + +h1 { + margin: 0 0 8px; + max-width: 720px; + font-size: clamp(2.6rem, 8vw, 5.4rem); + letter-spacing: -0.035em; + line-height: 1; +} + +h2 { + margin-top: 34px; + padding-bottom: 10px; + border-bottom: 2px solid var(--ink); + font-size: 1.8rem; +} + +h3 { + display: flex; + gap: 10px; + align-items: center; + margin-top: 30px; + margin-bottom: 10px; + font-size: 1.25rem; +} + +h3 span { + border: 1px solid var(--ink); + padding: 1px 7px; + color: #fff; + background: var(--purple); + font-size: 0.78rem; + line-height: 1.4; +} + +.lede { + max-width: 680px; + margin-bottom: 20px; + color: var(--muted); + font-size: 1.2rem; +} + +.hero-meta { + display: flex; + flex-wrap: wrap; + gap: 8px; + margin-top: 24px; +} + +.hero-meta span { + border: 1px solid var(--ink); + padding: 5px 9px; + background: #fff; + color: var(--ink); + font-size: 0.88rem; + font-weight: 650; +} + +.button { + display: inline-block; + border: 2px solid var(--ink); + padding: 7px 12px; + color: var(--ink); + background: var(--orange); + font-weight: 600; + text-decoration: none; + box-shadow: 3px 3px 0 var(--ink); +} + +.button:hover { + color: var(--ink); + transform: translate(1px, 1px); + box-shadow: 2px 2px 0 var(--ink); + text-decoration: none; +} + +ul { + padding-left: 24px; +} + +.project-list { + margin: 12px 0 0; + padding: 0; + border: 2px solid var(--ink); + background: #fff; + list-style: none; +} + +.project-list li { + margin: 0; + padding: 11px 14px; +} + +.project-list li + li { + border-top: 1px solid var(--border); +} + +.project-list li:nth-child(even) { + background: rgba(36, 168, 230, 0.08); +} + +.link-row { + display: flex; + flex-wrap: wrap; + gap: 16px; + align-items: center; +} + +li + li { + margin-top: 8px; +} + +section + section { + margin-top: 48px; +} + +.contribute { + padding: 2px 0 0; +} + +@media (max-width: 560px) { + body { + padding: 12px; + } + + main, + .hero { + padding-inline: 20px; + } + + nav { + display: block; + } + + nav div { + margin-top: 8px; + } + + .hero-title { + align-items: flex-start; + flex-direction: column; + gap: 12px; + } +}