Adventurer
Adventurer (hereinafter the “Application”) is a free web app that turns a GitHub profile into an RPG character card. Each card has a class, five stats, a rarity and a pixel art portrait, all worked out from what GitHub already shows publicly about the profile. You sign in with GitHub, make a card for yourself or for anyone else, and keep a timeline of your own card as it changes.
1. User Documentation
Section titled “1. User Documentation”The live instance is available at https://adventurer.spellware.dev.
Signing In
Section titled “Signing In”Select Sign in with GitHub. GitHub asks you to confirm, and the Application asks for no permissions at all. That means it can never read your private repositories, your email address or anything else that is not already public on your profile.
The Application needs you to sign in because GitHub limits anonymous requests to 60 an hour for everyone sharing an address, and allows each signed-in user 5,000 an hour. Making a card takes several requests, and using your own allowance means that the Application keeps working however many people use it.
You stay signed in until your GitHub token expires, or for eight hours if it has no expiry. Select Sign out in the header to end it sooner. Anyone can look at a saved card from its link without signing in.
Making a Card
Section titled “Making a Card”- Sign in. The first screen has a box with your own username in it.
- Type a GitHub username, or leave your own, and select Make card.
- The card appears, with buttons to download it and to copy its link.
A username is 1 to 39 characters: letters, digits and hyphens, not starting with a hyphen. If there is no such user, or GitHub is not answering, the Application says so.
Your own card is saved to your timeline. A card for anyone else is a preview. It is shown to you and never stored, so nobody can change or add to another person’s history.
Making cards is limited to 20 a minute. A card for somebody else uses your own GitHub allowance each time, and if that is used up the Application says so and you can try again later.
How a Card Is Worked Out
Section titled “How a Card Is Worked Out”The same public data always gives the same card. The /about page in the Application shows these rules from the same constants that the server uses.
Which Repositories Count
Section titled “Which Repositories Count”Only public repositories that are not forks are read. A repository counts when you own it, which covers up to 500 of them, most starred first. It also counts when GitHub lists it among the repositories you have recently contributed to with commits or pull requests, which covers up to 500 more. GitHub’s list covers roughly the last year. That is how work in organisations and in other people’s projects counts, and repositories you never touched do not. Each counted repository adds at most 1,000 stars, so one huge project cannot flood the stat. Pull requests and issues are counted from public items only.
If GitHub cannot give the list of repositories you have contributed to, the card is made from the repositories you own instead of failing.
The bytes of code in each language, across the counted repositories, are added up by class. The class with the most bytes wins, and a tie goes to the class listed first. A profile with no code in a listed language is a Novice.
| Class | Languages |
|---|---|
| Alchemist | Python, R, Julia, Jupyter Notebook |
| Artificer | Swift, Dart, Objective-C |
| Bard | HTML, CSS, SCSS, Vue, Svelte |
| Knight | Go, Java, Kotlin, C#, Scala |
| Mage | TypeScript, JavaScript |
| Ranger | Shell, PowerShell, Nix, HCL, Dockerfile |
| Rogue | Ruby, PHP, Perl, Lua |
| Sage | Haskell, OCaml, Elixir, Clojure, Erlang |
| Warden | Rust, C, C++, Zig, Assembly |
| Novice | None of the above |
Every stat is a whole number from 0 to 99. Counts use a log curve, round(99 * min(1, ln(1 + value) / ln(1 + cap))), so the first stars matter more than the ten-thousandth. Account age is a straight line.
| Stat | Input | Cap |
|---|---|---|
| Renown | Stars on counted repositories | 10,000 |
| Craft | Counted repositories | 200 |
| Valor | Pull requests opened | 2,000 |
| Insight | Issues opened | 1,000 |
| Endurance | Account age in years, in a straight line | 20 |
Rarity
Section titled “Rarity”The score is the mean of the five stats, rounded. It sets the rarity.
| Tier | Score |
|---|---|
| Common | below 28 |
| Uncommon | 28 to 44 |
| Rare | 45 to 59 |
| Epic | 60 to 74 |
| Legendary | 75 and above |
The caps and the thresholds were tuned against a run over real profiles, so that Legendary is rare among people who are simply active, and a brand new account is Common. If the rules are ever changed, a saved card keeps the numbers it was made with, and the timeline shows the difference the next time your card is saved.
The Portrait
Section titled “The Portrait”Every card has a pixel art scene with a character in it. The character is drawn in your browser from your username, your class and your rarity, so the same card always looks the same. Each class has its own scene. The card’s border glows in a colour that depends on the rarity, and a Legendary card has a rainbow border.
The portrait is made by a numbered version of the drawing code, and the version is stored with the card. A card is never redrawn by newer art, so a saved card looks as it did on the day it was made. If a card names a version that the page does not know, a plain placeholder figure is shown.
Your Own Card
Section titled “Your Own Card”- Your own card is saved at most once an hour. If you make it again within the hour, you are shown the latest saved card without asking GitHub.
- A new card is only saved if something has changed. If nothing has, you are told so, and your timeline stays as it was.
- Only the owner of a GitHub account ever saves a card, and only their own. This is checked by GitHub’s account number and not by the username, so renaming your GitHub account keeps one unbroken timeline.
Your Link
Section titled “Your Link”- Your first saved card gives you a random link, such as
/u/k7x2m9qpd4. The name is ten random letters and digits, so nobody can find your card by guessing your GitHub username. - You can choose your own name for the link: 3 to 32 characters, using lowercase letters, digits and hyphens, and not starting or ending with a hyphen. Select Change link name on your card. The name is not tied to your GitHub username, and the card always shows your real one.
- Names are first come, first served. If a name is taken, you are told so. Changing your link name is limited to 10 times an hour.
- A name is refused when it is offensive, or when it could pass for the people who run the site. A staff word such as
admin,moderator,officialorsupportas a part of the name is reserved, and so isspellwareornhcarrigananywhere in it. Hyphens do not get round either check. A name that is refused gets the same message whichever rule it broke, and you can choose another. - Changing your link name frees the old one immediately. Every link that used it stops working, anyone who has one will see nothing, and somebody else may take the name. The dialog says so before it changes anything.
The Timeline
Section titled “The Timeline”Once you have saved two cards, a timeline appears under your card, newest first. Each entry shows the date, the class, the rarity and the score, and what changed since the card before: a new class or rarity, the stats that moved, and whether you became or stopped being a Patron. Select an entry to see that card. Its address ends in the card’s number, for example /u/k7x2m9qpd4/3.
Cards are numbered from 1, and the number of a deleted card is never used again.
Downloading and Sharing
Section titled “Downloading and Sharing”Select Download PNG to save the card as an image at twice its size. The Application fetches your GitHub photo to put on it, and shows the first letter of the username instead if it cannot.
Select Copy link to copy the card’s address. Anyone with the link can see the card, signed in or not. When the link is shared in a chat or on a social network, the preview shows the owner’s name, class, rarity and score, which anyone with the link can already see. A link with no card, or a card that a moderator has taken down, gets the Application’s usual preview.
Deleting Your Cards
Section titled “Deleting Your Cards”On your own card, Delete this card removes one card, and Delete everything removes your whole history. Each one asks first and says what will happen. Deleting is permanent. Deleting everything also frees your link name, and you can save a new card straight away, with a new random link.
Patron Badge
Section titled “Patron Badge”A card gets a gold ribbon with a heart and a gold ring around the photo when its owner is a public sponsor of SpellWare on GitHub Sponsors, with an active recurring or one-time sponsorship. The badge never changes the stats or the rarity. GitHub does not show anyone a sponsor’s tier, and a private sponsor is never shown. If GitHub cannot say, the card is made without the badge, and it appears the next time your card is saved.
Reporting a Card
Section titled “Reporting a Card”If a card or its link name is offensive or misleading, signed-in visitors can select Report this card, under somebody else’s card. Choose a reason, which is that the link name is offensive or misleading, that the card pretends to be somebody else, or something else, and add up to 500 characters of detail if it helps. You can have one open report about a card at a time, and you can send five an hour. You cannot report your own card.
The owner of a card is never told who reported it.
Moderation
Section titled “Moderation”Moderators are a short list of people chosen by SpellWare. They see a Reports link in the header, which opens a list of open reports and the fifty most recently closed ones. For an open report, a moderator can:
- Dismiss it, which closes that report and changes nothing else.
- Reset the link name, which replaces the owner’s link name with a random one and frees the old name at once. It also closes every other open report about that card.
- Take the card down, which hides it from everybody except its owner and closes every other open report about that card. The owner sees a notice on their own card, and can still delete it.
A taken down card stays down even if its owner deletes their history and starts again. A moderator can restore it, and the card is then shown at its link again.
Feedback and Bugs
Section titled “Feedback and Bugs”Feedback and bug reports are welcome in the #bug-reports and #feature-requests forum channels in our Discord community.
2. Technical Documentation
Section titled “2. Technical Documentation”This section is for those interested in running their own instance of the Application. The Application is closed source, so this section describes how it is built and configured rather than linking to its code. Under the SpellWare Licence, you may run an unmodified copy for your own personal, non-commercial use. You may not host it for others, modify it except to prepare a contribution, or use it commercially.
Architecture
Section titled “Architecture”The Application is a pnpm monorepo, version 0.1.0, that requires Node.js 24 or newer.
| Package | What it holds |
|---|---|
packages/shared |
The class, stat and rarity rules, the card, the timeline comparison, the pixel avatar generator and the shapes that the server sends |
apps/server |
Fastify and MongoDB: GitHub sign in, sessions, the GitHub fetch, snapshots, the timeline, link names, deletion, reports and moderation, and the page server |
apps/client |
The browser app, built with Vite and plain TypeScript with no framework |
The server uses Fastify with the cookie, Helmet, rate limit and static file plugins, the official MongoDB driver and @nhcarrigan/logger. Errors and moderation alerts go to the alerts server through the logger.
How a Card Is Made
Section titled “How a Card Is Made”- The visitor signs in through GitHub’s OAuth web flow, with no scopes and with PKCE.
- The server exchanges the code for a token. That step needs the client secret, so it can never run in the browser.
- The server calls
GET /userto confirm who signed in, as GitHub’s documentation advises after every sign in. - The token stays in a server side session and is never sent to the browser.
- A lookup is a request to the server, which reads the public data for the username with the visitor’s token, using GitHub’s GraphQL API, and returns the card data. A card takes one query for the profile and its counts, then one request for every hundred repositories that the profile owns (at most five pages), and the same for the repositories it has contributed to.
Your own card is saved to the database as a snapshot, at most once an hour, and only when it differs from the latest one. The hourly limit is enforced in the database with an atomic counter, so two requests at once cannot both add a snapshot. The snapshots are also the cache, so there is no separate cache to keep.
The sponsor check is a separate query. If it fails, the card is made without the badge, so a problem with sponsorships never stops a card.
Sign In and Sessions
Section titled “Sign In and Sessions”Register these callbacks on the GitHub OAuth app, with wildcard matching switched off.
| Where | Callback | Scopes |
|---|---|---|
| Production | https://adventurer.spellware.dev/auth/callback/github |
None |
| Development | http://127.0.0.1:44132/auth/callback/github |
None |
A session is stored in MongoDB under a random identifier, which the browser holds in the adv_session cookie. The cookie is HTTP only, sent with SameSite=Lax, and marked secure when PUBLIC_URL is an HTTPS address. The session lasts as long as the token does, or eight hours when the token has no expiry, and MongoDB removes expired sessions on its own. While a visitor is signing in, two short lived cookies, valid for ten minutes and sent only to the sign in routes, hold the state and the PKCE verifier that prove the answer returns to the browser that started it.
The token is stored encrypted, with AES-256-GCM, under the key in SESSION_ENCRYPTION_KEY, which lives in the environment and not in the database. Each sealed token is bound to its own session, so a copy of the database is not a copy of anybody’s token, and a token cannot be moved from one session to another. Changing the key signs everybody out. Make a key with openssl rand -base64 32.
Environment Variables
Section titled “Environment Variables”Every variable is listed in prod.env, with secrets as 1Password references.
| Variable | Required | Purpose |
|---|---|---|
PORT |
No | The port the app listens on, bound to 127.0.0.1. Defaults to 3000, and prod.env sets 44132 |
PUBLIC_URL |
Yes | The public address, used for the OAuth callback and to check where changes come from |
GITHUB_CLIENT_ID |
Yes | The GitHub OAuth app’s client ID |
GITHUB_CLIENT_SECRET |
Yes | The GitHub OAuth app’s client secret |
SESSION_ENCRYPTION_KEY |
Yes | 32 bytes of base64, used to encrypt the tokens that sessions hold |
MONGO_URI |
Yes | The MongoDB connection string |
MONGO_DATABASE |
No | The database name. Defaults to adventurer |
SPONSORED_LOGINS |
No | The GitHub accounts, separated by commas, whose public sponsors earn the Patron badge. Leave it empty for none |
ADMIN_GITHUB_IDS |
No | The GitHub account numbers, separated by commas, of the moderators. These are numbers and not usernames. Leave it empty for none |
LOG_TOKEN |
No | The alerts server token. When it is empty, errors and alerts go to the console |
CLIENT_DIST |
No | The built browser app. Defaults to ../client/dist |
The server refuses to start if a required variable is missing or invalid.
Local Setup
Section titled “Local Setup”pnpm installpnpm devpnpm dev builds the shared package, then runs the shared compiler in watch mode, the server under tsx watch on port 44142 and the browser app on Vite, with hot reloading, on port 44132. Open http://127.0.0.1:44132 and not localhost, so that the cookies match the callback’s host. The command runs under op run --env-file=prod.env, and it overrides the ports and PUBLIC_URL.
A local run never uses the production database. It starts a MongoDB of its own, kept in apps/server/.dev-data, with a session key beside it. Delete that folder to start again from nothing.
| Command | What it does |
|---|---|
pnpm dev |
Runs the whole app for development |
pnpm build |
Builds the shared package, the server and the browser app |
pnpm lint |
Lints every package with no warnings allowed |
pnpm test |
Runs every test with coverage |
pnpm --filter @adventurer/server start |
Runs the built server under op run, with prod.env |
pnpm --filter @adventurer/server balance |
Runs real profiles through the rules and reports how the scores and rarities are spread. It needs a GH_TOKEN |
The server tests start an in memory MongoDB, so they need no database of their own.
Deployment
Section titled “Deployment”- Register the OAuth callbacks above on the GitHub OAuth app.
- Create the item in 1Password with the fields
prod.envrefers to, and setPUBLIC_URLtohttps://adventurer.spellware.dev. - Add the server block for
adventurer.spellware.devto the NGINX configuration and reload NGINX. It proxies the app on port 44132. - Build and start the app with
pnpm install && pnpm build && pnpm --filter @adventurer/server start. The start script runs the server throughop run, which resolves the secret references.
Security
Section titled “Security”- Every page response carries a Content Security Policy with a fresh nonce on each script, plus the other Helmet headers. The raw
index.htmlis never served as a file, because it would have no nonce. The policy allows inline event handler attributes, because the consent banner from the shared headers script needs them, so the client always shows text from other people as text and never as markup. - Making a card, deleting, choosing a link name, reporting and the moderators’ routes are rate limited, and every request that changes something must come from the Application’s own address.
| Route | Limit |
|---|---|
| Starting a sign in, and its callback | 20 a minute |
| Making a card | 20 a minute |
| Deleting a card or a history | 30 a minute |
| Choosing a link name | 10 an hour |
| Reporting a card | 5 an hour |
| The moderators’ routes | 60 a minute |
- The server checks that a moderator is one on every request. Hiding the link in the page is only a courtesy.
- Link names are checked against a list of offensive words, which comes from the
obscenitypackage, and against reserved words. Moderators may use the reserved words, but never an offensive one. - The page the server sends already carries its title, description and share preview tags, because crawlers for chat apps and social networks do not run scripts. Everything that goes into them comes from GitHub profiles, so it is escaped, and a name is cut to 60 characters.
- A takedown is stored by GitHub account number and apart from the link name, so deleting a history or changing a link name does not lift it.
Analytics
Section titled “Analytics”The Application loads the shared SpellWare headers script from cdn.spellware.dev/headers/index.js, which brings the footer, consent banner, Google Analytics, HubSpot tracking, advertising and the community popup. The page opts out of the shared header only, because the Application has its own navigation bar. The Application sends no analytics events of its own.
3. Legal Documentation
Section titled “3. Legal Documentation”The Application inherits SpellWare’s global legal documents:
- Privacy Policy: https://docs.spellware.dev/#/privacy
- Terms of Service: https://docs.spellware.dev/#/terms
- License: https://docs.spellware.dev/legal/license/
Data the Application Keeps
Section titled “Data the Application Keeps”The Application reads only what GitHub already shows publicly. The data below is what it keeps.
| Data | Kept |
|---|---|
| Your GitHub account number, username and a link to your photo | Kept in your session while you are signed in, and in each card that you save |
| Your GitHub token | Kept in your session, encrypted. It is never sent to your browser, and it is discarded when the session ends or you sign out |
| The cards you save | Your username, display name, photo link and account creation date, your counts of repositories, stars, pull requests and issues, the languages of your code, your class, stats, rarity and score, whether you were a public sponsor, and when the card was made. They are kept until you delete them |
| Your link name | Kept until you change it or delete your history |
| When you last saved a card, and the number of the last card | Kept so that the hourly limit and the card numbers work. A deleted card’s number is never reused |
| Reports | The username of whoever reported, the username of the owner, the link name at the time, the reason, the details, and what a moderator decided and when. Only moderators can see them |
| Takedowns | The account number of the owner, the account number of the moderator and when. This is kept even if the owner deletes their history, so that a takedown cannot be undone by starting again |
| Cards for other people | Not kept. A card that you make for somebody else is shown to you and never stored |
Moderation alerts go to the SpellWare alerts server. They carry the usernames of the reporter and the owner, the reason and the first 200 characters of the details.
The Application sets cookies only to sign you in. The session cookie holds your session while you are signed in, and two short lived cookies hold one off values while you sign in. The Application does not use local storage or session storage.
When you delete a card or your whole history, it is removed from the database, and deleting everything also frees your link name. Signing out ends your session.
Services Loaded by the Shared Headers
Section titled “Services Loaded by the Shared Headers”Like our other websites, the page loads the shared SpellWare headers script, which loads the following services. A consent banner asks for your choices. Their use of your data is covered by the Privacy Policy and by each provider’s own terms. Your cards are not sent to any of them.
| Service | Purpose |
|---|---|
| Secure Privacy | The cookie consent banner |
| Google Analytics | Measuring how the site is used |
| HubSpot | Site tracking and the chat widget |
| Google AdSense | Advertising |
| Tree-Nation | The tree planting widget in the footer |
4. Contributing Documentation
Section titled “4. Contributing Documentation”The Application’s repository is private, and it does not accept code contributions. Feedback and bug reports are welcome in the #bug-reports and #feature-requests forum channels in our Discord community.
Development Setup
Section titled “Development Setup”For maintainers, the project uses:
- TypeScript with the shared ESLint and TypeScript configs, and a zero warnings policy.
- Vitest for tests, in a
testfolder beside each package’ssrc, with 100% coverage enforced. - pnpm for package management, and GitHub Actions to lint, test and build every push to
mainand every pull request.
pnpm installpnpm lintpnpm testpnpm buildChanging the Rules
Section titled “Changing the Rules”The class, stat and rarity rules live in packages/shared/src/rules. After changing a cap or a threshold, run pnpm --filter @adventurer/server balance and look at how the scores and rarities are spread across well known developers, active contributors and random users. Then update the tables in this page and in the README, and the tests.
Changing the Avatar
Section titled “Changing the Avatar”The pixel avatar is made by a numbered generator version, which is stored with every card. The tests hold checksums of what version 1 draws, so that it can never change. To change how avatars look, add a new version and use it for new cards, so that saved cards are not redrawn.