Branchwell / source / src / content.ts
| 1 | // The public pages: home, how to pull, how to contribute, how votes work, for apps, research, careers, privacy. |
| 2 | import { esc } from './html'; |
| 3 | import { CHECKS_TEXT } from './checks'; |
| 4 | |
| 5 | export const DIAGRAM = `<div class="diagram"><svg viewBox="0 0 520 330" role="img" aria-labelledby="dg-t dg-d" xmlns="http://www.w3.org/2000/svg"> |
| 6 | <title id="dg-t">How a branch grows on Branchwell</title><desc id="dg-d">Commits land on the main branch right away. Each one shows as new. Three votes up keep it for good. Three votes down take it back out. A side branch follows the same rule.</desc> |
| 7 | <style>.ln{stroke:currentColor;stroke-width:5;fill:none;stroke-linecap:round;opacity:.55}.t{font:600 14px system-ui,sans-serif;fill:currentColor}.s{font:13px system-ui,sans-serif;fill:currentColor;opacity:.75}</style> |
| 8 | <path class="ln" d="M40 70H480"/><path class="ln" d="M160 70c30 0 40 90 90 90h160"/> |
| 9 | <circle cx="70" cy="70" r="15" fill="#1f6b43"/><circle cx="160" cy="70" r="15" fill="#1f6b43"/><circle cx="300" cy="70" r="15" fill="#f2b84b"/> |
| 10 | <circle cx="400" cy="70" r="15" fill="none" stroke="#c4532d" stroke-width="4" stroke-dasharray="5 4"/><path d="M392 62l16 16M408 62l-16 16" stroke="#c4532d" stroke-width="4" stroke-linecap="round"/> |
| 11 | <circle cx="300" cy="160" r="15" fill="#f2b84b"/><circle cx="400" cy="160" r="15" fill="#f2b84b"/> |
| 12 | <text class="t" x="40" y="35">main</text><text class="t" x="250" y="200">your-idea</text> |
| 13 | <text class="s" x="40" y="112">3 up</text><text class="s" x="276" y="112">new</text><text class="s" x="366" y="112">3 down</text> |
| 14 | <g transform="translate(40 240)"><rect width="440" height="64" rx="18" fill="currentColor" opacity=".07"/> |
| 15 | <circle cx="30" cy="32" r="10" fill="#1f6b43"/><text class="s" x="48" y="37">kept for good</text> |
| 16 | <circle cx="170" cy="32" r="10" fill="#f2b84b"/><text class="s" x="188" y="37">new</text> |
| 17 | <circle cx="270" cy="32" r="10" fill="none" stroke="#c4532d" stroke-width="3" stroke-dasharray="4 3"/><text class="s" x="288" y="37">taken back out</text></g> |
| 18 | </svg></div>`; |
| 19 | |
| 20 | export function home(stats: { repos: number; companies: number }) { |
| 21 | return `<section class="hero"><div> |
| 22 | <div class="counter" data-visitor-odometer data-visitor-site="branchwell"></div> |
| 23 | <span class="eyebrow">Open Git hosting</span><h1>Every branch grows in the open.</h1> |
| 24 | <p class="lede">Branchwell hosts Git repositories that anyone can pull. Anyone signed in can push straight to a branch. There are no pull requests and no reviews. People vote on each commit instead.</p> |
| 25 | <div class="btns"><a class="btn" href="/research">Get the research</a><a class="btn ghost" href="/how-to-contribute">How to contribute</a></div> |
| 26 | </div>${DIAGRAM}</section> |
| 27 | <section class="sec"><h2>How it works</h2><p class="sub">Four steps, and nothing waits on a reviewer.</p> |
| 28 | <ol class="steps"> |
| 29 | <li><b>Pull</b><span>Clone any repository with plain Git. No account needed.</span></li> |
| 30 | <li><b>Push</b><span>Sign in with a passkey, make a push key, and push straight to a branch.</span></li> |
| 31 | <li><b>Checks</b><span>Every push is checked first: no secrets, no huge files, valid data. If it passes, it lands.</span></li> |
| 32 | <li><b>Vote</b><span>Each new commit is open to votes. 3 up keeps it for good. 3 down takes it back out.</span></li> |
| 33 | </ol></section> |
| 34 | <section class="sec grid2"><div><h2>Every company, in the open</h2> |
| 35 | <p class="sub">${stats.companies ? stats.companies + ' companies' : 'Each company'} ha${stats.companies === 1 ? 's' : 've'} an account here, with projects inside. Every one starts with its research: the full plan, and every public source summarized in plain words with a link to the original. It is all public domain. Pull it, read it, add to it.</p> |
| 36 | <div class="copy"><code id="clone-research">git clone https://branchwell.ai/sunlaid/research.git</code><button class="btn sm" type="button" data-copy="clone-research">Copy</button></div> |
| 37 | <p><a href="/companies">See every company</a> · <a href="/research">All the research</a></p></div> |
| 38 | <div class="cards"><div class="card"><h3>No pull requests</h3><p>Your commit goes in as soon as it passes the checks. The people who use a branch decide what stays.</p></div> |
| 39 | <div class="card"><h3>Passkeys only</h3><p>Sign in with your face, fingerprint or device PIN. No passwords to steal or forget.</p></div> |
| 40 | <div class="card"><h3>History stays honest</h3><p>Nothing is rewritten. A voted-down commit is taken back out with a new commit anyone can see.</p></div></div></section> |
| 41 | <section class="sec"><div class="band"><div><h2>New features, voted in</h2><p>Apps built on our platform mark every new feature with a small New badge and thumbs up and down. 3 thumbs up and the feature stays for good. 3 thumbs down and it goes away.</p></div> |
| 42 | <div><a class="btn" href="/features">Add it to an app</a></div></div></section> |
| 43 | <section class="sec" id="branch"><h2>Open your own branch</h2><p class="sub">Anyone can open a branch here without asking, under any name they like. Our code, designs and research are public domain and free to use.</p> |
| 44 | <div class="btns"><a class="btn ghost" href="/branchwell/source">See our source</a><a class="btn ghost" href="/repos">All projects (${stats.repos})</a></div></section>`; |
| 45 | } |
| 46 | |
| 47 | export const howToPull = `<section class="hero" style="grid-template-columns:1fr"><div class="prose"> |
| 48 | <span class="eyebrow">How to pull</span><h1 class="sm">Get any repository in one line</h1> |
| 49 | <p class="lede">Every repository on Branchwell is public. You don't need an account to read or pull.</p> |
| 50 | <h2>1. Get Git</h2> |
| 51 | <p>Mac: open Terminal and type <code>git --version</code>. If it isn't there, your Mac offers to install it. Windows: install Git from <a href="https://git-scm.com/downloads" rel="noopener">git-scm.com</a>. Linux: use your package manager, for example <code>sudo apt install git</code>.</p> |
| 52 | <h2>2. Clone</h2> |
| 53 | <pre><code>git clone https://branchwell.ai/sunlaid/research.git |
| 54 | cd research</code></pre> |
| 55 | <p>Every project lives inside its owner, so the address is <code>branchwell.ai/owner/project.git</code>. Swap in any one you like. You'll find them all on the <a href="/companies">companies page</a> and the <a href="/repos">projects page</a>.</p> |
| 56 | <h2>3. Stay up to date</h2> |
| 57 | <pre><code>git pull</code></pre> |
| 58 | <p>Run it any time to get the newest commits, including any that votes have taken back out.</p> |
| 59 | <h2>Want just one branch?</h2> |
| 60 | <pre><code>git clone --branch your-idea --single-branch https://branchwell.ai/sunlaid/research.git</code></pre> |
| 61 | <h2>No Git?</h2> |
| 62 | <p>You can read every file right on the site. Open a repository, click through its folders, and use <b>Raw</b> on any file to download it.</p> |
| 63 | <p class="btns"><a class="btn" href="/how-to-contribute">Next: how to contribute</a></p> |
| 64 | </div></section>`; |
| 65 | |
| 66 | export const howToContribute = `<section class="hero" style="grid-template-columns:1fr"><div class="prose"> |
| 67 | <span class="eyebrow">How to contribute</span><h1 class="sm">Push straight to a branch</h1> |
| 68 | <p class="lede">No pull requests and no waiting for a reviewer. If your commit passes the checks, it lands right away. Then people vote on it.</p> |
| 69 | <h2>1. Sign in with a passkey</h2> |
| 70 | <p>Go to <a href="/signin">Sign in</a>, pick a name, and make a passkey with your face, fingerprint or device PIN. There is no password and no email.</p> |
| 71 | <h2>2. Make a push key</h2> |
| 72 | <p>On <a href="/account">your account page</a>, make a push key for each computer. Git can't use passkeys, so this key is how Git proves the push is yours. We show it once. You can remove it any time.</p> |
| 73 | <h2>3. Let Git remember it</h2> |
| 74 | <pre><code># Mac |
| 75 | git config --global credential.helper osxkeychain |
| 76 | # Windows (Git for Windows) |
| 77 | git config --global credential.helper manager |
| 78 | # Linux |
| 79 | git config --global credential.helper store</code></pre> |
| 80 | <p>The first time you push, Git asks for a username and password. Type your Branchwell name and paste the push key as the password.</p> |
| 81 | <h2>4. Edit, commit, push</h2> |
| 82 | <pre><code>git clone https://branchwell.ai/stridewell/research.git |
| 83 | cd research |
| 84 | # edit a file, for example README.md |
| 85 | git add -A |
| 86 | git commit -m "Add a study on socket fit" |
| 87 | git push</code></pre> |
| 88 | <p>Git prints a link to the commits page, where people can vote on your work.</p> |
| 89 | <h2>Try something bigger on your own branch</h2> |
| 90 | <pre><code>git switch -c your-idea |
| 91 | git push -u origin your-idea</code></pre> |
| 92 | <p>Anyone can open a branch, under any name. Branches follow the same voting rule as commits.</p> |
| 93 | <h2>Start a new project</h2> |
| 94 | <p>Make one on the <a href="/new">new project page</a>, under your own name or a company you belong to. Or just push to a new name and it is made for you:</p> |
| 95 | <pre><code>git remote add origin https://branchwell.ai/your-name/my-project.git |
| 96 | git push -u origin main</code></pre> |
| 97 | <h2>What every push is checked for</h2> |
| 98 | <ul>${CHECKS_TEXT.map((t) => `<li>${esc(t)}</li>`).join('')}</ul> |
| 99 | <p>If a check fails, Git shows you why and nothing changes. Fix it and push again.</p> |
| 100 | <h2>Good research contributions</h2> |
| 101 | <ul><li>A real, public link anyone can open: a study, an official page, a dataset.</li><li>A short summary in your own words. No copied paragraphs.</li><li>No prices, no ads and no private personal details.</li></ul> |
| 102 | <p class="btns"><a class="btn" href="/rules">How votes work</a></p> |
| 103 | </div></section>`; |
| 104 | |
| 105 | export const rules = `<section class="hero" style="grid-template-columns:1fr"><div class="prose"> |
| 106 | <span class="eyebrow">How votes work</span><h1 class="sm">The whole system fits on one page</h1> |
| 107 | <p class="lede">There are no pull requests and no reviews. Anyone signed in can push commits straight to a branch. People vote on commits and branches. That's it.</p> |
| 108 | <h2>Commits</h2> |
| 109 | <ul><li>A commit lands as soon as it passes the checks. It shows as <span class="tag new">new</span>.</li> |
| 110 | <li><b>3 votes down</b> and it is taken back out of the branch, automatically. We add a new commit that restores the files it changed, so history stays honest. It shows as <span class="tag removed">removed</span>.</li> |
| 111 | <li><b>3 votes up</b> and it stays for good. It shows as <span class="tag kept">kept</span> and can't be voted out later.</li> |
| 112 | <li>Everything else stays in the branch.</li></ul> |
| 113 | <p>If a later commit already changed the same file again, the removal leaves that newer work alone and says so in the removal commit.</p> |
| 114 | <h2>Branches</h2> |
| 115 | <ul><li>Anyone can open a branch, under any name, without asking.</li> |
| 116 | <li><b>3 votes down</b> on a branch removes the whole branch. That name can't be pushed again, so pick a new one.</li> |
| 117 | <li><b>3 votes up</b> keeps the branch for good.</li> |
| 118 | <li>Each repository's main branch always stays. Its commits are still voted on one by one.</li></ul> |
| 119 | <h2>Fair votes</h2> |
| 120 | <ul><li>One vote per account on each commit or branch. You can change or take back your vote until it is decided.</li> |
| 121 | <li>New accounts can vote 24 hours after they're made.</li> |
| 122 | <li>You can vote your own work down, but not up. Others decide what stays.</li> |
| 123 | <li>Each network can make up to 3 new accounts a day.</li> |
| 124 | <li>Votes are public: each commit page lists who voted which way.</li></ul> |
| 125 | <h2>Checks come first</h2> |
| 126 | <ul>${CHECKS_TEXT.map((t) => `<li>${esc(t)}</li>`).join('')}</ul> |
| 127 | </div></section>`; |
| 128 | |
| 129 | export const features = `<section class="hero" style="grid-template-columns:1fr"><div class="prose"> |
| 130 | <span class="eyebrow">For apps</span><h1 class="sm">Let people vote on new features</h1> |
| 131 | <p class="lede">A new feature merges automatically once its checks pass. Then it shows a small <b>New</b> badge with thumbs up and thumbs down until people decide.</p> |
| 132 | <ul><li><b>3 thumbs up:</b> the feature stays for good and the badge goes away.</li> |
| 133 | <li><b>3 thumbs down:</b> the feature is switched off for everyone.</li> |
| 134 | <li>Until then it stays in the app, marked as new.</li></ul> |
| 135 | <h2>Add it to any app or site</h2> |
| 136 | <p>1. Load the widget once on every page. Pick a short id for your app.</p> |
| 137 | <pre><code><script src="https://branchwell.ai/widget/features.v1.js" data-app="yourapp" defer></script></code></pre> |
| 138 | <p>2. Mark each new feature with its own id. The badge appears next to it.</p> |
| 139 | <pre><code><button data-bw-feature="dark-mode">Dark mode</button> |
| 140 | <section data-bw-feature="weekly-summary"> |
| 141 | <h2 data-bw-badge>Weekly summary</h2> <!-- optional: where the badge goes --> |
| 142 | ... |
| 143 | </section></code></pre> |
| 144 | <p>That's all. The first time the widget sees an id, the feature starts as new. When people vote it down, the widget hides that element. When they vote it up, the badge stops showing.</p> |
| 145 | <h2>Voting</h2> |
| 146 | <p>Tapping a thumb opens a small Branchwell window where people sign in with their passkey and vote. One vote per person per feature. The same fair-vote rules apply as for commits.</p> |
| 147 | <h2>Reading the results yourself</h2> |
| 148 | <pre><code>GET https://branchwell.ai/api/features?app=yourapp</code></pre> |
| 149 | <p>It returns each feature's status (<code>new</code>, <code>kept</code> or <code>removed</code>) and its votes. Native apps can call it at launch and switch features on or off the same way.</p> |
| 150 | </div></section>`; |
| 151 | |
| 152 | export function research() { |
| 153 | const S: [string, string, string, string, string][] = [ |
| 154 | ['Git HTTP transfer protocols', 'Git project documentation', '', 'https://git-scm.com/docs/http-protocol', 'How Git talks to a server over plain HTTPS: the "smart" protocol Branchwell speaks for clone, pull and push.'], |
| 155 | ['Git on the Server: Smart HTTP', 'Pro Git, by Scott Chacon and Ben Straub', '2014', 'https://git-scm.com/book/en/v2/Git-on-the-Server-Smart-HTTP', 'Why one HTTPS address can serve anonymous reads and signed-in writes at the same time.'], |
| 156 | ['Git pack format', 'Git project documentation', '', 'https://git-scm.com/docs/gitformat-pack', 'The file format Git uses to send many objects at once, with deltas. Branchwell reads and writes it directly.'], |
| 157 | ['Web Authentication: an API for accessing public key credentials, Level 2', 'W3C Recommendation', '2021', 'https://www.w3.org/TR/webauthn-2/', 'The web standard behind passkeys. The site keeps only a public key; the private key never leaves your device.'], |
| 158 | ['Passkeys', 'FIDO Alliance', '', 'https://fidoalliance.org/passkeys/', 'An overview of passkeys: sign-in with a face, fingerprint or PIN that resists phishing and replaces passwords.'], |
| 159 | ['The Sybil attack', 'John R. Douceur, Microsoft Research', '2002', 'https://www.microsoft.com/en-us/research/publication/the-sybil-attack/', 'Shows that any open voting system can be gamed by one person making many identities. It is why we limit new accounts and make new accounts wait a day before voting.'], |
| 160 | ['Be bold', 'Wikipedia', '', 'https://en.wikipedia.org/wiki/Wikipedia:Be_bold', 'The long-running example of open editing without approval first: changes go live, and the community keeps or reverts them.'], |
| 161 | ['CC0 1.0 Universal', 'Creative Commons', '', 'https://creativecommons.org/publicdomain/zero/1.0/', 'The public domain dedication we use for our summaries, plans and code, so anyone can copy them without asking.'], |
| 162 | ['Durable Objects', 'Cloudflare documentation', '', 'https://developers.cloudflare.com/durable-objects/', 'The storage model we use: each repository lives in its own small database, so pushes and votes never race each other.'], |
| 163 | ]; |
| 164 | return `<section class="sec"><div class="prose"> |
| 165 | <h2 id="plan">How Branchwell works</h2> |
| 166 | <p><b>Where we are:</b> Live. Clone, pull and push work today over HTTPS, with passkey sign-in and voting.</p> |
| 167 | <p>Branchwell is a simple home for Git repositories. Anyone can pull. Anyone signed in can push straight to a branch. Instead of pull requests and reviewers, people vote on each commit: 3 votes down takes it back out, 3 votes up keeps it for good.</p> |
| 168 | <h3>How it works</h3><ol><li><b>Pull.</b> Plain Git over HTTPS, no account.</li><li><b>Push.</b> A push key made after passkey sign-in.</li><li><b>Check.</b> Every pushed file is checked before it lands.</li><li><b>Vote.</b> Commits and branches are kept or removed by 3 votes.</li></ol> |
| 169 | <h3>How it keeps going</h3><p>Branchwell runs on small serverless databases that cost little to run, and we cover that cost ourselves. There are no ads and no paid plans. The code is public domain, so anyone can run their own copy.</p> |
| 170 | <h3>How we're organized</h3><ul><li>Branchwell<ul><li>Platform: the Git server, storage and sign-in</li><li>Research: keeping sources accurate and summaries plain</li><li>Community: helping new contributors find their way</li></ul></li></ul> |
| 171 | <p class="small muted">Everyone on the team grows through the same three levels: Explorer (starting out), Builder (growing) and Guide (on the way to mastery).</p> |
| 172 | <h3>What we've decided</h3><ul><li>No pull requests and no reviews.</li><li>3 votes decide: down removes, up keeps.</li><li>Passkeys only.</li><li>History is never rewritten.</li></ul> |
| 173 | <h3>What comes next</h3><ul><li>Download any branch as a zip.</li><li>Search across repositories.</li><li>Sites that rebuild straight from their research here.</li></ul> |
| 174 | <h3>Start your own</h3><ol><li><b>Clone our source.</b> <code>git clone https://branchwell.ai/branchwell/source.git</code></li><li><b>Deploy it.</b> It runs as one Cloudflare Worker with a D1 database and Durable Objects.</li><li><b>Pick your own rules.</b> Change the vote threshold or the checks in a few lines.</li></ol> |
| 175 | <h2 id="sources">The research</h2> |
| 176 | ${S.map(([t, s, y, u, sum]) => `<p><b><a href="${u}" rel="noopener">${esc(t)}</a></b><br><span class="small muted">${esc(s)}${y ? ', ' + y : ''}</span><br>${esc(sum)}</p>`).join('\n')} |
| 177 | <p class="small muted">Our summaries are public domain (CC0): copy and share them freely. Each original source belongs to its authors.</p> |
| 178 | </div></section>`; |
| 179 | } |
| 180 | |
| 181 | export const careers = `<section class="hero" style="grid-template-columns:1fr"><div class="prose"> |
| 182 | <span class="eyebrow">Careers</span><h1 class="sm">Work with us</h1> |
| 183 | <p class="lede">Join our team. We're looking for software engineers, people who know Git and storage inside out, researchers who love a good source, writers and community guides. Tell us what you do and how we can reach you.</p> |
| 184 | <p><b>All our roles are part-time, up to 39 hours a week. Every team member earns a daily, automatic Bitcoin bonus based on performance, and get their health care through the holistic clinics we work with. Care outside those clinics is not covered.</b></p> |
| 185 | <form id="cr-form" novalidate style="max-width:640px"> |
| 186 | <label for="cr-name" style="font-weight:700;display:block;margin:0 0 8px">Name</label> |
| 187 | <input id="cr-name" name="name" required maxlength="120" autocomplete="name" style="width:100%;font:inherit;padding:14px;border-radius:999px;border:1.5px solid var(--line);background:var(--card);color:var(--fg);margin-bottom:14px"> |
| 188 | <label for="cr-email" style="font-weight:700;display:block;margin:0 0 8px">Email</label> |
| 189 | <input id="cr-email" name="email" type="email" required maxlength="200" autocomplete="email" style="width:100%;font:inherit;padding:14px;border-radius:999px;border:1.5px solid var(--line);background:var(--card);color:var(--fg);margin-bottom:14px"> |
| 190 | <label for="cr-request" style="font-weight:700;display:block;margin:0 0 8px">Message</label> |
| 191 | <textarea id="cr-request" name="request" required maxlength="4000" rows="6" style="width:100%;font:inherit;padding:14px;border-radius:16px;border:1.5px solid var(--line);background:var(--card);color:var(--fg)" placeholder="What work would you like to do with us?"></textarea> |
| 192 | <div style="position:absolute;left:-9999px" aria-hidden="true"><label>Leave this empty <input name="website" tabindex="-1" autocomplete="off"></label></div> |
| 193 | <p><button type="submit" class="btn">Join our team</button></p> |
| 194 | <p id="cr-msg" role="status" aria-live="polite"></p> |
| 195 | </form></div></section>`; |
| 196 | |
| 197 | export const privacy = `<section class="hero" style="grid-template-columns:1fr"><div class="prose"> |
| 198 | <span class="eyebrow">Privacy</span><h1 class="sm">Privacy</h1> |
| 199 | <p class="lede">We keep as little as we can, and we never sell or share it.</p> |
| 200 | <h2>What we keep</h2> |
| 201 | <ul><li><b>Your account name</b>, which is public, and when you made it.</li> |
| 202 | <li><b>Your passkey's public key.</b> Your face, fingerprint and PIN never leave your device and never reach us.</li> |
| 203 | <li><b>Push keys</b>, stored only as a one-way hash, with when each was last used.</li> |
| 204 | <li><b>What you push and how you vote.</b> Repositories, commits and votes are public, with your account name.</li> |
| 205 | <li><b>A salted hash of your network address</b> when you make an account, only to limit new accounts per network.</li> |
| 206 | <li><b>Careers requests</b> you send us, with the site name and time.</li></ul> |
| 207 | <h2>What we don't do</h2> |
| 208 | <ul><li>No passwords, no email sign-up, no ads and no ad trackers.</li><li>No third-party sign-in.</li><li>Our visitor counter counts visits without cookies or tracking you around the web.</li></ul> |
| 209 | <h2>Cookies</h2><p>One sign-in cookie, only after you sign in, so the site knows it's you. Nothing else.</p> |
| 210 | <h2>Hosting</h2><p>Branchwell is hosted on Cloudflare.</p> |
| 211 | <h2>Leaving</h2><p>You can remove your push keys at any time on your account page. Commits you pushed stay part of the public history, like any Git history.</p> |
| 212 | </div></section>`; |