⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.
TypeScript honoissue-managementissue-trackerjira-alternativekanbanlinear-alternativemcpproject-managementreactself-hostedtypescript
feat(site): add homepage sponsors section with public sponsor sync
Andrej6c8fb8f5d716
diff --git a/.github/workflows/update-contributors.yml b/.github/workflows/update-contributors.ymlindex 7277c74c8..3d22d4d77 100644--- a/.github/workflows/update-contributors.yml+++ b/.github/workflows/update-contributors.yml@@ -38,10 +38,16 @@ jobs:minimum: 1marker: sponsors+ - name: Sync Site Sponsors+ if: ${{ github.repository_owner == 'usekaneo' }}+ env:+ GITHUB_TOKEN: ${{ secrets.GH_ANDREJ }}+ run: node apps/site/scripts/sync-sponsors.mjs+- name: Commit and Push Changesrun: |git config --local user.email "github-actions[bot]@users.noreply.github.com"git config --local user.name "github-actions[bot]"- git add CONTRIBUTORS.svg README.md+ git add CONTRIBUTORS.svg README.md apps/site/constants/sponsors.jsongit commit -m "docs: update contributors and sponsors" || exit 0git push\ No newline at end of filediff --git a/README.md b/README.mdindex f5a3566ae..9dc7c320a 100644--- a/README.md+++ b/README.md@@ -50,6 +50,8 @@ Learn more about Kaneo's features and capabilities in our [documentation](https:Kaneo is open source. If you find it useful, consider [sponsoring the project](https://github.com/sponsors/andrejsshell) to help support ongoing development.+<!-- sponsors --><a href="https://github.com/danielsada"><img src="https://github.com/danielsada.png" width="60px" alt="User avatar: Daniel Sada" /></a><!-- sponsors -->+## Getting Started### One-Click Deployment with drimdiff --git a/apps/site/app/page.tsx b/apps/site/app/page.tsxindex a5bcc1554..d9bc7083d 100644--- a/apps/site/app/page.tsx+++ b/apps/site/app/page.tsx@@ -4,6 +4,7 @@ import { FounderStatement } from "@/components/landing/founder-statement";import { Hero } from "@/components/landing/hero";import { Navbar } from "@/components/landing/navbar";import { SectionSeparator } from "@/components/landing/section-separator";+import { Sponsors } from "@/components/landing/sponsors";export default function HomePage() {return (@@ -17,6 +18,9 @@ export default function HomePage() {<SectionSeparator><FounderStatement /></SectionSeparator>+ <SectionSeparator>+ <Sponsors />+ </SectionSeparator></main><Footer /></>diff --git a/apps/site/components/landing/footer.tsx b/apps/site/components/landing/footer.tsxindex ccf3d6d19..f33e990fa 100644--- a/apps/site/components/landing/footer.tsx+++ b/apps/site/components/landing/footer.tsx@@ -75,6 +75,14 @@ export function Footer() {>Discord</a>+ <a+ className="block text-muted-foreground transition-colors hover:text-foreground"+ href="https://github.com/sponsors/andrejsshell"+ target="_blank"+ rel="noreferrer"+ >+ Sponsor+ </a><aclassName="block text-muted-foreground transition-colors hover:text-foreground"href="/docs"diff --git a/apps/site/components/landing/sponsors.tsx b/apps/site/components/landing/sponsors.tsxnew file mode 100644index 000000000..293795ac6--- /dev/null+++ b/apps/site/components/landing/sponsors.tsx@@ -0,0 +1,123 @@+import { FadeIn } from "@/components/landing/fade-in";+import sponsors from "@/constants/sponsors.json";+import { cn } from "@/lib/utils";++type Sponsor = {+ login: string;+ name: string | null;+ avatarUrl: string;+ tier: number | null;+};++const founding = sponsors.founding as Sponsor[];+const current = sponsors.current as Sponsor[];+const past = sponsors.past as Sponsor[];++const featured = [...founding, ...current];+const featuredLabel =+ current.length > 0 ? "Founding and current sponsors" : "Founding sponsor";++// Higher sponsorship tiers get larger placement, matching the tier rewards on+// GitHub Sponsors.+function avatarSize(tier: number | null) {+ if (tier == null) return "size-12";+ if (tier >= 250) return "size-20";+ if (tier >= 100) return "size-16";+ if (tier >= 15) return "size-14";+ return "size-12";+}++export function Sponsors() {+ return (+ <section id="sponsors" className="px-6 py-16 md:py-20">+ <div className="mx-auto w-full max-w-6xl">+ <FadeIn>+ <h2 className="text-3xl font-semibold md:text-4xl">Sponsors</h2>+ </FadeIn>+ <FadeIn delay={80}>+ <p className="mt-6 text-lg text-muted-foreground leading-relaxed">+ Kaneo is{" "}+ <strong className="font-medium text-foreground">+ free and open source+ </strong>+ , and it stays independent because the people who use it fund it.+ Sponsorship pays for the development time behind every release, from+ new features to the unglamorous fixes that keep self-hosted+ instances running. If it saves your team time, you can{" "}+ <a+ className="font-medium text-foreground underline decoration-muted-foreground/50 underline-offset-4 transition-colors hover:decoration-foreground"+ href="https://github.com/sponsors/andrejsshell"+ target="_blank"+ rel="noreferrer"+ >+ sponsor Kaneo+ </a>+ .+ </p>+ </FadeIn>+ <FadeIn delay={160}>+ <div className="mt-12">+ <p className="font-medium text-muted-foreground text-sm">+ {featuredLabel}+ </p>+ <div className="mt-5 flex flex-wrap items-center gap-x-10 gap-y-5">+ {featured.map((sponsor) => (+ <a+ key={sponsor.login}+ className="flex items-center gap-3"+ href={`https://github.com/${sponsor.login}`}+ target="_blank"+ rel="noreferrer"+ >+ <img+ alt=""+ className={cn(+ "rounded-full border border-border/70",+ avatarSize(sponsor.tier),+ )}+ src={sponsor.avatarUrl}+ loading="lazy"+ />+ <span>+ <span className="block font-medium text-base">+ {sponsor.name ?? sponsor.login}+ </span>+ <span className="block text-muted-foreground text-sm">+ @{sponsor.login}+ </span>+ </span>+ </a>+ ))}+ </div>+ </div>+ {past.length > 0 && (+ <div className="mt-10">+ <p className="font-medium text-muted-foreground text-sm">+ Past sponsors+ </p>+ <div className="mt-5 flex flex-wrap items-center gap-2">+ {past.map((sponsor) => (+ <a+ key={sponsor.login}+ className="rounded-full"+ href={`https://github.com/${sponsor.login}`}+ target="_blank"+ rel="noreferrer"+ title={sponsor.name ?? `@${sponsor.login}`}+ >+ <img+ alt={sponsor.name ?? sponsor.login}+ className="size-10 rounded-full border border-border/70 opacity-80 transition-opacity hover:opacity-100"+ src={sponsor.avatarUrl}+ loading="lazy"+ />+ </a>+ ))}+ </div>+ </div>+ )}+ </FadeIn>+ </div>+ </section>+ );+}diff --git a/apps/site/constants/sponsors.json b/apps/site/constants/sponsors.jsonnew file mode 100644index 000000000..b2a8e7b88--- /dev/null+++ b/apps/site/constants/sponsors.json@@ -0,0 +1,49 @@+{+ "founding": [+ {+ "login": "danielsada",+ "name": "Daniel Sada",+ "avatarUrl": "https://avatars.githubusercontent.com/u/2849006?v=4",+ "tier": null+ }+ ],+ "current": [],+ "past": [+ {+ "login": "achouvardas",+ "name": "Angelos Chouvardas",+ "avatarUrl": "https://avatars.githubusercontent.com/u/77693989?v=4",+ "tier": null+ },+ {+ "login": "alexgutjahr",+ "name": "Alex Gutjahr",+ "avatarUrl": "https://avatars.githubusercontent.com/u/58935?v=4",+ "tier": null+ },+ {+ "login": "KnudH",+ "name": "Knud Hollander",+ "avatarUrl": "https://avatars.githubusercontent.com/u/26556793?v=4",+ "tier": null+ },+ {+ "login": "MakoPhil",+ "name": null,+ "avatarUrl": "https://avatars.githubusercontent.com/u/36614366?v=4",+ "tier": null+ },+ {+ "login": "ndinevski",+ "name": "Nikola Dinevski",+ "avatarUrl": "https://avatars.githubusercontent.com/u/61565298?v=4",+ "tier": null+ },+ {+ "login": "TehMaat",+ "name": null,+ "avatarUrl": "https://avatars.githubusercontent.com/u/60507708?v=4",+ "tier": null+ }+ ]+}diff --git a/apps/site/scripts/sync-sponsors.mjs b/apps/site/scripts/sync-sponsors.mjsnew file mode 100644index 000000000..dbcffa88a--- /dev/null+++ b/apps/site/scripts/sync-sponsors.mjs@@ -0,0 +1,152 @@+// Syncs the public GitHub sponsors of andrejsshell into constants/sponsors.json,+// which drives the Sponsors section on the landing page.+//+// Only sponsorships GitHub reports as PUBLIC are written; private sponsors are+// never included. Founding sponsors are pinned permanently and stay listed even+// if their sponsorship ends.+//+// Usage: GITHUB_TOKEN=<token with the read:user scope> node scripts/sync-sponsors.mjs++import { writeFile } from "node:fs/promises";+import { dirname, join } from "node:path";+import { fileURLToPath } from "node:url";++const MAINTAINER = "andrejsshell";++const FOUNDING = [+ {+ login: "danielsada",+ name: "Daniel Sada",+ avatarUrl: "https://avatars.githubusercontent.com/u/2849006?v=4",+ tier: null,+ },+];++const token = process.env.GITHUB_TOKEN ?? process.env.GH_TOKEN;+if (!token) {+ console.error(+ "Set GITHUB_TOKEN to a token with the read:user scope before running.",+ );+ process.exit(1);+}++const query = `+ query ($cursor: String) {+ user(login: "${MAINTAINER}") {+ sponsorshipsAsMaintainer(+ first: 100+ after: $cursor+ includePrivate: false+ activeOnly: false+ ) {+ pageInfo {+ hasNextPage+ endCursor+ }+ nodes {+ isActive+ privacyLevel+ tier {+ monthlyPriceInDollars+ }+ sponsorEntity {+ ... on User {+ login+ name+ databaseId+ }+ ... on Organization {+ login+ name+ databaseId+ }+ }+ }+ }+ }+ }+`;++async function fetchSponsorships() {+ const nodes = [];+ let cursor = null;+ do {+ const response = await fetch("https://api.github.com/graphql", {+ method: "POST",+ headers: {+ Authorization: `Bearer ${token}`,+ "Content-Type": "application/json",+ },+ body: JSON.stringify({ query, variables: { cursor } }),+ });+ if (!response.ok) {+ throw new Error(`GitHub API returned ${response.status}`);+ }+ const payload = await response.json();+ if (payload.errors?.length) {+ throw new Error(payload.errors.map((error) => error.message).join("; "));+ }+ const connection = payload.data.user.sponsorshipsAsMaintainer;+ nodes.push(...connection.nodes);+ cursor = connection.pageInfo.hasNextPage+ ? connection.pageInfo.endCursor+ : null;+ } while (cursor);+ return nodes;+}++function toEntry(node) {+ const { login, name, databaseId } = node.sponsorEntity;+ return {+ login,+ name: name ?? null,+ avatarUrl: `https://avatars.githubusercontent.com/u/${databaseId}?v=4`,+ tier: node.tier?.monthlyPriceInDollars ?? null,+ };+}++const byLogin = (a, b) =>+ a.login.localeCompare(b.login, "en", { sensitivity: "base" });++const foundingLogins = new Set(FOUNDING.map((sponsor) => sponsor.login));+const fromApi = new Map();+const current = [];+const past = [];++for (const node of await fetchSponsorships()) {+ // includePrivate: false already omits private sponsorships; the privacy+ // check is a second guard so a private sponsor can never end up in the file.+ if (node.privacyLevel !== "PUBLIC" || !node.sponsorEntity?.login) {+ continue;+ }+ const entry = toEntry(node);+ if (foundingLogins.has(entry.login)) {+ fromApi.set(entry.login, entry);+ } else if (node.isActive) {+ current.push(entry);+ } else {+ past.push(entry);+ }+}++// Founding sponsors are permanent: fall back to the pinned entry if the API+// no longer returns their sponsorship.+const founding = FOUNDING.map(+ (sponsor) => fromApi.get(sponsor.login) ?? sponsor,+);+// Higher tiers come first so placement on the site follows tier promises.+current.sort((a, b) => (b.tier ?? 0) - (a.tier ?? 0) || byLogin(a, b));+past.sort(byLogin);++const outputPath = join(+ dirname(fileURLToPath(import.meta.url)),+ "..",+ "constants",+ "sponsors.json",+);+const data = { founding, current, past };+// Tab indentation matches how Biome formats JSON in this repo.+await writeFile(outputPath, `${JSON.stringify(data, null, "\t")}\n`);+console.log(+ `Wrote ${founding.length} founding, ${current.length} current, and ${past.length} past sponsors to constants/sponsors.json`,+);