152 Commits
Author SHA1 Message Date
ShayManorandClaude Opus 5 27645048f1 feat(deploy): add self-host compose file and document self-hosting
The repo had three Dockerfiles but nothing that ran them together, and the
README never mentioned self-hosting. The only deploy path was deploy/compose.yml,
which is bound to the production box: it pulls private ghcr images and hard-fails
on seven env vars including OAuth credentials, so nobody else could run it.

Every one of those vars already has a default in the service config; the
:?missing guards are a production-deploy check, not an application requirement.
This adds a root compose file that builds the three services from source and
needs only GITHUB_PAT and FETCHER_INTERNAL_TOKEN.

deploy/compose.yml is unchanged, so production is unaffected.

Verified by running it: all three images build, all five containers start, the
generator serves the SPA and /api/health, and edge answers /<username> with
upstream_ok true.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-23 10:33:26 -07:00
shayandClaude Opus 5 107273a1c8 fix(auth): send an https redirect_uri so GitHub sign-in works
The OAuth app registers https://gh-stats.com/api/auth/github/callback, but
the app was sending the http:// form. GitHub compares redirect_uri to the
registered callback character for character, so it refused every attempt
with "The redirect_uri is not associated with this application" and showed
users a warning that the app might be redirecting them somewhere they were
not expecting. Sign-in has been failing for everyone, and it gates themes,
custom tags and achievements.

_derived_redirect_uri built the URL from X-Forwarded-Proto, falling back to
request.scheme. The cloudflared tunnel does not reliably forward that
header, so the scheme resolved to http. The comment above it claimed the
headers are set, which is what hid this.

Anything that is not localhost or 127.0.0.1 is https. Local dev keeps
working over plain http, pinned by a test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-23 09:38:26 -07:00
shay 12f6890f57 feat(readme): add migration guide for transitioning from github-readme-stats. 2026-08-22 16:33:29 -07:00
shay 584306beb0 feat(api): add widget_name parameter to render_composite_adhoc function. 2026-08-22 16:33:24 -07:00
shayandClaude Opus 5 319f37761c chore: add MIT license
The repo had no license file, which means all rights reserved: nobody
could legally fork or reuse it. MIT is the category norm.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-22 16:10:44 -07:00
shayandClaude Opus 5 faf41ad952 feat(frontend): show the product, keep work across sign-in, add social preview
Of 27 people who typed a username in the last 14 days, 15 left before a
widget rendered. The landing page showed zero pixels of a product whose
entire value is visual, so it now leads with a live example card and says
concretely what you get.

Sign-in used to discard everything: with no router the OAuth `next` is
always "/", so users came back to an empty search box with their theme,
widget order and achievements gone. Persist work-in-progress to
sessionStorage and restore it on mount.

The Workshop preview seeds from demo data (grade A, 842 commits,
collaborators named alex/jordan/sam) with nothing saying so, so users saw
numbers they knew were wrong. Label it until real data arrives.

Add title, description, canonical, OG and Twitter tags, robots.txt and a
sitemap. The page was a 445-byte shell titled "GitHub Widgets", so every
link shared anywhere rendered with no image and no description.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-22 16:10:44 -07:00
shayandClaude Opus 5 0904c4bb9f feat(generator): raise enrollment ceiling, add burst guard, stop enqueue loop
ENROLLMENT_DAILY_CAP was 50, so any traffic spike past 50 new users in a
day was turned away with a rate_limited card. Raise the default to 500 and
add ENROLLMENT_HOURLY_CAP=60. The hourly guard is the one that actually
protects the shared PAT: a new user costs ~37 REST calls (p90 ~104)
against a 5000/hr budget, and a spike arrives inside an hour rather than
spread over a day. Counted off users.enrolled_at, so no schema change.

Also stop an unbounded enqueue loop. `name` is drawn inside the composite
and never persisted standalone, and `achievements` renders nothing until
the user authors one, so their SVG is permanently absent and every request
re-enqueued a build that could never produce it. Only self-heal when no
build has actually landed, keyed off widget_data for the current hash.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-22 16:10:44 -07:00
shayandClaude Opus 5 769cde552d feat(widgets): attribution on every widget, and make it legible
Five of the seven standalone widgets and all three placeholder cards
carried no attribution at all, and where it did render it was font-size 9
at opacity 0.5 (about 2.1:1 contrast) at the bottom of a 1500px card. Each
embedded widget sits on a public profile and is the only organic
acquisition surface we have.

Shared helper so the styling can't drift again. font-size 10, opacity
0.75 (about 3.1:1), still using the theme's text_secondary so it stays
roughly 4x fainter than the user's own content. Composite output is
byte-identical in size; four standalone cards grow 16px where the footer
would otherwise collide with existing content.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-22 16:10:26 -07:00
shayandClaude Opus 5 06ab1c878e fix(fetcher): guard REST calls so a rate limit can't poison user records
The five REST calls parsed `.json()` with no status check, so a 403
{"message": "API rate limit exceeded..."} body was returned as user data.
`_is_github_not_found` only matched "Not Found", so it was recorded as a
successful fetch and upsert_user overwrote the user's last-good row. Every
user touched during the exhaustion window then served a blank card for up
to 24h while /metrics reported ok.

Reuse the existing `_raise_if_transient` on all five so exhaustion raises
GitHubTransientError before the upsert, preserving last-good and letting
the caller retry. `_raise_if_transient` was GraphQL-shaped and crashed on
the JSON arrays the list endpoints return, so it now ignores non-dict
bodies. A rate limit inside the per-repo fan-out aborts the fetch; a 404
on a single repo stays non-fatal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
2026-08-22 16:10:26 -07:00
shay eea1734a04 fix(languages): center donut chart and legend based on card midline. 2026-07-25 16:23:28 -07:00
shay fe4bb4e87e fix(api): normalize GitHub usernames to lowercase and update tests. 2026-07-19 21:01:40 -07:00
shayandClaude Opus 4.8 0586f83a33 fix(fetcher): keep last-good counts on GitHub rate limits + expose fetch metrics
Rate-limited / 5xx / network failures were silently returning 0 from the
commit- and PR-count paths, then overwriting good values in fetcher.db —
turning a traffic spike into permanently-wrong "0 commits" cards. Raise
GitHubTransientError instead so the fetch aborts and the last-good row is
retained; genuine NOT_FOUND still yields 0.

Add a shared fetch-outcome counter (fetch_metrics table, spanning the web
workers and the cron container) surfaced at an unauthenticated GET /metrics
as ghstats_fetch_total{outcome="ok|not_found|rate_limited|error"}, so rate
limits are visible to the monitoring stack instead of dying silently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-18 11:45:42 -07:00
shay d1e89fb1c3 fix(api): normalize GitHub usernames to lowercase and update tests. 2026-06-12 01:37:08 -07:00
shay e53d1cfbe0 fix(api): normalize GitHub usernames to lowercase and update tests. 2026-06-12 01:17:53 -07:00
shay c54b5ac6ff feat(ResultScreen): wraps embed image markdown in a link to origin 2026-06-11 21:33:39 -07:00
shay ceac269738 feat(ResultScreen): wraps embed image markdown in a link to origin 2026-06-11 16:12:06 -07:00
shay 78299fa2b9 feat(GrowthChart): refactor y-coordinate mapping and add 2026-05-29 10:27:45 -07:00
shay 410b503877 feat(Analytics): add daily stats rollup to persist data beyond pruning 2026-05-27 10:47:42 -07:00
shay 61b8090c64 feat(api): add endpoint for retrieving growth data for the dashboard 2026-05-27 10:28:51 -07:00
shay a1d1813a51 feat(api): add endpoint for retrieving growth data for the dashboard 2026-05-27 10:23:49 -07:00
shay f66088e5d6 feat(api): add endpoint for retrieving growth data for the dashboard 2026-05-27 10:21:32 -07:00
shay 99c40cb0ce feat(api): add endpoint for retrieving growth data for the dashboard 2026-05-27 10:16:11 -07:00
shay e7a0521ff6 feat(api): implement self-healing build enqueue for user widgets 2026-05-26 15:23:14 -07:00
shay 2be8dc1ca3 feat(firebase): add Firebase initialization script to index.html 2026-05-26 15:20:41 -07:00
shay 369d42bb5f feat(api): implement auto-enrollment for unknown users on first hit 2026-05-26 15:10:20 -07:00
shay 151f330d31 feat(analytics): add request tracking decorator for API endpoints 2026-05-12 01:47:13 -04:00
shay 01927b2173 feat(analytics): include render-only users in activity count query 2026-05-11 23:34:57 -04:00
shay d4cbbae82a feat(api): add basic auth protection to /dev dashboard route 2026-05-11 19:03:26 -04:00
shay ef48d2581b feat(admin dashboard): add admin dashboard 2026-05-11 18:26:43 -04:00
shay 00bf46968a feat(admin dashboard): add admin dashboard 2026-05-11 18:25:09 -04:00
shay ab7c9b32aa feat(README): update 2026-05-08 19:46:01 -04:00
shay 05efac8fd2 feat(README): update 2026-05-08 19:45:37 -04:00
shay 9d15dd6c94 feat(grade): add data attributes for footer attribution in widgets 2026-05-06 16:38:59 -04:00
shay 8f7b27f806 feat(grade): add footer attribution for visual consistency in widget 2026-05-06 10:32:00 -04:00
shay 99378e13cd feat(api): add compatibility route for top-langs to handle upstream URLs. 2026-05-06 10:26:53 -04:00
shay 9639051398 feat(ResultScreen): add widget status and manual refresh functionality. 2026-05-04 21:52:44 -04:00
shay 8dbbd16cf9 feat(api): auto-enroll users typing unknown usernames into workshop 2026-05-04 16:34:12 -04:00
shay 6edf98334c feat(api): add idempotency check for already queued builds in callback 2026-05-04 15:52:03 -04:00
shay 673eb5b39d feat(tests): implement dynamic GraphQL response handling for tests 2026-05-04 12:56:52 -04:00
shay 4a1d31ffdd feat(api): implement async fetch with callback to enqueue build job 2026-05-04 12:35:41 -04:00
shay 50dd73a0de feat(api): distinguish between not enrolled and not found user statuses 2026-05-03 20:38:21 -04:00
shay 954f259b8f feat(worker): update worker to render and persist SVGs with widget data 2026-04-25 12:28:38 -04:00
shay 7f1e53cfad feat(db): normalize usernames in enrollment_rank for case insensitivity 2026-04-22 12:50:14 -04:00
shay 5102a36238 feat(workshop): refine login banner to display only for signed-in users. 2026-04-21 15:40:46 -04:00
shay 9cc9de2147 feat(api): add shortcut for rendering grade widget with username query. 2026-04-21 15:09:17 -04:00
shay a4ca81eab9 feat(workshop): simplify button visibility and update user message. 2026-04-21 14:46:46 -04:00
shay 118c8b7cc4 feat(workshop): add drag-and-drop functionality for achievements list 2026-04-21 14:10:37 -04:00
shay 113e4747cf feat(readme): replace hero widget image with composite widget example 2026-04-21 14:09:13 -04:00
shay a06bd2a20c feat(readme): replace hero widget image with composite widget example 2026-04-21 14:07:26 -04:00
shay 8941ed2f15 feat(readme): replace hero widget image with composite widget example 2026-04-21 14:07:15 -04:00
shay 048756c787 feat(workshop-screen): add generate button for editable users 2026-04-21 11:43:00 -04:00
shay fc4e8e4da5 feat(readme): update instructions and add table of contents section 2026-04-20 16:13:28 -04:00
shay b5bba19d46 feat(readme): update instructions and add table of contents section 2026-04-20 16:05:42 -04:00
shay 795f49d0a8 feat(api): update ResultScreen to use fallback URL for embed snippet 2026-04-20 16:05:33 -04:00
shay 451cb45788 feat(api): add sanitize_settings_query function for URL params handling 2026-04-20 15:04:15 -04:00
shay 96dc98142f feat(composite): add show_name parameter to control header visibility. 2026-04-20 15:04:09 -04:00
shay b66f966adb feat(workshop): refactor achievements section for improved layout. 2026-04-20 14:38:29 -04:00
shay 599c1ed672 feat(processor): refactor byte tally logic for authored repositories only. 2026-04-20 14:19:26 -04:00
shay fdd6b61172 feat(rendering): adjust text position in SVG for better visibility. 2026-04-20 14:19:18 -04:00
shay 13cc2b4eed feat(build-system): introduce BUILD_VERSION for widget invalidation logic. 2026-04-20 14:09:04 -04:00
shay a88561073a feat(result-screen): add onRegenerate prop to ResultScreen component. 2026-04-20 13:56:43 -04:00
shay 58fd6fbe67 feat(streaks): replace show_dates with customizable color setting. 2026-04-20 13:49:21 -04:00
shay 39d07fb7e0 feat(processor): add consistency scoring based on active commit weeks. 2026-04-20 13:43:08 -04:00
shay bd59910e54 feat(workshop): fetch and set user-specific widget settings on load. 2026-04-20 13:33:10 -04:00
shay e60acaca74 feat(workshop): implement drag-and-drop reordering for widgets. 2026-04-20 13:28:33 -04:00
shay ca795f7e71 feat(api): add 'streaks' to allowed widgets and settings structure. 2026-04-20 13:05:40 -04:00
shay 4febce9fca feat(api): add 'streaks' to allowed widgets and settings structure. 2026-04-20 13:05:34 -04:00
shay f43beb2ef6 feat(workflows): add health check workflow for automated monitoring. 2026-04-20 12:57:58 -04:00
Shay ManorandGitHub b98b32f030 Merge pull request #3 from ShayManor/feat/streaks-widget
Feat/streaks widget
2026-04-20 12:45:38 -04:00
shay 1d0fd3013e feat(streaks): persist streaks on refresh and pass to renderer
Phase 1 worker now reads the stored streak, computes an updated one via
processor.compute_streaks, persists it to the DB (preserving the all-time
max across settings changes), and includes it in widget_data. Phase 2
_render_widgets pre-reads the stored streak and passes it to the processor.
2026-04-20 11:52:22 -04:00
shay 788470cae0 feat(streaks): enable streaks widget by default 2026-04-20 11:49:43 -04:00
shayandClaude Opus 4.7 f23449a17e feat(streaks): render streaks widget in generate_widgets_from_github
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 11:48:09 -04:00
shay cb7a00d7c4 feat(streaks): add streaks widget renderer
Add render_streaks_widget() to generator/src/widgets/streaks.py with
flame/trophy icons, two-column layout, optional date display, and
export it from the widgets package; append 3 smoke tests (all 11 pass).
2026-04-20 11:45:51 -04:00
shayandClaude Sonnet 4.6 3b00a0aeac feat(streaks): compute current and max streak with grace day
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 11:42:59 -04:00
shayandClaude Sonnet 4.6 7fb1ba3e01 feat(streaks): add user_streaks table and get/put helpers
Adds the user_streaks table to settings.db schema and implements
get_user_streak / put_user_streak helpers with upsert semantics.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-20 11:40:13 -04:00
shay dd4a3d50d8 feat(streaks): add StreakData model 2026-04-20 11:36:45 -04:00
shay 5a2bc11840 feat(ui): enhance AuthButton styling and position for better UX. 2026-04-19 21:51:30 -04:00
shay fa96adb5d1 feat(docs): update instance URL and enhance README formatting. 2026-04-19 21:51:23 -04:00
Shay ManorandGitHub 728f3f038d Merge pull request #2 from ShayManor/oauth
Oauth
2026-04-19 21:02:25 -04:00
shayandClaude Opus 4.7 f9caa61c77 fix(frontend): send cookies on /generate POST
Without credentials: 'include', the session cookie isn't attached and
the OAuth-guarded endpoint returns 401.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 20:10:14 -04:00
shayandClaude Opus 4.7 9e837519cc feat(deploy): wire OAuth secrets; rename env vars off GITHUB_ prefix
GitHub Actions rejects secret names starting with GITHUB_. Rename the
OAuth env vars to GH_OAUTH_* in config.py, compose.yml, and the deploy
workflow so the values can flow through Actions secrets into the
generator container.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 20:02:52 -04:00
shayandClaude Opus 4.7 be8823c4cf chore(frontend): delete lib/editToken.ts (replaced by OAuth)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 19:18:32 -04:00
shay ccdd8231ce feat(frontend): gate WorkshopScreen edit UI on OAuth login match 2026-04-19 19:16:59 -04:00
shay cd927e686f feat(frontend): AuthButton — GitHub sign-in / avatar chip 2026-04-19 19:14:06 -04:00
shayandClaude Sonnet 4.6 8ccc0af1cf feat(frontend): App fetches /me, removes editToken plumbing
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 19:12:36 -04:00
shay b2baded94a feat(frontend): add lib/auth.ts with fetchMe, signInUrl, signOut 2026-04-19 19:10:05 -04:00
shay 8b7f999adc feat(api): per-login mutate rate limit layered on per-IP 2026-04-19 19:09:04 -04:00
shay 0cd7bf339d feat(api): remove public /enroll endpoint and auto-enroll on /data 2026-04-19 19:06:38 -04:00
shay 91f6328efd feat(api): /generate and /refresh use OAuth session; remove edit_token helpers 2026-04-19 19:03:16 -04:00
shay 4ee71e0b86 feat(api): PATCH /settings uses OAuth session + same-origin 2026-04-19 18:59:46 -04:00
shayandClaude Opus 4.7 eb4b68bf0d feat(api): OAuth callback — verify state, fetch profile, implicit enroll
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 18:57:20 -04:00
shayandClaude Opus 4.7 98c40ff993 feat(api): add /api/auth/github/login with CSRF state + local-only next
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 18:54:44 -04:00
shay a6356d4d1d feat(api): add /api/auth/me and /api/auth/logout 2026-04-19 18:53:12 -04:00
shay 232812b3a0 feat(api): configure Flask session + init OAuth client 2026-04-19 18:51:22 -04:00
shay 4602bb9494 test(auth): unit tests for require_github_owner and require_same_origin 2026-04-19 18:49:39 -04:00
shay ccd0f63fa8 feat(auth): add OAuth client + require_github_owner/require_same_origin decorators 2026-04-19 18:48:14 -04:00
shay ec9d4c3672 db: remove dead _hash_edit_token; convert verify_edit_token to stub
_hash_edit_token was only called by verify_edit_token and has no remaining
callers in db.py (enroll no longer hashes tokens). Remove it along with the
unused 'secrets' and 'hmac' imports.

Keep verify_edit_token as a NotImplementedError stub since api.py's
require_edit_token decorator still references it. Task 12 will remove both
the decorator and this function together when switching to session-based auth.
2026-04-19 18:47:11 -04:00
shay 22483aea19 db: enroll() accepts github profile; no longer returns edit_token 2026-04-19 18:45:26 -04:00
shay 57b782ceaf db: add github_id and github_avatar_url columns + set_github_profile 2026-04-19 18:44:01 -04:00
shay 4822272b49 config: add GitHub OAuth + session env vars 2026-04-19 18:40:28 -04:00
shayandClaude Opus 4.7 1501139143 deps: add authlib for GitHub OAuth
Pins authlib>=1.3,<2 so the generator can register a GitHub OAuth
client for the upcoming login flow.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-19 18:39:45 -04:00
shay 58e794fd57 feat(tags): add auto-awarded profile tags and validation utilities. 2026-04-19 09:37:32 -04:00
shay ca74e91e3e feat(readme): update README to describe new SVG widget features. 2026-04-19 09:34:40 -04:00
shay 016583c9f3 feat(api): implement per-user edit token for settings mutations 2026-04-19 09:34:26 -04:00
shay 3ecb6ad67b feat(tags): implement custom tag color merging and label support 2026-04-18 14:52:32 -04:00
shay 3e70e4b4ef feat(languages): add hidden languages picker and enrich language data 2026-04-18 13:39:44 -04:00
shay 5198eab86a feat(icons): replace inline SVGs with consistent JSX properties for icons 2026-04-18 13:17:00 -04:00
shay 12fb6c331b feat(worker): add achievements parameter to widget settings processing 2026-04-18 13:05:49 -04:00
shay 89a05f2a59 chore(WorkshopScreen): update ICONS type from JSX.Element to ReactNode 2026-04-18 12:51:48 -04:00
shay 3aebd40279 chore(favicon): replace old SVG with new design for favicon icon
chore(ResultScreen): simplify embed section layout and improve copy button
chore(WorkshopScreen): replace emoji icons with inline SVGs for consistency
chore(index.html): update page
2026-04-18 12:50:23 -04:00
shay eadd074402 chore(App): add PATCH request to sync user settings with backend before render 2026-04-18 12:40:16 -04:00
shay dd45d49c22 chore(ResultScreen): add copy functionality for embed snippet button 2026-04-18 12:35:27 -04:00
shay 8ac657b874 chore(ResultScreen): update props to reflect SVG generation process changes 2026-04-18 12:17:25 -04:00
shay 7b2301cec0 chore(api): rename test function for clarity on enrollment behavior 2026-04-18 11:58:02 -04:00
shay f9c59d934d chore(api): add asynchronous build kickoff for improved responsiveness 2026-04-18 11:26:25 -04:00
shay 3ffb2cfb6f chore(frontend): add demo data 2026-04-18 11:15:16 -04:00
shay 79b9c31197 feat(api): implement precomputed widget data storage and retrieval. 2026-04-18 11:13:43 -04:00
shay f0c6edacf6 feat(api): add endpoint for fetching computed widget data by username. 2026-04-18 10:54:41 -04:00
shay a63c1891a0 feat(deploy): change deployment runner from minipc to self-hosted. 2026-04-18 01:06:59 -04:00
shay 873ca512bd feat(readme): update Docker badge to reflect new deployment workflow. 2026-04-18 00:52:46 -04:00
shay 19a357d92b feat(readme): remove references to deleted production pipeline design. 2026-04-18 00:02:34 -04:00
Shay ManorandGitHub a96b0d0b3f Merge pull request #1 from ShayManor/smanor/production-pipeline
Split monolith into fetcher/generator/edge services + React SPA + CI
2026-04-17 18:38:38 -04:00
shay 181668a3b3 fix(generator): fix import paths + add service config constants 2026-04-17 18:37:44 -04:00
shay 83c4227d5f ci: add tests + docker build workflows with status badges
- tests.yml: matrix-run pytest for fetcher/generator/edge on push + PR
- docker.yml: matrix-build each service's Dockerfile with buildx cache
- README badges reflect both workflow statuses
2026-04-17 18:13:18 -04:00
shay 814bbf7d8d chore: final cleanup — gitignore editor caches, track plan + spec docs 2026-04-17 17:21:36 -04:00
shay 74047b28fc docs: top-level README + CLAUDE.md reflect three-service layout 2026-04-17 17:19:23 -04:00
shay a2e7a52169 docs(frontend): update README for new location + API contract 2026-04-17 17:17:36 -04:00
shay 2ff5d21b1c feat(generator): add multi-stage Dockerfile (node build -> python runtime) 2026-04-17 17:16:45 -04:00
shay 3e0b69cacd fix(gitignore): scope Python lib/ to project root so frontend src/lib is tracked 2026-04-17 17:15:59 -04:00
shay 917ad098f7 feat(generator): move frontend into generator + namespace API calls under /api/ 2026-04-17 17:14:32 -04:00
shay f93c39d022 docs(edge): add README 2026-04-17 17:09:00 -04:00
shay 4edc66d1bb feat(edge): add cache-first SVG proxy with Flask-Caching + Flask-Compress 2026-04-17 17:08:37 -04:00
shay 5ba5ec4f4b feat(edge): scaffold config, requirements, Dockerfile 2026-04-17 17:07:12 -04:00
shay a3c17a15da test(generator): add end-to-end integration test + README 2026-04-17 17:06:03 -04:00
shay c0401a8a28 feat(generator): add poll cron that enqueues on payload-hash change 2026-04-17 17:03:11 -04:00
shay c50393467e fix(generator): harden SPA path handler and cache patch_settings read
- Drop the os.path.isfile pre-check in the SPA catch-all; let
  send_from_directory be the only gatekeeper so raw user-supplied
  path segments never reach os.path.isfile on a joined path.
- Reuse the first db.get_settings result in patch_settings so a
  race-induced None doesn't raise an unhandled AttributeError.
2026-04-17 17:01:56 -04:00
shay d448825bed feat(generator): add Flask API with SPA static, auth stub, rate limit 2026-04-17 16:59:25 -04:00
shay 961a3330e1 fix(generator): invalidate composite cache on not_found + drop unused import
Cache entry for widget:composite:{username} was not invalidated when a
user's fetcher payload transitioned to not_found, serving stale SVGs.
2026-04-17 16:56:45 -04:00
shayandClaude Opus 4.7 07221a1329 feat(generator): add build worker with retries and placeholder fallback
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 16:53:17 -04:00
shayandClaude Opus 4.7 97ad1c2b39 feat(generator): add typed HTTP client to the fetcher service
Implements thin wrapper over fetcher's two main endpoints: GET /data/<user>
and POST /fetch. Used by worker.py (rebuilds), api.py (user lookups), and
cron.py (bulk refresh). Includes authentication via X-Internal-Token header.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-17 16:47:38 -04:00
shayandClaude Sonnet 4.6 540d172011 feat(generator): add three placeholder SVG variants
Adds placeholder.py with building/rate_limited/not_found variants that use the same card_wrapper + theme system as real widgets, plus pytest coverage for all three variants and the unknown-variant error path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:46:12 -04:00
shay a0c5e8a86e feat(generator): add no-op cache wrapper (enables Redis later via env) 2026-04-17 16:44:38 -04:00
shayandClaude Sonnet 4.6 361c938985 feat(generator): add settings+widgets db with jobs, enrollment, LRU
Implements generator/src/db.py with two WAL-mode SQLite databases (settings.db for
users/jobs/enrollments, widgets.db for SVG cache with current_widget pointer) and
generator/tests/test_db.py covering all 10 TDD scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:42:43 -04:00
shayandClaude Sonnet 4.6 3525144aeb feat(generator): scaffold + move widgets/themes/models/utils/processor/config
- Add generator/requirements.txt and generator/pytest.ini
- git mv src/widgets, themes, models, utils, data/processor.py, config.py into generator/src/
- Fix relative imports in processor.py (moved up one level: .. → .)
- Append service-specific env vars (PORT, DB paths, FETCHER_URL, etc.) to generator/src/config.py
- git rm retired src/db, src/data/__init__.py, src/__init__.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:39:29 -04:00
shayandClaude Sonnet 4.6 cb3ace8dcd feat(fetcher): add cron refresh + GC and service README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:34:52 -04:00
shayandClaude Sonnet 4.6 d77dea20bc feat(fetcher): add Flask API with auth, auto-fetch, avatar
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:32:59 -04:00
shayandClaude Sonnet 4.6 1a3caff269 feat(fetcher): move GitHub client into fetcher service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:30:52 -04:00
shay 15ad9c81aa chore(cleanup): remove stale widget_shaymanor.svg build artifact 2026-04-17 16:26:19 -04:00
shayandClaude Sonnet 4.6 832f94c1b9 feat(fetcher): add SQLite db module with WAL, payload hashing, GC
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 16:25:05 -04:00
shay f0e6d9439e feat(fetcher): scaffold config, requirements, pytest, Dockerfile 2026-04-17 16:22:46 -04:00
shay 7aa5f9d5a0 chore(cleanup): remove retired entry points and build artifacts 2026-04-17 16:22:04 -04:00
shay 9feae9ff35 chore(scaffold): create fetcher/generator/edge service folders 2026-04-17 16:21:26 -04:00
161 changed files with 19947 additions and 1194 deletions
+14
View File
@@ -0,0 +1,14 @@
# Copy to .env and fill in. Only these two matter.
# A GitHub personal access token. Classic or fine-grained, no scopes needed
# for public data - it is only used to raise your GitHub API rate limit.
# Create one at https://github.com/settings/tokens
GITHUB_PAT=
# Shared secret the three services use to talk to each other. Any random
# string; it never leaves your machine. Generate one with:
# openssl rand -hex 32
FETCHER_INTERNAL_TOKEN=
# Port the card service listens on (http://localhost:PORT).
#GHSTATS_PORT=5003
+92
View File
@@ -0,0 +1,92 @@
name: build and deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
REGISTRY: ghcr.io
jobs:
build:
name: build ${{ matrix.service }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
service: [fetcher, generator, edge]
outputs:
image_tag: ${{ steps.tag.outputs.value }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
if: github.event_name == 'push'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute image tag (sha-<short>)
id: tag
env:
SHA: ${{ github.sha }}
run: echo "value=sha-${SHA:0:7}" >> "$GITHUB_OUTPUT"
- name: Compute image name (lowercase)
id: img
env:
OWNER: ${{ github.repository_owner }}
SERVICE: ${{ matrix.service }}
run: echo "name=${REGISTRY}/${OWNER,,}/ghstats-${SERVICE}" >> "$GITHUB_OUTPUT"
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.img.outputs.name }}
tags: |
type=raw,value=${{ steps.tag.outputs.value }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Build ${{ matrix.service }} image
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.service }}
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.service }}
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
deploy:
name: deploy to mini PC
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: Deploy compose stack
env:
IMAGE_TAG: ${{ needs.build.outputs.image_tag }}
GITHUB_PAT: ${{ secrets.FETCHER_GITHUB_PAT }}
FETCHER_INTERNAL_TOKEN: ${{ secrets.FETCHER_INTERNAL_TOKEN }}
GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }}
GH_OAUTH_CLIENT_SECRET: ${{ secrets.GH_OAUTH_CLIENT_SECRET }}
GENERATOR_SECRET_KEY: ${{ secrets.GENERATOR_SECRET_KEY }}
ALLOWED_ORIGINS: ${{ secrets.ALLOWED_ORIGINS }}
DEV_DASHBOARD_USER: ${{ secrets.DEV_DASHBOARD_USER }}
DEV_DASHBOARD_PASSWORD: ${{ secrets.DEV_DASHBOARD_PASSWORD }}
run: ./deploy/deploy.sh
+258
View File
@@ -0,0 +1,258 @@
name: health check
on:
schedule:
# Every 15 minutes — matches the refresh cron cadence
- cron: '*/15 * * * *'
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: health-check-${{ github.ref }}
cancel-in-progress: false
jobs:
tests:
name: pytest-${{ matrix.service }}
runs-on: ubuntu-latest
# Scheduled runs are an uptime probe only — skip the test matrix.
if: github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
service: [fetcher, generator, edge]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: ${{ matrix.service }}/requirements.txt
- name: Install dependencies
working-directory: ${{ matrix.service }}
run: pip install -r requirements.txt
- name: Run pytest
id: pytest
working-directory: ${{ matrix.service }}
run: |
set -o pipefail
pytest -v --tb=short --color=no 2>&1 | tee "/tmp/pytest-${SERVICE}.log"
env:
SERVICE: ${{ matrix.service }}
- name: Upload pytest log
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest-${{ matrix.service }}
path: /tmp/pytest-${{ matrix.service }}.log
retention-days: 14
site-health:
name: site-health
runs-on: ubuntu-latest
# Only probe production on schedule / manual / push to main — not on
# PRs, where failures wouldn't indicate a prod incident.
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
steps:
- name: Check edge homepage
id: check-edge
run: |
echo "GET https://gh-stats.com/"
HTTP_CODE=$(curl -sSL -o /tmp/edge-home.html -w "%{http_code}" --max-time 30 https://gh-stats.com/)
echo "HTTP $HTTP_CODE"
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Edge homepage returned HTTP $HTTP_CODE"
head -c 500 /tmp/edge-home.html || true
exit 1
fi
- name: Check widget SVG endpoint
id: check-widget
run: |
# Cloudflare routes /api/* to the generator directly. The bare
# /<user> and /<user>/<widget>.svg paths land on the SPA shell
# in prod, so we probe the canonical /api/<user>/<widget>.svg.
URL="https://gh-stats.com/api/ShayManor/grade.svg"
echo "GET $URL"
HTTP_CODE=$(curl -sS -D /tmp/widget-headers.txt -o /tmp/widget-body.svg \
-w "%{http_code}" --max-time 30 "$URL")
echo "HTTP $HTTP_CODE"
cat /tmp/widget-headers.txt
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Widget endpoint returned HTTP $HTTP_CODE"
exit 1
fi
CT=$(grep -i '^content-type:' /tmp/widget-headers.txt | tail -n1 | awk '{print $2}' | tr -d '\r' || true)
case "$CT" in
image/svg+xml*) : ;;
*) echo "::error::Unexpected Content-Type='$CT' (expected image/svg+xml)"; exit 1;;
esac
if ! head -c 200 /tmp/widget-body.svg | grep -q '<svg'; then
echo "::error::Response body does not look like SVG"
head -c 200 /tmp/widget-body.svg; echo
exit 1
fi
STATUS=$(grep -i '^x-widget-status:' /tmp/widget-headers.txt | tail -n1 | awk '{print $2}' | tr -d '\r' || true)
# ready / building / rate_limited are healthy; absent is fine
# on cache hits; not_found is a failure.
case "$STATUS" in
""|ready|building|rate_limited) echo "X-Widget-Status='${STATUS:-<absent>}' (ok)";;
*) echo "::error::Unhealthy X-Widget-Status='$STATUS'"; exit 1;;
esac
- name: Check generator health pipeline
id: check-api
run: |
# Generator's purpose-built liveness probe, routed through
# Cloudflare's /api/* rule.
URL="https://gh-stats.com/api/health"
echo "GET $URL"
BODY=$(curl -sS --max-time 30 -w "\n%{http_code}" "$URL")
HTTP_CODE=$(printf '%s\n' "$BODY" | tail -n1)
JSON=$(printf '%s\n' "$BODY" | sed '$d')
echo "HTTP $HTTP_CODE"
echo "$JSON"
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::/api/health returned HTTP $HTTP_CODE"
exit 1
fi
STATUS=$(printf '%s' "$JSON" | python3 -c 'import json,sys; print(json.load(sys.stdin).get("status",""))' 2>/dev/null || echo "")
if [ "$STATUS" != "ok" ]; then
echo "::error::/api/health reports status='$STATUS' (expected 'ok')"
exit 1
fi
echo "generator pipeline healthy"
notify:
name: notify-on-failure
runs-on: ubuntu-latest
needs: [tests, site-health]
if: always() && (needs.tests.result == 'failure' || needs.site-health.result == 'failure')
env:
TESTS_RESULT: ${{ needs.tests.result }}
HEALTH_RESULT: ${{ needs.site-health.result }}
EVENT_NAME: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
COMMIT_SHA: ${{ github.sha }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
SERVER_URL: ${{ github.server_url }}
RUN_ID: ${{ github.run_id }}
steps:
- name: Download pytest logs
if: needs.tests.result == 'failure'
uses: actions/download-artifact@v4
with:
path: logs
pattern: pytest-*
continue-on-error: true
- name: Assemble email body
run: |
NOW=$(date -u '+%Y-%m-%d %H:%M:%S UTC')
RUN_URL="${SERVER_URL}/${REPO}/actions/runs/${RUN_ID}"
{
echo "gh-stats.com — health check failed"
echo "===================================="
echo ""
case "$EVENT_NAME" in
schedule) echo "Trigger: scheduled uptime probe";;
push) echo "Trigger: push to ${REF_NAME} (${COMMIT_SHA})";;
pull_request) echo "Trigger: PR #${PR_NUMBER} → main";;
workflow_dispatch) echo "Trigger: manual run";;
*) echo "Trigger: ${EVENT_NAME}";;
esac
echo "Time: $NOW"
echo "Repo: ${REPO}"
echo ""
echo "Job results"
echo "-----------"
printf " %-14s %s\n" "pytest:" "${TESTS_RESULT}"
printf " %-14s %s\n" "site-health:" "${HEALTH_RESULT}"
echo ""
if [ "$HEALTH_RESULT" = "failure" ]; then
echo "Site health"
echo "-----------"
echo " One or more endpoints on https://gh-stats.com are not"
echo " responding as expected. See the run logs for the failing"
echo " step and its HTTP code."
echo ""
fi
if [ "$TESTS_RESULT" = "failure" ] && [ -d logs ]; then
echo "Failing tests"
echo "-------------"
for dir in logs/pytest-*; do
[ -d "$dir" ] || continue
service=${dir#logs/pytest-}
log="$dir/pytest-${service}.log"
[ -f "$log" ] || continue
# Did this service actually fail? pytest prints FAILED lines
# per failure and a summary like "=== 3 failed ...". If
# neither appears, skip it.
if ! grep -qE '^(FAILED |=+ .* failed)' "$log"; then
continue
fi
echo ""
echo "[$service]"
grep -E '^(FAILED |=+ .* (failed|error))' "$log" | head -n 20
echo "..."
tail -n 60 "$log"
done
echo ""
fi
echo "Full logs"
echo "---------"
echo " $RUN_URL"
echo ""
echo "--"
echo "github-readme-stats automated monitor"
} > /tmp/email-body.txt
echo "----- email body -----"
cat /tmp/email-body.txt
echo "----------------------"
- name: Send email via ntfy
env:
NTFY_TOKEN: ${{ secrets.NTFY_ACCESS_TOKEN }}
NTFY_TOPIC: ${{ secrets.NTFY_TOPIC }}
NOTIFY_EMAIL: ${{ secrets.NOTIFY_EMAIL }}
run: |
missing=()
[ -z "$NTFY_TOKEN" ] && missing+=("NTFY_ACCESS_TOKEN")
[ -z "$NTFY_TOPIC" ] && missing+=("NTFY_TOPIC")
[ -z "$NOTIFY_EMAIL" ] && missing+=("NOTIFY_EMAIL")
if [ ${#missing[@]} -gt 0 ]; then
echo "::error::Missing required secret(s): ${missing[*]}"
echo "::error::Configure at: Settings → Secrets and variables → Actions"
exit 1
fi
if [ "$HEALTH_RESULT" = "failure" ] && [ "$TESTS_RESULT" = "failure" ]; then
SUBJECT="gh-stats.com is DOWN and tests are failing"
elif [ "$HEALTH_RESULT" = "failure" ]; then
SUBJECT="gh-stats.com is DOWN"
else
SUBJECT="gh-stats.com tests failed on ${REF_NAME}"
fi
RUN_URL="${SERVER_URL}/${REPO}/actions/runs/${RUN_ID}"
curl -fsS \
-H "Title: $SUBJECT" \
-H "Priority: high" \
-H "Tags: warning,rotating_light,gh-stats" \
-H "Email: $NOTIFY_EMAIL" \
-H "Click: $RUN_URL" \
-H "Authorization: Bearer $NTFY_TOKEN" \
--data-binary @/tmp/email-body.txt \
"https://ntfy.sh/$NTFY_TOPIC"
+33
View File
@@ -0,0 +1,33 @@
name: tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pytest:
name: ${{ matrix.service }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
service: [fetcher, generator, edge]
defaults:
run:
working-directory: ${{ matrix.service }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
cache-dependency-path: ${{ matrix.service }}/requirements.txt
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run pytest
run: pytest -v
+39 -2
View File
@@ -14,8 +14,8 @@ dist/
downloads/ downloads/
eggs/ eggs/
.eggs/ .eggs/
lib/ /lib/
lib64/ /lib64/
parts/ parts/
sdist/ sdist/
var/ var/
@@ -205,3 +205,40 @@ cython_debug/
marimo/_static/ marimo/_static/
marimo/_lsp/ marimo/_lsp/
__marimo__/ __marimo__/
# Per-service SQLite databases (runtime data)
fetcher/data/*.db
fetcher/data/*.db-wal
fetcher/data/*.db-shm
generator/data/*.db
generator/data/*.db-wal
generator/data/*.db-shm
# Built frontend bundle
generator/src/static/
generator/frontend/dist/
generator/frontend/node_modules/
# Python build artifacts
**/__pycache__/
**/*.pyc
.pytest_cache/
# Widget build artifacts at repo root (retired)
/widget_*.svg
/data/ghstats.db
# Editor / tooling caches
.idea/
.claude/
.superpowers/
.playwright-mcp/
screenshots/
# Kept locally, not tracked
/CLAUDE.md
/docs/
**/*.md
!README.md
!**/README.md
/data/
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2026 Shay Manor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+395 -72
View File
@@ -1,90 +1,413 @@
# GitHub README Stats # github-readme-stats
Generate polished SVG profile cards from your GitHub data. Fetches your repos, contributions, languages, and collaborators, then renders them into composable widgets you can drop into your profile README. [![tests](https://github.com/ShayManor/github-readme-stats/actions/workflows/tests.yml/badge.svg)](https://github.com/ShayManor/github-readme-stats/actions/workflows/tests.yml)
[![build and deploy](https://github.com/ShayManor/github-readme-stats/actions/workflows/deploy.yml/badge.svg)](https://github.com/ShayManor/github-readme-stats/actions/workflows/deploy.yml)
<p align="center"> A single SVG widget you drop into your GitHub profile README. It scores
<img src="widget_shaymanor.svg" width="420" alt="Example composite widget" /> your account, charts your contribution timeline, highlights your top
</p> collaborators, breaks down your languages, tracks your commit streaks,
and earns you tags like `Backend`, `ML`, or `Founder #42`.
## Widgets ```md
![my stats](https://gh-stats.com/api/YOUR_USERNAME)
| Widget | What it shows |
|--------|--------------|
| **Grade** | Letter grade (S through F) with score breakdown, stats, and inferred role tags |
| **Impact** | Contribution timeline over the last 6 months |
| **Collaborators** | Top people you've committed alongside, ranked by shared commits |
| **Focus** | Where your recent work falls (Backend, Frontend, ML, DevOps, etc.) |
| **Languages** | Donut chart of your most-used languages by LOC |
| **Achievements** | Custom badges you define (hackathons, awards, milestones) |
Each widget is also saved individually as `widget_<name>.svg`.
## Quick Start
```bash
# Basic (public data only)
python run.py <username>
# With a GitHub token for full commit/contribution data
GITHUB_PAT=<your-token> python run.py <username>
# Choose a theme
python run.py <username> nord
``` ```
Output lands in the repo root as `widget_<username>.svg`. <img src="./assets/examples/composite-midnight.svg" width="420" alt="composite widget, midnight theme" />
<details>
<summary>Table of contents (click to expand)</summary>
- [Quick start](#quick-start)
- [Themes](#themes)
- [Individual widgets](#individual-widgets)
- [Migrating from github-readme-stats](#migrating-from-github-readme-stats)
- [Query parameter reference](#query-parameter-reference)
- [Auto-awarded tags](#auto-awarded-tags)
- [Refreshing your data](#refreshing-your-data)
- [FAQ](#faq)
- [Gallery](#gallery)
</details>
---
## Quick start
1. Open <https://gh-stats.com/api/>.
2. Sign in with GitHub. Signing in is how you prove ownership of the
username, and it unlocks the editor.
3. Pick a theme, reorder widgets, add any custom tags or achievements.
4. Click **Generate**.
5. Paste this one line into your profile README:
```md
![my stats](https://gh-stats.com/api/YOUR_USERNAME)
```
The image URL is stable. Once it's in your README you can change
themes, tags, or widget order in the editor at any time without
touching the markdown.
> [!NOTE]
> Only public GitHub activity is counted. Private repos, private
> commit counts, and contributions to org-restricted repos are never
> visible to the fetcher.
---
## Themes ## Themes
Five built-in themes: Pass `?theme=<name>` on the URL, or pick one in the editor.
| Theme | Style | | Theme | Preview |
|-------|-------| |---|---|
| `midnight` / `dark` | Dark blue-gray (default) | | `midnight` (default) | <img src="./assets/examples/composite-midnight.svg" width="280" /> |
| `onyx` | High-contrast on near-black | | `onyx` | <img src="./assets/examples/composite-onyx.svg" width="280" /> |
| `nord` | Muted pastels on slate | | `nord` | <img src="./assets/examples/composite-nord.svg" width="280" /> |
| `clean` / `light` | White background | | `clean` | <img src="./assets/examples/composite-clean.svg" width="280" /> |
| `paper` | Warm off-white, sepia accents | | `paper` | <img src="./assets/examples/composite-paper.svg" width="280" /> |
## Web UI ```md
![stats](https://gh-stats.com/api/YOUR_USERNAME?theme=onyx)
```
A React frontend lets you customize widgets interactively with live preview and per-widget advanced settings (colors, counts, etc.). ### Auto-switching for dark and light mode
Add GitHub's theme suffix to serve a different image to dark vs. light
viewers:
```md
![dark](https://gh-stats.com/api/YOUR_USERNAME?theme=onyx#gh-dark-mode-only)
![light](https://gh-stats.com/api/YOUR_USERNAME?theme=clean#gh-light-mode-only)
```
Or use `<picture>` for precise `prefers-color-scheme` control:
```html
<picture>
<source srcset="https://gh-stats.com/api/YOUR_USERNAME?theme=onyx"
media="(prefers-color-scheme: dark)" />
<source srcset="https://gh-stats.com/api/YOUR_USERNAME?theme=clean"
media="(prefers-color-scheme: light)" />
<img src="https://gh-stats.com/api/YOUR_USERNAME" />
</picture>
```
---
## Individual widgets
Every widget is independently addressable at
`https://gh-stats.com/api/<username>/<widget>.svg`. Embed one, two, or all
of them.
### Grade
Overall score (0 to 100), letter grade, and your top role tags.
<img src="./assets/examples/grade.svg" width="380" alt="grade widget" />
```md
![grade](https://gh-stats.com/api/YOUR_USERNAME/grade.svg)
```
### Impact
Your contribution volume over the last 6 months, drawn as a smooth area
chart.
<img src="./assets/examples/impact.svg" width="380" alt="impact widget" />
```md
![impact](https://gh-stats.com/api/YOUR_USERNAME/impact.svg)
```
### Streaks
Current and longest contribution streaks.
<img src="./assets/examples/streaks.svg" width="380" alt="streaks widget" />
```md
![streaks](https://gh-stats.com/api/YOUR_USERNAME/streaks.svg)
```
### Top collaborators
The people you actually work with, filtered down to repos of a
reasonable size so a drive-by PR to `react` does not put the React team
on your card.
<img src="./assets/examples/collaborators.svg" width="380" alt="collaborators widget" />
```md
![collaborators](https://gh-stats.com/api/YOUR_USERNAME/collaborators.svg)
```
### Recent focus
What you have actually been working on lately, grouped by topic.
<img src="./assets/examples/focus.svg" width="380" alt="focus widget" />
```md
![focus](https://gh-stats.com/api/YOUR_USERNAME/focus.svg)
```
### Languages
Your language mix, weighted by bytes in repos you authored. Forks with
no meaningful contribution are ignored.
<img src="./assets/examples/languages.svg" width="380" alt="languages widget" />
```md
![languages](https://gh-stats.com/api/YOUR_USERNAME/languages.svg)
```
### Achievements
Hand-entered lines for hackathons, talks, awards, and certifications.
<img src="./assets/examples/achievements.svg" width="380" alt="achievements widget" />
```md
![achievements](https://gh-stats.com/api/YOUR_USERNAME/achievements.svg)
```
### Side by side
GitHub strips inline CSS, so an HTML table is the simplest way to put
two widgets next to each other.
```html
<table><tr>
<td><img src="https://gh-stats.com/api/YOUR_USERNAME/grade.svg" /></td>
<td><img src="https://gh-stats.com/api/YOUR_USERNAME/languages.svg" /></td>
</tr></table>
```
---
## Migrating from github-readme-stats
[`anuraghazra/github-readme-stats`](https://github.com/anuraghazra/github-readme-stats)
is the card most profile READMEs use, and it is a good project. Its README now
carries a deprecation notice pointing at a successor, so if you are looking to
move, the common URL shapes work here with only the domain changed.
| Your current URL | Change it to |
|---|---|
| `github-readme-stats.vercel.app/api?username=U` | `gh-stats.com/api?username=U` |
| `github-readme-stats.vercel.app/api/top-langs?username=U` | `gh-stats.com/api/top-langs?username=U` |
| `github-readme-streak-stats.herokuapp.com/?user=U` | `gh-stats.com/api/streak/U` |
Nothing else in your README changes.
> [!NOTE]
> `theme=` is honoured on the composite card (`/api/<user>`). On the
> compatibility and single-widget URLs above it is currently ignored and the
> default theme is served.
If you would rather replace several badges with one image, use the composite
card instead and delete the rest:
```md
![stats](https://gh-stats.com/api/YOUR_USERNAME)
```
## Query parameter reference
Every URL accepts query parameters. They override the owner's saved
settings on a per-embed basis, so viewers can tweak the look without
changing anything the owner has stored.
Values with special characters must be URL-encoded: `#a78bfa` becomes
`%23a78bfa`, a space becomes `%20`.
### Common parameters
| Parameter | What it does | Example |
|---|---|---|
| `theme` | Built-in theme name. | `?theme=onyx` |
| `widgets` | Which widgets to show on the composite card. | `?widgets=grade,streaks,languages` |
| `order` | Render order on the composite card. | `?order=grade,streaks,languages` |
| `hide` | Languages to exclude from the languages widget. | `?hide=HTML,CSS,Makefile` |
| `tags` | Extra custom role tags on the grade widget. | `?tags=ML,Systems` |
### Per-widget parameters
Use dot notation: `<widget>.<key>=<value>`.
| Parameter | What it does | Type | Default |
|---|---|---|---|
| `grade.max_tags` | Max role tags shown (1 to 20). | int | all tags |
| `impact.line_color` | Accent color for the area curve. | hex color | theme accent |
| `streaks.color` | Accent color for the current-streak text. | hex color | theme accent |
| `collaborators.max_count` | Max collaborators shown (1 to 10). | int | 5 |
| `collaborators.bar_color` | Accent color for the commit bars. | hex color | theme accent |
| `focus.max_categories` | Max focus clusters shown (1 to 10). | int | 6 |
| `languages.max_languages` | Max languages shown (1 to 10). | int | 5 |
| `achievements.max_items` | Max achievement rows shown (1 to 10). | int | 5 |
---
## Auto-awarded tags
Some tags on the grade card are earned from real activity. No query
parameter will add them if you have not earned them:
- `Founder #N` is your enrollment number, fixed when you first sign in.
- Role tags like `Backend`, `Frontend`, `ML`, `Mobile`, `DevOps`,
`Cloud`, `Systems`, `Database`, `Security` are derived from your
language mix and repo topics.
---
## Refreshing your data
The refresh cron re-pulls GitHub data every 15 minutes, so new commits
usually appear in your widget within that window. GitHub's image CDN
may add another minute or two on top.
If you need an immediate update (for example right after merging
something big), click **Refresh now** in the editor. It is a one-shot
per account, so save it for when it matters.
---
## Self-hosting
The public instance at `gh-stats.com` is free and you do not need to run your
own. Self-host if you want your own rate limit, private repository data staying
on your hardware, or control over when cards rebuild.
You need Docker and a GitHub token. The token needs no scopes for public data;
it exists to raise your GitHub API rate limit.
```bash ```bash
# Terminal 1 — start the generator API git clone https://github.com/ShayManor/github-readme-stats
python -m src.generator_api # :5002 cd github-readme-stats
cp .env.example .env # put your token in GITHUB_PAT
# Terminal 2 — start the frontend docker compose up -d --build
cd frontend && npm install && npm run dev # :3000
``` ```
Open `http://localhost:3000`, enter a GitHub username, tweak settings, and hit Generate. Then open `http://localhost:5002` and embed from your own host:
## Configuration
All tuning lives in `src/config.py` and can be overridden with environment variables. Key knobs:
| Variable | Default | What it does |
|----------|---------|-------------|
| `GITHUB_PAT` | — | GitHub personal access token |
| `COMMIT_MAX_REPOS` | 10 | Max repos to scan for commits |
| `COMMIT_PER_REPO` | 30 | Max commits per repo |
| `COLLABORATOR_MIN_COMMITS` | 3 | Minimum shared commits to show a collaborator |
| `API_TIMEOUT` | 5 | Per-request timeout in seconds |
See [CONFIGURATION.md](CONFIGURATION.md) for the full list.
## Project Structure
```md
![stats](http://localhost:5002/api/YOUR_USERNAME)
``` ```
src/
data/ # GitHub API fetching + data processing Three services come up behind `docker compose`: `fetcher` talks to GitHub and
widgets/ # One SVG renderer per widget owns the token, `generator` renders the SVGs and serves the web UI on 5002, and
themes/ # Color palettes `edge` is a caching proxy on 5003 that serves cards at `/<username>`. Data lives
models/ # Typed data structures in `./data`. Set `GHSTATS_PORT` to move the web UI off 5002.
utils/ # SVG helpers
config.py # All tunables ## FAQ
generate.py # CLI entry point
generator_api.py # Flask API for the web UI **Can I use a private GitHub account?**
frontend/ # React + TypeScript + Vite No. The service only reads public activity. Private repos, private
commit counts, and contributions to org-restricted repos are not
visible to GitHub's public API, so they are never part of the widget.
**How fresh is the data?**
Every 15 minutes, automatically. You can also click **Refresh now**
once per account for an immediate update.
**How do I edit my widget?**
Sign in with GitHub at <https://gh-stats.com/api/>. Only the account whose
login matches the username can edit that widget's settings.
**Can I change the widget without re-embedding?**
Yes. The image URL is stable. Edit in the editor, click **Generate**,
and the next fetch serves the new version. GitHub's image cache may
delay propagation by a few minutes.
**Can I embed someone else's widget with my own theme or filters?**
Yes, use the [query parameters](#query-parameter-reference). The
owner's saved settings are not affected.
**I am getting a placeholder card. What is wrong?**
`building` means the first render is still in progress, give it a
minute. `not_found` means GitHub does not know that username.
**Why does my languages card look wrong?**
It counts bytes in repos you authored. Forks with little commit
activity are dropped. Add `?hide=HTML,CSS,Makefile` if generated files
dominate the breakdown.
**Can I reorder widgets?**
Yes, either in the editor (drag and drop) or by passing
`?widgets=...&order=...` on the URL.
---
## Gallery
### Composite themes
<table>
<tr>
<td align="center"><b>midnight</b><br/><img src="./assets/examples/composite-midnight.svg" width="260" /></td>
<td align="center"><b>onyx</b><br/><img src="./assets/examples/composite-onyx.svg" width="260" /></td>
</tr>
<tr>
<td align="center"><b>nord</b><br/><img src="./assets/examples/composite-nord.svg" width="260" /></td>
<td align="center"><b>clean</b><br/><img src="./assets/examples/composite-clean.svg" width="260" /></td>
</tr>
<tr>
<td align="center"><b>paper</b><br/><img src="./assets/examples/composite-paper.svg" width="260" /></td>
<td align="center"><b>custom (onyx, 3 widgets)</b><br/><img src="./assets/examples/composite-custom.svg" width="260" /></td>
</tr>
</table>
### Single-widget examples
<table>
<tr>
<td align="center"><b>Grade</b><br/><img src="./assets/examples/grade.svg" width="320" /></td>
<td align="center"><b>Grade (max_tags=3)</b><br/><img src="./assets/examples/grade-compact.svg" width="320" /></td>
</tr>
<tr>
<td align="center"><b>Impact</b><br/><img src="./assets/examples/impact.svg" width="320" /></td>
<td align="center"><b>Impact (purple line)</b><br/><img src="./assets/examples/impact-purple.svg" width="320" /></td>
</tr>
<tr>
<td align="center"><b>Streaks</b><br/><img src="./assets/examples/streaks.svg" width="320" /></td>
<td align="center"><b>Streaks (green)</b><br/><img src="./assets/examples/streaks-green.svg" width="320" /></td>
</tr>
<tr>
<td align="center"><b>Languages</b><br/><img src="./assets/examples/languages.svg" width="320" /></td>
<td align="center"><b>Languages (hide Shell, Dockerfile)</b><br/><img src="./assets/examples/languages-hide.svg" width="320" /></td>
</tr>
<tr>
<td align="center"><b>Collaborators</b><br/><img src="./assets/examples/collaborators.svg" width="320" /></td>
<td align="center"><b>Focus</b><br/><img src="./assets/examples/focus.svg" width="320" /></td>
</tr>
<tr>
<td align="center"><b>Achievements</b><br/><img src="./assets/examples/achievements.svg" width="320" /></td>
<td></td>
</tr>
</table>
### Mix and match
Embed two widgets side by side with an HTML table:
```html
<table><tr>
<td><img src="https://gh-stats.com/api/YOUR_USERNAME/grade.svg" /></td>
<td><img src="https://gh-stats.com/api/YOUR_USERNAME/languages.svg" /></td>
</tr></table>
```
Stack a custom composite with only three widgets:
```md
![stats](https://gh-stats.com/api/YOUR_USERNAME?theme=onyx&widgets=grade,streaks,languages&order=grade,streaks,languages)
```
Recolor the impact line:
```md
![impact](https://gh-stats.com/api/YOUR_USERNAME/impact.svg?impact.line_color=%23a78bfa)
``` ```
+72
View File
@@ -0,0 +1,72 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="274" viewBox="0 0 380 274" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="272" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">ACHIEVEMENTS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 8)">
<rect width="348" height="48" rx="8" fill="#d29922" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#d29922" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="#d29922" stroke-width="1.5"/>
<rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="#d29922" opacity="0.85"/>
<path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="#d29922" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">Hackathon winner</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Y Combinator AI Hackathon · 2025-11</text>
</g>
<g transform="translate(16, 64)">
<rect width="348" height="48" rx="8" fill="#3fb950" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#3fb950" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
fill="none" stroke="#3fb950" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">Speaker at PyCon</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Async at scale · 2024-05</text>
</g>
<g transform="translate(16, 120)">
<rect width="348" height="48" rx="8" fill="#58a6ff" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#58a6ff" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="#58a6ff" opacity="0.85"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">Open Source Award</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">GitHub Stars program · 2024-01</text>
</g>
<g transform="translate(16, 176)">
<rect width="348" height="48" rx="8" fill="#bc8cff" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#bc8cff" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="14" r="5" fill="#bc8cff" opacity="0.2"/>
<circle cx="12" cy="14" r="4" fill="none" stroke="#bc8cff" stroke-width="1.5"/>
<path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="#bc8cff"/>
<path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="#bc8cff" stroke-width="1.5" fill="none" stroke-linecap="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">AWS Certified Solutions Architect</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Professional · 2023-09</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

+89
View File
@@ -0,0 +1,89 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="298" viewBox="0 0 380 298" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="296" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">TOP COLLABORATORS</text>
<g transform="translate(0, 36)">
<g transform="translate(36, 20)">
<circle cx="0" cy="0" r="18" fill="hsl(285, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">torvalds</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">4 repos · 142 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="120.0" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="120.0" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 70)">
<circle cx="0" cy="0" r="18" fill="hsl(165, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">G</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">gaearon</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">3 repos · 98 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="82.8169014084507" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="82.8169014084507" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 120)">
<circle cx="0" cy="0" r="18" fill="hsl(238, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">S</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">sindresorhus</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">2 repos · 64 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="54.08450704225352" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="54.08450704225352" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 170)">
<circle cx="0" cy="0" r="18" fill="hsl(157, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">tj</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">2 repos · 47 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="39.71830985915493" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="39.71830985915493" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 220)">
<circle cx="0" cy="0" r="18" fill="hsl(231, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">Y</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">yyx990803</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">1 repos · 31 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="26.197183098591548" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="26.197183098591548" dur="0.6s" fill="freeze"/>
</rect>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

+543
View File
@@ -0,0 +1,543 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="420" height="1756" viewBox="0 0 420 1756">
<rect width="420" height="1756" rx="16" fill="#ffffff"/>
<rect x="0.5" y="0.5" width="419" height="1755" rx="16"
fill="none" stroke="#d8dee4" stroke-width="1"/>
<svg x="20" y="20" width="380" height="226" viewBox="0 0 380 226">
<defs>
<filter id="grade_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="grade_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#grade_shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#eaeef2" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#eaeef2" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#24292f">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#656d76"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76" letter-spacing="0.4">Score <tspan fill="#24292f" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#eaeef2" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#656d76" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#656d76"/><line x1="7" y1="10" x2="7" y2="14" stroke="#656d76" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#656d76" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#24292f">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#656d76" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#656d76" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#656d76" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#24292f">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#656d76" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#24292f">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#656d76" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#656d76" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#656d76" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#656d76" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#24292f">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#656d76" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#656d76" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#656d76" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#656d76" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#24292f">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#eaeef2" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#0969da" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#0969da" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#0969da">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#0969da" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#0969da" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#0969da">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#0969da" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#0969da" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#0969da">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#0969da" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#0969da" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#0969da">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#0969da" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#0969da" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#0969da">Open source</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="262" width="380" height="200" viewBox="0 0 380 200">
<defs>
<filter id="impact_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="impact_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#impact_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#656d76" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="impact_areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#0969da" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#0969da" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#656d76">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#eaeef2" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#656d76">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#eaeef2" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#656d76">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#eaeef2" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#656d76">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#656d76">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#656d76">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#impact_areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#0969da" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#24292f">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">commits over 6mo</text>
</g>
</g>
</svg>
<svg x="20" y="478" width="380" height="170" viewBox="0 0 380 170">
<defs>
<filter id="streaks_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="streaks_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#streaks_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#656d76" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#656d76">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#0969da">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#656d76">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#24292f">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#d8dee4" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#eaeef2"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#0969da"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#0969da"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">Sep 13 – Nov 12, 2025</text>
</g>
</svg>
<svg x="20" y="664" width="380" height="298" viewBox="0 0 380 298">
<defs>
<filter id="collaborators_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="collaborators_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="296" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#collaborators_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#656d76" letter-spacing="0.8" opacity="0.7">TOP COLLABORATORS</text>
<g transform="translate(0, 36)">
<g transform="translate(36, 20)">
<circle cx="0" cy="0" r="18" fill="hsl(285, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">torvalds</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">4 repos · 142 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#eaeef2"/>
<rect x="200" y="-6" width="120.0" height="8" rx="4" fill="#8250df" opacity="0.8">
<animate attributeName="width" from="0" to="120.0" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 70)">
<circle cx="0" cy="0" r="18" fill="hsl(165, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">G</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">gaearon</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">3 repos · 98 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#eaeef2"/>
<rect x="200" y="-6" width="82.8169014084507" height="8" rx="4" fill="#8250df" opacity="0.8">
<animate attributeName="width" from="0" to="82.8169014084507" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 120)">
<circle cx="0" cy="0" r="18" fill="hsl(238, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">S</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">sindresorhus</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">2 repos · 64 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#eaeef2"/>
<rect x="200" y="-6" width="54.08450704225352" height="8" rx="4" fill="#8250df" opacity="0.8">
<animate attributeName="width" from="0" to="54.08450704225352" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 170)">
<circle cx="0" cy="0" r="18" fill="hsl(157, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">tj</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">2 repos · 47 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#eaeef2"/>
<rect x="200" y="-6" width="39.71830985915493" height="8" rx="4" fill="#8250df" opacity="0.8">
<animate attributeName="width" from="0" to="39.71830985915493" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 220)">
<circle cx="0" cy="0" r="18" fill="hsl(231, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">Y</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">yyx990803</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">1 repos · 31 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#eaeef2"/>
<rect x="200" y="-6" width="26.197183098591548" height="8" rx="4" fill="#8250df" opacity="0.8">
<animate attributeName="width" from="0" to="26.197183098591548" dur="0.6s" fill="freeze"/>
</rect>
</g>
</g>
</svg>
<svg x="20" y="978" width="380" height="234" viewBox="0 0 380 234">
<defs>
<filter id="focus_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="focus_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="232" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#focus_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#656d76" letter-spacing="0.8" opacity="0.7">RECENT FOCUS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#24292f">Backend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#eaeef2"/>
<rect x="90" y="4" width="210.0" height="14" rx="7" fill="#58a6ff" opacity="0.8">
<animate attributeName="width" from="0" to="210.0" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">412 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#58a6ff">38%</text>
</g>
<g transform="translate(16, 36)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#24292f">ML</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#eaeef2"/>
<rect x="90" y="4" width="132.6315789473684" height="14" rx="7" fill="#3fb950" opacity="0.8">
<animate attributeName="width" from="0" to="132.6315789473684" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">260 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#3fb950">24%</text>
</g>
<g transform="translate(16, 72)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#24292f">Frontend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#eaeef2"/>
<rect x="90" y="4" width="99.47368421052632" height="14" rx="7" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="99.47368421052632" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">195 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#bc8cff">18%</text>
</g>
<g transform="translate(16, 108)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#24292f">DevOps</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#eaeef2"/>
<rect x="90" y="4" width="66.3157894736842" height="14" rx="7" fill="#d29922" opacity="0.8">
<animate attributeName="width" from="0" to="66.3157894736842" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">130 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#d29922">12%</text>
</g>
<g transform="translate(16, 144)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#24292f">Cloud</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#eaeef2"/>
<rect x="90" y="4" width="44.21052631578947" height="14" rx="7" fill="#f0883e" opacity="0.8">
<animate attributeName="width" from="0" to="44.21052631578947" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76">87 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#f0883e">8%</text>
</g>
<text x="16" y="188" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76" opacity="0.7">Recent activity · last year</text>
</g>
</svg>
<svg x="20" y="1228" width="380" height="208" viewBox="0 0 380 208">
<defs>
<filter id="languages_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="languages_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#languages_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#656d76" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#656d76" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#f6f8fa"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#24292f">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#24292f">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#656d76">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#24292f">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#656d76">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#24292f">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#656d76">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#24292f">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#656d76">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#24292f">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#656d76">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#656d76"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#24292f">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#656d76">4%</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="1452" width="380" height="274" viewBox="0 0 380 274">
<defs>
<filter id="achievements_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="achievements_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="272" rx="10" ry="10"
fill="#f6f8fa" stroke="#d8dee4" stroke-width="1" filter="url(#achievements_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#656d76" letter-spacing="0.8" opacity="0.7">ACHIEVEMENTS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 8)">
<rect width="348" height="48" rx="8" fill="#9a6700" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#9a6700" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="#9a6700" stroke-width="1.5"/>
<rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="#9a6700" opacity="0.85"/>
<path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="#9a6700" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">Hackathon winner</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">Y Combinator AI Hackathon · 2025-11</text>
</g>
<g transform="translate(16, 64)">
<rect width="348" height="48" rx="8" fill="#1a7f37" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#1a7f37" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
fill="none" stroke="#1a7f37" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">Speaker at PyCon</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">Async at scale · 2024-05</text>
</g>
<g transform="translate(16, 120)">
<rect width="348" height="48" rx="8" fill="#0969da" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#0969da" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="#0969da" opacity="0.85"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">Open Source Award</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">GitHub Stars program · 2024-01</text>
</g>
<g transform="translate(16, 176)">
<rect width="348" height="48" rx="8" fill="#8250df" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#8250df" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="14" r="5" fill="#8250df" opacity="0.2"/>
<circle cx="12" cy="14" r="4" fill="none" stroke="#8250df" stroke-width="1.5"/>
<path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="#8250df"/>
<path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="#8250df" stroke-width="1.5" fill="none" stroke-linecap="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#24292f">AWS Certified Solutions Architect</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#656d76">Professional · 2023-09</text>
</g>
</g>
</svg>
<text x="210" y="1748" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#656d76" opacity="0.5">Generated with gh-stats</text>
</svg>

After

Width:  |  Height:  |  Size: 38 KiB

+268
View File
@@ -0,0 +1,268 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="420" height="686" viewBox="0 0 420 686">
<rect width="420" height="686" rx="16" fill="#09090b"/>
<rect x="0.5" y="0.5" width="419" height="685" rx="16"
fill="none" stroke="#27272a" stroke-width="1"/>
<svg x="20" y="20" width="380" height="226" viewBox="0 0 380 226">
<defs>
<filter id="grade_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="grade_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#grade_shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#27272a" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#27272a" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#fafafa">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#a1a1aa"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa" letter-spacing="0.4">Score <tspan fill="#fafafa" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#27272a" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#a1a1aa" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#a1a1aa"/><line x1="7" y1="10" x2="7" y2="14" stroke="#a1a1aa" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#a1a1aa" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#a1a1aa" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#a1a1aa" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#a1a1aa" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#a1a1aa" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#a1a1aa" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#a1a1aa" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#a1a1aa" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#27272a" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Open source</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="262" width="380" height="170" viewBox="0 0 380 170">
<defs>
<filter id="streaks_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="streaks_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#streaks_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#a1a1aa">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#a78bfa">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#a1a1aa">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#fafafa">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#27272a" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#27272a"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#a78bfa"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#a78bfa"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Sep 13 – Nov 12, 2025</text>
</g>
</svg>
<svg x="20" y="448" width="380" height="208" viewBox="0 0 380 208">
<defs>
<filter id="languages_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="languages_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#languages_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#a1a1aa" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#18181b"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#fafafa">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#a1a1aa"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">4%</text>
</g>
</g>
</g>
</svg>
<text x="210" y="678" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa" opacity="0.5">Generated with gh-stats</text>
</svg>

After

Width:  |  Height:  |  Size: 17 KiB

+543
View File
@@ -0,0 +1,543 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="420" height="1756" viewBox="0 0 420 1756">
<rect width="420" height="1756" rx="16" fill="#121820"/>
<rect x="0.5" y="0.5" width="419" height="1755" rx="16"
fill="none" stroke="#2a3444" stroke-width="1"/>
<svg x="20" y="20" width="380" height="226" viewBox="0 0 380 226">
<defs>
<filter id="grade_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="grade_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#grade_shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#1e2836" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#1e2836" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#d1d9e0">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#7d8895"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895" letter-spacing="0.4">Score <tspan fill="#d1d9e0" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#1e2836" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#7d8895" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#7d8895"/><line x1="7" y1="10" x2="7" y2="14" stroke="#7d8895" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#7d8895" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#7d8895" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#7d8895" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#7d8895" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#7d8895" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#7d8895" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#7d8895" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#7d8895" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#7d8895" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#7d8895" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#7d8895" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#7d8895" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#7d8895" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#1e2836" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Open source</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="262" width="380" height="200" viewBox="0 0 380 200">
<defs>
<filter id="impact_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="impact_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#impact_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="impact_areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#58a6ff" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#58a6ff" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#impact_areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#58a6ff" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#d1d9e0">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">commits over 6mo</text>
</g>
</g>
</svg>
<svg x="20" y="478" width="380" height="170" viewBox="0 0 380 170">
<defs>
<filter id="streaks_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="streaks_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#streaks_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7d8895">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#58a6ff">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7d8895">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#d1d9e0">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#2a3444" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#1e2836"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#58a6ff"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#58a6ff"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Sep 13 – Nov 12, 2025</text>
</g>
</svg>
<svg x="20" y="664" width="380" height="298" viewBox="0 0 380 298">
<defs>
<filter id="collaborators_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="collaborators_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="296" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#collaborators_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">TOP COLLABORATORS</text>
<g transform="translate(0, 36)">
<g transform="translate(36, 20)">
<circle cx="0" cy="0" r="18" fill="hsl(285, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">torvalds</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">4 repos · 142 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="120.0" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="120.0" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 70)">
<circle cx="0" cy="0" r="18" fill="hsl(165, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">G</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">gaearon</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">3 repos · 98 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="82.8169014084507" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="82.8169014084507" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 120)">
<circle cx="0" cy="0" r="18" fill="hsl(238, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">S</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">sindresorhus</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">2 repos · 64 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="54.08450704225352" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="54.08450704225352" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 170)">
<circle cx="0" cy="0" r="18" fill="hsl(157, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">tj</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">2 repos · 47 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="39.71830985915493" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="39.71830985915493" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 220)">
<circle cx="0" cy="0" r="18" fill="hsl(231, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">Y</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">yyx990803</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">1 repos · 31 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#1e2836"/>
<rect x="200" y="-6" width="26.197183098591548" height="8" rx="4" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="26.197183098591548" dur="0.6s" fill="freeze"/>
</rect>
</g>
</g>
</svg>
<svg x="20" y="978" width="380" height="234" viewBox="0 0 380 234">
<defs>
<filter id="focus_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="focus_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="232" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#focus_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">RECENT FOCUS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">Backend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="210.0" height="14" rx="7" fill="#58a6ff" opacity="0.8">
<animate attributeName="width" from="0" to="210.0" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">412 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#58a6ff">38%</text>
</g>
<g transform="translate(16, 36)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">ML</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="132.6315789473684" height="14" rx="7" fill="#3fb950" opacity="0.8">
<animate attributeName="width" from="0" to="132.6315789473684" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">260 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#3fb950">24%</text>
</g>
<g transform="translate(16, 72)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">Frontend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="99.47368421052632" height="14" rx="7" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="99.47368421052632" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">195 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#bc8cff">18%</text>
</g>
<g transform="translate(16, 108)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">DevOps</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="66.3157894736842" height="14" rx="7" fill="#d29922" opacity="0.8">
<animate attributeName="width" from="0" to="66.3157894736842" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">130 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#d29922">12%</text>
</g>
<g transform="translate(16, 144)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">Cloud</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="44.21052631578947" height="14" rx="7" fill="#f0883e" opacity="0.8">
<animate attributeName="width" from="0" to="44.21052631578947" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">87 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#f0883e">8%</text>
</g>
<text x="16" y="188" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895" opacity="0.7">Recent activity · last year</text>
</g>
</svg>
<svg x="20" y="1228" width="380" height="208" viewBox="0 0 380 208">
<defs>
<filter id="languages_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="languages_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#languages_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#7d8895" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#1a2230"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#d1d9e0">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#7d8895"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">4%</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="1452" width="380" height="274" viewBox="0 0 380 274">
<defs>
<filter id="achievements_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="achievements_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="272" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#achievements_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">ACHIEVEMENTS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 8)">
<rect width="348" height="48" rx="8" fill="#d29922" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#d29922" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="#d29922" stroke-width="1.5"/>
<rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="#d29922" opacity="0.85"/>
<path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="#d29922" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">Hackathon winner</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Y Combinator AI Hackathon · 2025-11</text>
</g>
<g transform="translate(16, 64)">
<rect width="348" height="48" rx="8" fill="#3fb950" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#3fb950" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
fill="none" stroke="#3fb950" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">Speaker at PyCon</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Async at scale · 2024-05</text>
</g>
<g transform="translate(16, 120)">
<rect width="348" height="48" rx="8" fill="#58a6ff" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#58a6ff" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="#58a6ff" opacity="0.85"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">Open Source Award</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">GitHub Stars program · 2024-01</text>
</g>
<g transform="translate(16, 176)">
<rect width="348" height="48" rx="8" fill="#bc8cff" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#bc8cff" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="14" r="5" fill="#bc8cff" opacity="0.2"/>
<circle cx="12" cy="14" r="4" fill="none" stroke="#bc8cff" stroke-width="1.5"/>
<path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="#bc8cff"/>
<path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="#bc8cff" stroke-width="1.5" fill="none" stroke-linecap="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#d1d9e0">AWS Certified Solutions Architect</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Professional · 2023-09</text>
</g>
</g>
</svg>
<text x="210" y="1748" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895" opacity="0.5">Generated with gh-stats</text>
</svg>

After

Width:  |  Height:  |  Size: 38 KiB

+543
View File
@@ -0,0 +1,543 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="420" height="1756" viewBox="0 0 420 1756">
<rect width="420" height="1756" rx="16" fill="#1e2433"/>
<rect x="0.5" y="0.5" width="419" height="1755" rx="16"
fill="none" stroke="#3d4659" stroke-width="1"/>
<svg x="20" y="20" width="380" height="226" viewBox="0 0 380 226">
<defs>
<filter id="grade_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="grade_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#grade_shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#333d50" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#333d50" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#e5e9f0">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#8892a4"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4" letter-spacing="0.4">Score <tspan fill="#e5e9f0" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#333d50" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#8892a4" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#8892a4"/><line x1="7" y1="10" x2="7" y2="14" stroke="#8892a4" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#8892a4" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#e5e9f0">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#8892a4" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#8892a4" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#8892a4" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#e5e9f0">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#8892a4" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#e5e9f0">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#8892a4" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#8892a4" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#8892a4" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#8892a4" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#e5e9f0">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#8892a4" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#8892a4" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#8892a4" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#8892a4" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#e5e9f0">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#333d50" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#88c0d0" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#88c0d0" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#88c0d0">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#88c0d0" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#88c0d0" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#88c0d0">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#88c0d0" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#88c0d0" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#88c0d0">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#88c0d0" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#88c0d0" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#88c0d0">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#88c0d0" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#88c0d0" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#88c0d0">Open source</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="262" width="380" height="200" viewBox="0 0 380 200">
<defs>
<filter id="impact_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="impact_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#impact_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#8892a4" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="impact_areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#88c0d0" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#88c0d0" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#8892a4">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#333d50" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#8892a4">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#333d50" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#8892a4">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#333d50" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#8892a4">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#8892a4">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#8892a4">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#impact_areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#88c0d0" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#e5e9f0">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">commits over 6mo</text>
</g>
</g>
</svg>
<svg x="20" y="478" width="380" height="170" viewBox="0 0 380 170">
<defs>
<filter id="streaks_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="streaks_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#streaks_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#8892a4" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#8892a4">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#88c0d0">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#8892a4">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#e5e9f0">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#3d4659" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#333d50"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#88c0d0"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#88c0d0"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">Sep 13 – Nov 12, 2025</text>
</g>
</svg>
<svg x="20" y="664" width="380" height="298" viewBox="0 0 380 298">
<defs>
<filter id="collaborators_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="collaborators_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="296" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#collaborators_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#8892a4" letter-spacing="0.8" opacity="0.7">TOP COLLABORATORS</text>
<g transform="translate(0, 36)">
<g transform="translate(36, 20)">
<circle cx="0" cy="0" r="18" fill="hsl(285, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">torvalds</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">4 repos · 142 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#333d50"/>
<rect x="200" y="-6" width="120.0" height="8" rx="4" fill="#b48ead" opacity="0.8">
<animate attributeName="width" from="0" to="120.0" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 70)">
<circle cx="0" cy="0" r="18" fill="hsl(165, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">G</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">gaearon</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">3 repos · 98 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#333d50"/>
<rect x="200" y="-6" width="82.8169014084507" height="8" rx="4" fill="#b48ead" opacity="0.8">
<animate attributeName="width" from="0" to="82.8169014084507" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 120)">
<circle cx="0" cy="0" r="18" fill="hsl(238, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">S</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">sindresorhus</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">2 repos · 64 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#333d50"/>
<rect x="200" y="-6" width="54.08450704225352" height="8" rx="4" fill="#b48ead" opacity="0.8">
<animate attributeName="width" from="0" to="54.08450704225352" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 170)">
<circle cx="0" cy="0" r="18" fill="hsl(157, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">tj</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">2 repos · 47 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#333d50"/>
<rect x="200" y="-6" width="39.71830985915493" height="8" rx="4" fill="#b48ead" opacity="0.8">
<animate attributeName="width" from="0" to="39.71830985915493" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 220)">
<circle cx="0" cy="0" r="18" fill="hsl(231, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">Y</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">yyx990803</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">1 repos · 31 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#333d50"/>
<rect x="200" y="-6" width="26.197183098591548" height="8" rx="4" fill="#b48ead" opacity="0.8">
<animate attributeName="width" from="0" to="26.197183098591548" dur="0.6s" fill="freeze"/>
</rect>
</g>
</g>
</svg>
<svg x="20" y="978" width="380" height="234" viewBox="0 0 380 234">
<defs>
<filter id="focus_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="focus_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="232" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#focus_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#8892a4" letter-spacing="0.8" opacity="0.7">RECENT FOCUS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#e5e9f0">Backend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#333d50"/>
<rect x="90" y="4" width="210.0" height="14" rx="7" fill="#58a6ff" opacity="0.8">
<animate attributeName="width" from="0" to="210.0" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">412 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#58a6ff">38%</text>
</g>
<g transform="translate(16, 36)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#e5e9f0">ML</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#333d50"/>
<rect x="90" y="4" width="132.6315789473684" height="14" rx="7" fill="#3fb950" opacity="0.8">
<animate attributeName="width" from="0" to="132.6315789473684" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">260 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#3fb950">24%</text>
</g>
<g transform="translate(16, 72)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#e5e9f0">Frontend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#333d50"/>
<rect x="90" y="4" width="99.47368421052632" height="14" rx="7" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="99.47368421052632" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">195 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#bc8cff">18%</text>
</g>
<g transform="translate(16, 108)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#e5e9f0">DevOps</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#333d50"/>
<rect x="90" y="4" width="66.3157894736842" height="14" rx="7" fill="#d29922" opacity="0.8">
<animate attributeName="width" from="0" to="66.3157894736842" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">130 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#d29922">12%</text>
</g>
<g transform="translate(16, 144)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#e5e9f0">Cloud</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#333d50"/>
<rect x="90" y="4" width="44.21052631578947" height="14" rx="7" fill="#f0883e" opacity="0.8">
<animate attributeName="width" from="0" to="44.21052631578947" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4">87 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#f0883e">8%</text>
</g>
<text x="16" y="188" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4" opacity="0.7">Recent activity · last year</text>
</g>
</svg>
<svg x="20" y="1228" width="380" height="208" viewBox="0 0 380 208">
<defs>
<filter id="languages_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="languages_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#languages_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#8892a4" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#8892a4" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#2a3142"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#e5e9f0">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#e5e9f0">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#8892a4">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#e5e9f0">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#8892a4">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#e5e9f0">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#8892a4">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#e5e9f0">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#8892a4">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#e5e9f0">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#8892a4">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#8892a4"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#e5e9f0">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#8892a4">4%</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="1452" width="380" height="274" viewBox="0 0 380 274">
<defs>
<filter id="achievements_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="achievements_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="272" rx="10" ry="10"
fill="#2a3142" stroke="#3d4659" stroke-width="1" filter="url(#achievements_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#8892a4" letter-spacing="0.8" opacity="0.7">ACHIEVEMENTS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 8)">
<rect width="348" height="48" rx="8" fill="#ebcb8b" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#ebcb8b" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="#ebcb8b" stroke-width="1.5"/>
<rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="#ebcb8b" opacity="0.85"/>
<path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="#ebcb8b" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">Hackathon winner</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">Y Combinator AI Hackathon · 2025-11</text>
</g>
<g transform="translate(16, 64)">
<rect width="348" height="48" rx="8" fill="#a3be8c" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#a3be8c" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
fill="none" stroke="#a3be8c" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">Speaker at PyCon</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">Async at scale · 2024-05</text>
</g>
<g transform="translate(16, 120)">
<rect width="348" height="48" rx="8" fill="#88c0d0" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#88c0d0" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="#88c0d0" opacity="0.85"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">Open Source Award</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">GitHub Stars program · 2024-01</text>
</g>
<g transform="translate(16, 176)">
<rect width="348" height="48" rx="8" fill="#b48ead" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#b48ead" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="14" r="5" fill="#b48ead" opacity="0.2"/>
<circle cx="12" cy="14" r="4" fill="none" stroke="#b48ead" stroke-width="1.5"/>
<path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="#b48ead"/>
<path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="#b48ead" stroke-width="1.5" fill="none" stroke-linecap="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#e5e9f0">AWS Certified Solutions Architect</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#8892a4">Professional · 2023-09</text>
</g>
</g>
</svg>
<text x="210" y="1748" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#8892a4" opacity="0.5">Generated with gh-stats</text>
</svg>

After

Width:  |  Height:  |  Size: 38 KiB

+543
View File
@@ -0,0 +1,543 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="420" height="1756" viewBox="0 0 420 1756">
<rect width="420" height="1756" rx="16" fill="#09090b"/>
<rect x="0.5" y="0.5" width="419" height="1755" rx="16"
fill="none" stroke="#27272a" stroke-width="1"/>
<svg x="20" y="20" width="380" height="226" viewBox="0 0 380 226">
<defs>
<filter id="grade_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="grade_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#grade_shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#27272a" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#27272a" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#fafafa">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#a1a1aa"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa" letter-spacing="0.4">Score <tspan fill="#fafafa" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#27272a" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#a1a1aa" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#a1a1aa"/><line x1="7" y1="10" x2="7" y2="14" stroke="#a1a1aa" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#a1a1aa" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#a1a1aa" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#a1a1aa" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#a1a1aa" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#a1a1aa" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#a1a1aa" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#a1a1aa" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#a1a1aa" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#a1a1aa" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#fafafa">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#27272a" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#a78bfa" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#a78bfa" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#a78bfa">Open source</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="262" width="380" height="200" viewBox="0 0 380 200">
<defs>
<filter id="impact_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="impact_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#impact_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="impact_areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#a78bfa" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#a78bfa" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#a1a1aa">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#27272a" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#a1a1aa">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#27272a" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#a1a1aa">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#27272a" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#a1a1aa">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#a1a1aa">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#a1a1aa">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#impact_areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#a78bfa" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#fafafa">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">commits over 6mo</text>
</g>
</g>
</svg>
<svg x="20" y="478" width="380" height="170" viewBox="0 0 380 170">
<defs>
<filter id="streaks_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="streaks_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#streaks_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#a1a1aa">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#a78bfa">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#a1a1aa">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#fafafa">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#27272a" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#27272a"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#a78bfa"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#a78bfa"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Sep 13 – Nov 12, 2025</text>
</g>
</svg>
<svg x="20" y="664" width="380" height="298" viewBox="0 0 380 298">
<defs>
<filter id="collaborators_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="collaborators_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="296" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#collaborators_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">TOP COLLABORATORS</text>
<g transform="translate(0, 36)">
<g transform="translate(36, 20)">
<circle cx="0" cy="0" r="18" fill="hsl(285, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">torvalds</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">4 repos · 142 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#27272a"/>
<rect x="200" y="-6" width="120.0" height="8" rx="4" fill="#c084fc" opacity="0.8">
<animate attributeName="width" from="0" to="120.0" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 70)">
<circle cx="0" cy="0" r="18" fill="hsl(165, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">G</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">gaearon</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">3 repos · 98 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#27272a"/>
<rect x="200" y="-6" width="82.8169014084507" height="8" rx="4" fill="#c084fc" opacity="0.8">
<animate attributeName="width" from="0" to="82.8169014084507" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 120)">
<circle cx="0" cy="0" r="18" fill="hsl(238, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">S</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">sindresorhus</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">2 repos · 64 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#27272a"/>
<rect x="200" y="-6" width="54.08450704225352" height="8" rx="4" fill="#c084fc" opacity="0.8">
<animate attributeName="width" from="0" to="54.08450704225352" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 170)">
<circle cx="0" cy="0" r="18" fill="hsl(157, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">tj</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">2 repos · 47 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#27272a"/>
<rect x="200" y="-6" width="39.71830985915493" height="8" rx="4" fill="#c084fc" opacity="0.8">
<animate attributeName="width" from="0" to="39.71830985915493" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 220)">
<circle cx="0" cy="0" r="18" fill="hsl(231, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">Y</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">yyx990803</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">1 repos · 31 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#27272a"/>
<rect x="200" y="-6" width="26.197183098591548" height="8" rx="4" fill="#c084fc" opacity="0.8">
<animate attributeName="width" from="0" to="26.197183098591548" dur="0.6s" fill="freeze"/>
</rect>
</g>
</g>
</svg>
<svg x="20" y="978" width="380" height="234" viewBox="0 0 380 234">
<defs>
<filter id="focus_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="focus_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="232" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#focus_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">RECENT FOCUS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#fafafa">Backend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#27272a"/>
<rect x="90" y="4" width="210.0" height="14" rx="7" fill="#58a6ff" opacity="0.8">
<animate attributeName="width" from="0" to="210.0" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">412 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#58a6ff">38%</text>
</g>
<g transform="translate(16, 36)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#fafafa">ML</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#27272a"/>
<rect x="90" y="4" width="132.6315789473684" height="14" rx="7" fill="#3fb950" opacity="0.8">
<animate attributeName="width" from="0" to="132.6315789473684" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">260 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#3fb950">24%</text>
</g>
<g transform="translate(16, 72)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#fafafa">Frontend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#27272a"/>
<rect x="90" y="4" width="99.47368421052632" height="14" rx="7" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="99.47368421052632" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">195 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#bc8cff">18%</text>
</g>
<g transform="translate(16, 108)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#fafafa">DevOps</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#27272a"/>
<rect x="90" y="4" width="66.3157894736842" height="14" rx="7" fill="#d29922" opacity="0.8">
<animate attributeName="width" from="0" to="66.3157894736842" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">130 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#d29922">12%</text>
</g>
<g transform="translate(16, 144)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#fafafa">Cloud</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#27272a"/>
<rect x="90" y="4" width="44.21052631578947" height="14" rx="7" fill="#f0883e" opacity="0.8">
<animate attributeName="width" from="0" to="44.21052631578947" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa">87 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#f0883e">8%</text>
</g>
<text x="16" y="188" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa" opacity="0.7">Recent activity · last year</text>
</g>
</svg>
<svg x="20" y="1228" width="380" height="208" viewBox="0 0 380 208">
<defs>
<filter id="languages_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="languages_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#languages_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#a1a1aa" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#18181b"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#fafafa">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#a1a1aa"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#fafafa">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#a1a1aa">4%</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="1452" width="380" height="274" viewBox="0 0 380 274">
<defs>
<filter id="achievements_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="achievements_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="272" rx="10" ry="10"
fill="#18181b" stroke="#27272a" stroke-width="1" filter="url(#achievements_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#a1a1aa" letter-spacing="0.8" opacity="0.7">ACHIEVEMENTS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 8)">
<rect width="348" height="48" rx="8" fill="#fb923c" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#fb923c" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="#fb923c" stroke-width="1.5"/>
<rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="#fb923c" opacity="0.85"/>
<path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="#fb923c" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">Hackathon winner</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Y Combinator AI Hackathon · 2025-11</text>
</g>
<g transform="translate(16, 64)">
<rect width="348" height="48" rx="8" fill="#4ade80" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#4ade80" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
fill="none" stroke="#4ade80" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">Speaker at PyCon</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Async at scale · 2024-05</text>
</g>
<g transform="translate(16, 120)">
<rect width="348" height="48" rx="8" fill="#a78bfa" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#a78bfa" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="#a78bfa" opacity="0.85"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">Open Source Award</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">GitHub Stars program · 2024-01</text>
</g>
<g transform="translate(16, 176)">
<rect width="348" height="48" rx="8" fill="#c084fc" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#c084fc" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="14" r="5" fill="#c084fc" opacity="0.2"/>
<circle cx="12" cy="14" r="4" fill="none" stroke="#c084fc" stroke-width="1.5"/>
<path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="#c084fc"/>
<path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="#c084fc" stroke-width="1.5" fill="none" stroke-linecap="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#fafafa">AWS Certified Solutions Architect</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#a1a1aa">Professional · 2023-09</text>
</g>
</g>
</svg>
<text x="210" y="1748" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#a1a1aa" opacity="0.5">Generated with gh-stats</text>
</svg>

After

Width:  |  Height:  |  Size: 38 KiB

+543
View File
@@ -0,0 +1,543 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="420" height="1756" viewBox="0 0 420 1756">
<rect width="420" height="1756" rx="16" fill="#faf8f5"/>
<rect x="0.5" y="0.5" width="419" height="1755" rx="16"
fill="none" stroke="#e0d8cf" stroke-width="1"/>
<svg x="20" y="20" width="380" height="226" viewBox="0 0 380 226">
<defs>
<filter id="grade_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="grade_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#grade_shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#ebe5dd" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#ebe5dd" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#3d3529">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#7a7062"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062" letter-spacing="0.4">Score <tspan fill="#3d3529" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#ebe5dd" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#7a7062" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#7a7062"/><line x1="7" y1="10" x2="7" y2="14" stroke="#7a7062" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#7a7062" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#3d3529">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#7a7062" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#7a7062" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#7a7062" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#3d3529">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#7a7062" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#3d3529">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#7a7062" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#7a7062" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#7a7062" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#7a7062" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#3d3529">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#7a7062" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#7a7062" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#7a7062" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#7a7062" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#3d3529">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#ebe5dd" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#b45309" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#b45309" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#b45309">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#b45309" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#b45309" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#b45309">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#b45309" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#b45309" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#b45309">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#b45309" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#b45309" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#b45309">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#b45309" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#b45309" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#b45309">Open source</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="262" width="380" height="200" viewBox="0 0 380 200">
<defs>
<filter id="impact_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="impact_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#impact_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7a7062" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="impact_areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#b45309" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#b45309" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7a7062">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#ebe5dd" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7a7062">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#ebe5dd" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7a7062">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#ebe5dd" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7a7062">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7a7062">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7a7062">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#impact_areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#b45309" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#3d3529">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">commits over 6mo</text>
</g>
</g>
</svg>
<svg x="20" y="478" width="380" height="170" viewBox="0 0 380 170">
<defs>
<filter id="streaks_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="streaks_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#streaks_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7a7062" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7a7062">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#b45309">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7a7062">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#3d3529">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#e0d8cf" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#ebe5dd"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#b45309"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#b45309"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">Sep 13 – Nov 12, 2025</text>
</g>
</svg>
<svg x="20" y="664" width="380" height="298" viewBox="0 0 380 298">
<defs>
<filter id="collaborators_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="collaborators_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="296" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#collaborators_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7a7062" letter-spacing="0.8" opacity="0.7">TOP COLLABORATORS</text>
<g transform="translate(0, 36)">
<g transform="translate(36, 20)">
<circle cx="0" cy="0" r="18" fill="hsl(285, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">torvalds</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">4 repos · 142 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#ebe5dd"/>
<rect x="200" y="-6" width="120.0" height="8" rx="4" fill="#7e22ce" opacity="0.8">
<animate attributeName="width" from="0" to="120.0" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 70)">
<circle cx="0" cy="0" r="18" fill="hsl(165, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">G</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">gaearon</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">3 repos · 98 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#ebe5dd"/>
<rect x="200" y="-6" width="82.8169014084507" height="8" rx="4" fill="#7e22ce" opacity="0.8">
<animate attributeName="width" from="0" to="82.8169014084507" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 120)">
<circle cx="0" cy="0" r="18" fill="hsl(238, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">S</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">sindresorhus</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">2 repos · 64 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#ebe5dd"/>
<rect x="200" y="-6" width="54.08450704225352" height="8" rx="4" fill="#7e22ce" opacity="0.8">
<animate attributeName="width" from="0" to="54.08450704225352" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 170)">
<circle cx="0" cy="0" r="18" fill="hsl(157, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">T</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">tj</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">2 repos · 47 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#ebe5dd"/>
<rect x="200" y="-6" width="39.71830985915493" height="8" rx="4" fill="#7e22ce" opacity="0.8">
<animate attributeName="width" from="0" to="39.71830985915493" dur="0.6s" fill="freeze"/>
</rect>
</g>
<g transform="translate(36, 220)">
<circle cx="0" cy="0" r="18" fill="hsl(231, 50%, 40%)"/>
<text x="0" y="1" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="600" fill="white">Y</text>
<text x="28" y="-2" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">yyx990803</text>
<text x="28" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">1 repos · 31 commits</text>
<rect x="200" y="-6" width="130" height="8" rx="4" fill="#ebe5dd"/>
<rect x="200" y="-6" width="26.197183098591548" height="8" rx="4" fill="#7e22ce" opacity="0.8">
<animate attributeName="width" from="0" to="26.197183098591548" dur="0.6s" fill="freeze"/>
</rect>
</g>
</g>
</svg>
<svg x="20" y="978" width="380" height="234" viewBox="0 0 380 234">
<defs>
<filter id="focus_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="focus_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="232" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#focus_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7a7062" letter-spacing="0.8" opacity="0.7">RECENT FOCUS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#3d3529">Backend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#ebe5dd"/>
<rect x="90" y="4" width="210.0" height="14" rx="7" fill="#58a6ff" opacity="0.8">
<animate attributeName="width" from="0" to="210.0" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">412 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#58a6ff">38%</text>
</g>
<g transform="translate(16, 36)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#3d3529">ML</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#ebe5dd"/>
<rect x="90" y="4" width="132.6315789473684" height="14" rx="7" fill="#3fb950" opacity="0.8">
<animate attributeName="width" from="0" to="132.6315789473684" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">260 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#3fb950">24%</text>
</g>
<g transform="translate(16, 72)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#3d3529">Frontend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#ebe5dd"/>
<rect x="90" y="4" width="99.47368421052632" height="14" rx="7" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="99.47368421052632" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">195 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#bc8cff">18%</text>
</g>
<g transform="translate(16, 108)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#3d3529">DevOps</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#ebe5dd"/>
<rect x="90" y="4" width="66.3157894736842" height="14" rx="7" fill="#d29922" opacity="0.8">
<animate attributeName="width" from="0" to="66.3157894736842" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">130 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#d29922">12%</text>
</g>
<g transform="translate(16, 144)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#3d3529">Cloud</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#ebe5dd"/>
<rect x="90" y="4" width="44.21052631578947" height="14" rx="7" fill="#f0883e" opacity="0.8">
<animate attributeName="width" from="0" to="44.21052631578947" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062">87 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#f0883e">8%</text>
</g>
<text x="16" y="188" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062" opacity="0.7">Recent activity · last year</text>
</g>
</svg>
<svg x="20" y="1228" width="380" height="208" viewBox="0 0 380 208">
<defs>
<filter id="languages_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="languages_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#languages_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7a7062" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#7a7062" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#f5f0eb"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#3d3529">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#3d3529">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7a7062">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#3d3529">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7a7062">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#3d3529">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7a7062">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#3d3529">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7a7062">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#3d3529">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7a7062">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#7a7062"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#3d3529">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7a7062">4%</text>
</g>
</g>
</g>
</svg>
<svg x="20" y="1452" width="380" height="274" viewBox="0 0 380 274">
<defs>
<filter id="achievements_shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="achievements_avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="272" rx="10" ry="10"
fill="#f5f0eb" stroke="#e0d8cf" stroke-width="1" filter="url(#achievements_shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7a7062" letter-spacing="0.8" opacity="0.7">ACHIEVEMENTS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 8)">
<rect width="348" height="48" rx="8" fill="#a16207" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#a16207" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="#a16207" stroke-width="1.5"/>
<rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="#a16207" opacity="0.85"/>
<path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="#a16207" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">Hackathon winner</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">Y Combinator AI Hackathon · 2025-11</text>
</g>
<g transform="translate(16, 64)">
<rect width="348" height="48" rx="8" fill="#4d7c0f" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#4d7c0f" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
fill="none" stroke="#4d7c0f" stroke-width="1.5" stroke-linejoin="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">Speaker at PyCon</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">Async at scale · 2024-05</text>
</g>
<g transform="translate(16, 120)">
<rect width="348" height="48" rx="8" fill="#b45309" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#b45309" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="#b45309" opacity="0.85"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">Open Source Award</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">GitHub Stars program · 2024-01</text>
</g>
<g transform="translate(16, 176)">
<rect width="348" height="48" rx="8" fill="#7e22ce" opacity="0.06"/>
<rect width="348" height="48" rx="8" fill="none" stroke="#7e22ce" stroke-width="0.5" opacity="0.3"/>
<g transform="translate(12, 12)">
<svg viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="14" r="5" fill="#7e22ce" opacity="0.2"/>
<circle cx="12" cy="14" r="4" fill="none" stroke="#7e22ce" stroke-width="1.5"/>
<path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="#7e22ce"/>
<path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="#7e22ce" stroke-width="1.5" fill="none" stroke-linecap="round"/>
</svg>
</g>
<text x="48" y="20" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="600" fill="#3d3529">AWS Certified Solutions Architect</text>
<text x="48" y="36" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7a7062">Professional · 2023-09</text>
</g>
</g>
</svg>
<text x="210" y="1748" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7a7062" opacity="0.5">Generated with gh-stats</text>
</svg>

After

Width:  |  Height:  |  Size: 38 KiB

+76
View File
@@ -0,0 +1,76 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="234" viewBox="0 0 380 234" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="232" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">RECENT FOCUS</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">Backend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="210.0" height="14" rx="7" fill="#58a6ff" opacity="0.8">
<animate attributeName="width" from="0" to="210.0" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">412 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#58a6ff">38%</text>
</g>
<g transform="translate(16, 36)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">ML</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="132.6315789473684" height="14" rx="7" fill="#3fb950" opacity="0.8">
<animate attributeName="width" from="0" to="132.6315789473684" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">260 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#3fb950">24%</text>
</g>
<g transform="translate(16, 72)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">Frontend</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="99.47368421052632" height="14" rx="7" fill="#bc8cff" opacity="0.8">
<animate attributeName="width" from="0" to="99.47368421052632" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">195 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#bc8cff">18%</text>
</g>
<g transform="translate(16, 108)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">DevOps</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="66.3157894736842" height="14" rx="7" fill="#d29922" opacity="0.8">
<animate attributeName="width" from="0" to="66.3157894736842" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">130 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#d29922">12%</text>
</g>
<g transform="translate(16, 144)">
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="600" fill="#d1d9e0">Cloud</text>
<rect x="90" y="4" width="210" height="14" rx="7" fill="#1e2836"/>
<rect x="90" y="4" width="44.21052631578947" height="14" rx="7" fill="#f0883e" opacity="0.8">
<animate attributeName="width" from="0" to="44.21052631578947" dur="0.7s" fill="freeze"/>
</rect>
<text x="90" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">87 commits</text>
<text x="308" y="15" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" font-weight="700" fill="#f0883e">8%</text>
</g>
<text x="16" y="188" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895" opacity="0.7">Recent activity · last year</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.1 KiB

+95
View File
@@ -0,0 +1,95 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="192" viewBox="0 0 380 192" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="190" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#1e2836" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#1e2836" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#d1d9e0">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#7d8895"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895" letter-spacing="0.4">Score <tspan fill="#d1d9e0" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#1e2836" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#7d8895" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#7d8895"/><line x1="7" y1="10" x2="7" y2="14" stroke="#7d8895" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#7d8895" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#7d8895" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#7d8895" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#7d8895" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#7d8895" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#7d8895" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#7d8895" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#7d8895" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#7d8895" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#7d8895" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#7d8895" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#7d8895" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#7d8895" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#1e2836" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Systems</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 7.2 KiB

+113
View File
@@ -0,0 +1,113 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="226" viewBox="0 0 380 226" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="224" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<g transform="translate(0, 0)">
<g transform="translate(52, 48)">
<circle cx="0" cy="0" r="36" fill="none" stroke="#1e2836" stroke-width="5"/>
<circle cx="0" cy="0" r="36" fill="none" stroke="#3fb950" stroke-width="5"
stroke-dasharray="226.1946710584651" stroke-dashoffset="26.23858184278195"
stroke-linecap="round" transform="rotate(-90)">
<animate attributeName="stroke-dashoffset" from="226.1946710584651" to="26.23858184278195" dur="1s" fill="freeze"/>
</circle>
<text x="0" y="10.50" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="30" font-weight="800" fill="#3fb950">A</text>
</g>
<line x1="100" y1="16" x2="100" y2="80" stroke="#1e2836" stroke-width="1"/>
<g transform="translate(114, 26)">
<text x="0" y="10" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="16" font-weight="700" fill="#d1d9e0">Developer Profile</text>
<text x="0" y="32" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" fill="#7d8895"></text>
<text x="0" y="50" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895" letter-spacing="0.4">Score <tspan fill="#d1d9e0" font-weight="600">88</tspan> / 100</text>
</g>
<line x1="20" y1="96" x2="360" y2="96" stroke="#1e2836" stroke-width="0.5"/>
<g transform="translate(20, 100)">
<g transform="translate(34.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="7" cy="7" r="3" fill="none" stroke="#7d8895" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="#7d8895"/><line x1="7" y1="10" x2="7" y2="14" stroke="#7d8895" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="#7d8895" stroke-width="1.4"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">1,423</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Commits</text>
</g>
<g transform="translate(102.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="4" cy="4" r="2" fill="none" stroke="#7d8895" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="#7d8895" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="#7d8895" stroke-width="1.2"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">87</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">PRs</text>
</g>
<g transform="translate(170.0, 0)">
<g transform="translate(-7, 0)"><g><path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="#7d8895" stroke-width="1.2" stroke-linejoin="round"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">342</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Stars</text>
</g>
<g transform="translate(238.0, 0)">
<g transform="translate(-7, 0)"><g><rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="#7d8895" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="#7d8895" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="#7d8895" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="#7d8895" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">28</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Repos</text>
</g>
<g transform="translate(306.0, 0)">
<g transform="translate(-7, 0)"><g><circle cx="5" cy="4" r="2.5" fill="none" stroke="#7d8895" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="#7d8895" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="#7d8895" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="#7d8895" stroke-width="1"/></g></g>
<text x="0" y="28" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="14" font-weight="700" fill="#d1d9e0">156</text>
<text x="0" y="41" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">Followers</text>
</g>
</g>
<line x1="20" y1="148" x2="360" y2="148" stroke="#1e2836" stroke-width="0.5"/>
<g transform="translate(20, 154)">
<g transform="translate(0, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Backend</text>
</g>
<g transform="translate(70, 0)" opacity="0.9">
<rect width="31" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="31" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="15" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">ML</text>
</g>
<g transform="translate(107, 0)" opacity="0.9">
<rect width="64" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="64" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="32" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Systems</text>
</g>
<g transform="translate(177, 0)" opacity="0.9">
<rect width="51" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="51" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="25" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Cloud</text>
</g>
<g transform="translate(234, 0)" opacity="0.9">
<rect width="90" height="24" rx="12" fill="#facc15" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#facc15" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#facc15">Founder #42</text>
</g>
<g transform="translate(0, 30)" opacity="0.55">
<rect width="90" height="24" rx="12" fill="#58a6ff" opacity="0.12"/>
<rect width="90" height="24" rx="12" fill="none" stroke="#58a6ff" stroke-width="1" opacity="0.3"/>
<text x="45" y="16" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="500" fill="#58a6ff">Open source</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.6 KiB

+30
View File
@@ -0,0 +1,30 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="200" viewBox="0 0 380 200" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#a78bfa" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#a78bfa" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#a78bfa" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#d1d9e0">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">commits over 6mo</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

+30
View File
@@ -0,0 +1,30 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="200" viewBox="0 0 380 200" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="198" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">IMPACT TIMELINE</text>
<g transform="translate(0, 36)">
<defs>
<linearGradient id="areaGrad" x1="0" y1="8" x2="0" y2="90" gradientUnits="userSpaceOnUse">
<stop offset="0%" stop-color="#58a6ff" stop-opacity="0.35"/>
<stop offset="100%" stop-color="#58a6ff" stop-opacity="0.02"/>
</linearGradient>
</defs>
<text x="34" y="12.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">41</text><line x1="40" y1="8.0" x2="356" y2="8.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="53.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">20</text><line x1="40" y1="49.0" x2="356" y2="49.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/><text x="34" y="94.0" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">0</text><line x1="40" y1="90.0" x2="356" y2="90.0" stroke="#1e2836" stroke-width="0.5" stroke-dasharray="3,3"/>
<text x="40.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2025-10</text><text x="204.3" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2026-01</text><text x="356.0" y="104" text-anchor="middle" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif" font-size="9" fill="#7d8895">2026-04</text>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0 L 356.0 90 L 40.0 90 Z" fill="url(#areaGrad)"/>
<path d="M 40.0 84.0 C 46.3 84.0, 46.3 80.0, 52.6 80.0 C 59.0 80.0, 59.0 74.0, 65.3 74.0 C 71.6 74.0, 71.6 78.0, 77.9 78.0 C 84.2 78.0, 84.2 68.0, 90.6 68.0 C 96.9 68.0, 96.9 62.0, 103.2 62.0 C 109.5 62.0, 109.5 72.0, 115.8 72.0 C 122.2 72.0, 122.2 66.0, 128.5 66.0 C 134.8 66.0, 134.8 54.0, 141.1 54.0 C 147.4 54.0, 147.4 46.0, 153.8 46.0 C 160.1 46.0, 160.1 56.0, 166.4 56.0 C 172.7 56.0, 172.7 52.0, 179.0 52.0 C 185.4 52.0, 185.4 40.0, 191.7 40.0 C 198.0 40.0, 198.0 48.0, 204.3 48.0 C 210.6 48.0, 210.6 34.0, 217.0 34.0 C 223.3 34.0, 223.3 26.0, 229.6 26.0 C 235.9 26.0, 235.9 38.0, 242.2 38.0 C 248.6 38.0, 248.6 42.0, 254.9 42.0 C 261.2 42.0, 261.2 30.0, 267.5 30.0 C 273.8 30.0, 273.8 20.0, 280.2 20.0 C 286.5 20.0, 286.5 32.0, 292.8 32.0 C 299.1 32.0, 299.1 24.0, 305.4 24.0 C 311.8 24.0, 311.8 8.0, 318.1 8.0 C 324.4 8.0, 324.4 14.0, 330.7 14.0 C 337.0 14.0, 337.0 22.0, 343.4 22.0 C 349.7 22.0, 349.7 16.0, 356.0 16.0" fill="none" stroke="#58a6ff" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, 136)">
<text x="0" y="0" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="13" font-weight="700" fill="#d1d9e0">577</text>
<text x="0" y="14" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="9" fill="#7d8895">commits over 6mo</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

+71
View File
@@ -0,0 +1,71 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="164" viewBox="0 0 380 164" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="162" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="64.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="126.1 150.4" stroke-dashoffset="0.0"
transform="rotate(-90 60 64.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="64.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="70.8 205.7" stroke-dashoffset="-126.1"
transform="rotate(-90 60 64.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="150.4" to="-126.1" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="64.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="46.2 230.3" stroke-dashoffset="-196.8"
transform="rotate(-90 60 64.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="79.6" to="-196.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="64.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="33.7 242.7" stroke-dashoffset="-243.0"
transform="rotate(-90 60 64.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="33.5" to="-243.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="64.0" r="28" fill="#1a2230"/>
<text x="60" y="65.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#d1d9e0">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">46%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">26%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">17%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">12%</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

+95
View File
@@ -0,0 +1,95 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="208" viewBox="0 0 380 208" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="206" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">LANGUAGES</text>
<g transform="translate(0, 36)">
<g transform="translate(16, 0)">
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3572A5" stroke-width="16"
stroke-dasharray="113.3 163.1" stroke-dashoffset="0.0"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="276.5" to="0.0" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#3178c6" stroke-width="16"
stroke-dasharray="63.6 212.9" stroke-dashoffset="-113.3"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="163.1" to="-113.3" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#00ADD8" stroke-width="16"
stroke-dasharray="41.5 235.0" stroke-dashoffset="-176.9"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="99.5" to="-176.9" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#dea584" stroke-width="16"
stroke-dasharray="30.4 246.0" stroke-dashoffset="-218.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="58.1" to="-218.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#89e051" stroke-width="16"
stroke-dasharray="16.6 259.9" stroke-dashoffset="-248.8"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="27.6" to="-248.8" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="44" fill="none" stroke="#7d8895" stroke-width="16"
stroke-dasharray="11.1 265.4" stroke-dashoffset="-265.4"
transform="rotate(-90 60 86.0)" opacity="0.85">
<animate attributeName="stroke-dashoffset" from="11.1" to="-265.4" dur="0.8s" fill="freeze"/>
</circle>
<circle cx="60" cy="86.0" r="28" fill="#1a2230"/>
<text x="60" y="87.0" text-anchor="middle" dominant-baseline="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="700" fill="#d1d9e0">Python</text>
<g transform="translate(140, 20)">
<rect width="10" height="10" rx="2" fill="#3572A5"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Python</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">41%</text>
</g>
<g transform="translate(140, 42)">
<rect width="10" height="10" rx="2" fill="#3178c6"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">TypeScript</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">23%</text>
</g>
<g transform="translate(140, 64)">
<rect width="10" height="10" rx="2" fill="#00ADD8"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Go</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">15%</text>
</g>
<g transform="translate(140, 86)">
<rect width="10" height="10" rx="2" fill="#dea584"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Rust</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">11%</text>
</g>
<g transform="translate(140, 108)">
<rect width="10" height="10" rx="2" fill="#89e051"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Shell</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">6%</text>
</g>
<g transform="translate(140, 130)">
<rect width="10" height="10" rx="2" fill="#7d8895"/>
<text x="16" y="9" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="12" fill="#d1d9e0">Other</text>
<text x="210" y="9" text-anchor="end" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="11" font-weight="600" fill="#7d8895">4%</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.8 KiB

+43
View File
@@ -0,0 +1,43 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="170" viewBox="0 0 380 170" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7d8895">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#3fb950">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7d8895">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#d1d9e0">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#2a3444" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#1e2836"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#3fb950"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#3fb950"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Sep 13 – Nov 12, 2025</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

+43
View File
@@ -0,0 +1,43 @@
<svg xmlns="http://www.w3.org/2000/svg" width="380" height="170" viewBox="0 0 380 170" fill="none">
<defs>
<filter id="shadow" x="-2%" y="-2%" width="104%" height="104%">
<feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/>
</filter>
<clipPath id="avatarClip"><circle cx="0" cy="0" r="18"/></clipPath>
</defs>
<rect x="1" y="1" width="378" height="168" rx="10" ry="10"
fill="#1a2230" stroke="#2a3444" stroke-width="1" filter="url(#shadow)"/>
<text x="20" y="30" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Noto Sans,Helvetica,Arial,sans-serif" font-size="11" font-weight="600" fill="#7d8895" letter-spacing="0.8" opacity="0.7">STREAKS</text>
<g transform="translate(0, 36)">
<text x="105" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7d8895">CURRENT</text>
<text x="105" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#58a6ff">23</text>
<text x="275" y="22" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" font-weight="600" letter-spacing="1.4"
fill="#7d8895">LONGEST</text>
<text x="275" y="66" text-anchor="middle"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="40" font-weight="800" fill="#d1d9e0">61</text>
<line x1="190" y1="10" x2="190" y2="76"
stroke="#2a3444" stroke-width="1"/>
<rect x="50" y="92" width="280" height="5" rx="2.5" fill="#1e2836"/>
<rect x="50" y="92" width="105.57" height="5" rx="2.5" fill="#58a6ff"/>
<circle cx="155.57" cy="94.5" r="3.5" fill="#58a6ff"/>
<text x="50" y="116"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Mar 30 – Today</text>
<text x="330" y="116" text-anchor="end"
font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
font-size="10" fill="#7d8895">Sep 13 – Nov 12, 2025</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
View File
Binary file not shown.
+89
View File
@@ -0,0 +1,89 @@
name: ghstats
services:
fetcher:
image: ghcr.io/shaymanor/ghstats-fetcher:${IMAGE_TAG:-latest}
container_name: ghstats-fetcher
restart: unless-stopped
environment:
GITHUB_PAT: ${GITHUB_PAT:?missing GITHUB_PAT}
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?missing FETCHER_INTERNAL_TOKEN}
GENERATOR_URL: http://generator:5002
volumes:
- ${HOME}/ghstats/data/fetcher:/app/data
ports:
- "127.0.0.1:5001:5001"
fetcher-cron:
image: ghcr.io/shaymanor/ghstats-fetcher:${IMAGE_TAG:-latest}
container_name: ghstats-fetcher-cron
restart: unless-stopped
command: ["python", "-m", "src.cron"]
environment:
GITHUB_PAT: ${GITHUB_PAT:?missing GITHUB_PAT}
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?missing FETCHER_INTERNAL_TOKEN}
volumes:
- ${HOME}/ghstats/data/fetcher:/app/data
depends_on:
- fetcher
generator:
image: ghcr.io/shaymanor/ghstats-generator:${IMAGE_TAG:-latest}
container_name: ghstats-generator
restart: unless-stopped
environment:
FETCHER_URL: http://fetcher:5001
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?missing FETCHER_INTERNAL_TOKEN}
GH_OAUTH_CLIENT_ID: ${GH_OAUTH_CLIENT_ID:?missing GH_OAUTH_CLIENT_ID}
GH_OAUTH_CLIENT_SECRET: ${GH_OAUTH_CLIENT_SECRET:?missing GH_OAUTH_CLIENT_SECRET}
GENERATOR_SECRET_KEY: ${GENERATOR_SECRET_KEY:?missing GENERATOR_SECRET_KEY}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://gh-stats.com}
BUILD_VERSION: ${IMAGE_TAG:-}
DEV_DASHBOARD_USER: ${DEV_DASHBOARD_USER:?missing DEV_DASHBOARD_USER}
DEV_DASHBOARD_PASSWORD: ${DEV_DASHBOARD_PASSWORD:?missing DEV_DASHBOARD_PASSWORD}
volumes:
- ${HOME}/ghstats/data/generator:/app/data
ports:
- "127.0.0.1:5002:5002"
depends_on:
- fetcher
generator-worker:
image: ghcr.io/shaymanor/ghstats-generator:${IMAGE_TAG:-latest}
container_name: ghstats-generator-worker
restart: unless-stopped
command: ["python", "-m", "src.worker"]
environment:
FETCHER_URL: http://fetcher:5001
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?missing FETCHER_INTERNAL_TOKEN}
BUILD_VERSION: ${IMAGE_TAG:-}
volumes:
- ${HOME}/ghstats/data/generator:/app/data
depends_on:
- generator
generator-cron:
image: ghcr.io/shaymanor/ghstats-generator:${IMAGE_TAG:-latest}
container_name: ghstats-generator-cron
restart: unless-stopped
command: ["python", "-m", "src.cron"]
environment:
FETCHER_URL: http://fetcher:5001
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?missing FETCHER_INTERNAL_TOKEN}
BUILD_VERSION: ${IMAGE_TAG:-}
volumes:
- ${HOME}/ghstats/data/generator:/app/data
depends_on:
- generator
edge:
image: ghcr.io/shaymanor/ghstats-edge:${IMAGE_TAG:-latest}
container_name: ghstats-edge
restart: unless-stopped
environment:
GENERATOR_URL: http://generator:5002
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?missing FETCHER_INTERNAL_TOKEN}
ports:
- "127.0.0.1:5003:5003"
depends_on:
- generator
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Pulls the current image tag and brings up the compose stack.
# Expects GITHUB_PAT, FETCHER_INTERNAL_TOKEN, and IMAGE_TAG to be present in
# the environment (exported by the GitHub Actions deploy job).
set -euo pipefail
cd "$(dirname "$0")"
mkdir -p "$HOME/ghstats/data/fetcher" "$HOME/ghstats/data/generator"
docker compose pull
docker compose up -d --remove-orphans
docker compose ps
+72
View File
@@ -0,0 +1,72 @@
# Self-hosting gh-stats.
#
# Runs the same three services and the same published images that gh-stats.com
# runs. Everything is optional except GITHUB_PAT and FETCHER_INTERNAL_TOKEN.
#
# cp .env.example .env # then put your PAT in it
# docker compose up -d --build
# open http://localhost:5002
#
# The production deploy uses deploy/compose.yml instead; this file is the
# stripped-down version for running it on your own box.
name: ghstats
x-fetcher-env: &fetcher-env
GITHUB_PAT: ${GITHUB_PAT:?set GITHUB_PAT in .env - see .env.example}
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?set FETCHER_INTERNAL_TOKEN in .env - any random string}
services:
fetcher:
build: ./fetcher
image: ghstats-fetcher:local
restart: unless-stopped
environment:
<<: *fetcher-env
GENERATOR_URL: http://generator:5002
volumes:
- ./data/fetcher:/app/data
fetcher-cron:
build: ./fetcher
image: ghstats-fetcher:local
restart: unless-stopped
command: ["python", "-m", "src.cron"]
environment: *fetcher-env
volumes:
- ./data/fetcher:/app/data
depends_on: [fetcher]
generator:
build: ./generator
image: ghstats-generator:local
restart: unless-stopped
environment: &generator-env
FETCHER_URL: http://fetcher:5001
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?set FETCHER_INTERNAL_TOKEN in .env - any random string}
volumes:
- ./data/generator:/app/data
ports:
- "${GHSTATS_PORT:-5002}:5002"
depends_on: [fetcher]
generator-worker:
build: ./generator
image: ghstats-generator:local
restart: unless-stopped
command: ["python", "-m", "src.worker"]
environment: *generator-env
volumes:
- ./data/generator:/app/data
depends_on: [generator]
edge:
build: ./edge
image: ghstats-edge:local
restart: unless-stopped
environment:
GENERATOR_URL: http://generator:5002
FETCHER_INTERNAL_TOKEN: ${FETCHER_INTERNAL_TOKEN:?set FETCHER_INTERNAL_TOKEN in .env - any random string}
ports:
- "${GHSTATS_EDGE_PORT:-5003}:5003"
depends_on: [generator]
+10
View File
@@ -0,0 +1,10 @@
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY src ./src
EXPOSE 5003
# Bind to $PORT when set (e.g. Cloud Run injects PORT=8080); default to 5003.
CMD ["sh", "-c", "exec gunicorn -b 0.0.0.0:${PORT:-5003} -w 2 src.api:app"]
+35
View File
@@ -0,0 +1,35 @@
# Edge Service
Cache-first SVG proxy in front of the generator. Deploy many instances
around the world. No DB of its own; optional Redis for shared cache.
## Run locally
cd edge
pip install -r requirements.txt
GENERATOR_URL=http://localhost:5002 python -m src.api
## Test
cd edge && pytest
## Docker
docker build -t ghstats-edge .
docker run --rm -e GENERATOR_URL=http://host.docker.internal:5002 -p 5003:5003 ghstats-edge
## Endpoints
| Method | Path | Description |
|---|---|---|
| GET | /health | cache type + upstream reachability |
| GET | /<u> | composite SVG (cached on X-Widget-Status: ready) |
| GET | /<u>/<w>.svg | individual widget SVG |
## Env
- `GENERATOR_URL` — origin (required)
- `CACHE_TYPE` — `SimpleCache` (default) or `RedisCache`
- `CACHE_REDIS_URL` — if using RedisCache
- `CACHE_DEFAULT_TIMEOUT` — seconds, default 86400
- `CACHE_THRESHOLD` — max entries (SimpleCache only), default 10000
+5
View File
@@ -0,0 +1,5 @@
[pytest]
testpaths = tests
python_files = test_*.py
pythonpath = .
addopts = -ra --strict-markers
+7
View File
@@ -0,0 +1,7 @@
flask==3.0.3
flask-caching==2.3.0
flask-compress==1.15
requests==2.32.3
pytest==8.3.3
responses==0.25.3
gunicorn==23.0.0
View File
+93
View File
@@ -0,0 +1,93 @@
"""Edge analytics — record + flush + push to generator.
The hot path enqueues; the background thread does the network I/O. If the
generator is unreachable we drop the batch (logging a warning) and let the
queue catch the next tick.
"""
import logging
import threading
import time
from collections import deque
import requests
from . import config
log = logging.getLogger("edge.analytics")
_QUEUE: deque = deque(maxlen=config.ANALYTICS_QUEUE_MAX)
_QUEUE_LOCK = threading.Lock()
_THREAD_LOCK = threading.Lock()
_FLUSH_THREAD: threading.Thread | None = None
_events_dropped: int = 0
_drop_lock = threading.Lock()
def _reset_for_tests() -> None:
global _events_dropped, _FLUSH_THREAD, _QUEUE
with _QUEUE_LOCK:
_QUEUE = deque(maxlen=config.ANALYTICS_QUEUE_MAX)
with _drop_lock:
_events_dropped = 0
_FLUSH_THREAD = None
def record_request(endpoint: str, username: str | None, widget: str | None,
status: int, latency_ms: int, cache_hit: int | None = None) -> None:
ev = {
"ts": int(time.time()),
"service": "edge",
"kind": "request",
"username": username,
"endpoint": endpoint,
"widget": widget,
"status": int(status),
"latency_ms": int(latency_ms),
"cache_hit": cache_hit,
}
global _events_dropped
with _QUEUE_LOCK:
if len(_QUEUE) >= _QUEUE.maxlen:
with _drop_lock:
_events_dropped += 1
return
_QUEUE.append(ev)
def flush_now() -> int:
with _QUEUE_LOCK:
batch = list(_QUEUE)
_QUEUE.clear()
if not batch:
return 0
if not config.ANALYTICS_GENERATOR_URL or not config.ANALYTICS_INTERNAL_TOKEN:
return 0
try:
requests.post(
f"{config.ANALYTICS_GENERATOR_URL}/internal/analytics/events",
headers={"X-Internal-Token": config.ANALYTICS_INTERNAL_TOKEN},
json={"events": batch},
timeout=2,
)
except Exception:
log.warning("analytics flush failed (events lost)", exc_info=True)
return 0
return len(batch)
def _flush_loop():
while True:
time.sleep(config.ANALYTICS_FLUSH_SECONDS)
try:
flush_now()
except Exception:
log.exception("flush loop error")
def start_flush_thread():
global _FLUSH_THREAD
with _THREAD_LOCK:
if _FLUSH_THREAD is not None and _FLUSH_THREAD.is_alive():
return
t = threading.Thread(target=_flush_loop, name="edge-analytics-flush", daemon=True)
t.start()
_FLUSH_THREAD = t
+176
View File
@@ -0,0 +1,176 @@
"""Edge service — cache-first SVG proxy in front of the generator."""
import logging
import re
import time
from collections import defaultdict, deque
from threading import Lock
import requests
from flask import Flask, Response, jsonify, request
from flask_compress import Compress
from . import analytics, cache as cache_mod, config
app = Flask(__name__)
# Tolerate stray trailing slashes on every route, matching the generator. A
# hand-copied embed URL like `/alice/` should resolve like `/alice` instead of
# Flask's default strict_slashes 404. Set before the route decorators run.
app.url_map.strict_slashes = False
Compress(app)
cache_ext = cache_mod.build_cache(app)
log = logging.getLogger("edge")
analytics.start_flush_thread()
# GitHub usernames: 1-39 chars, alnum, single hyphens. Keep the regex in
# sync with generator/src/utils/validate.py so invalid paths get rejected
# before they waste an upstream round-trip.
_USERNAME_RE = re.compile(r"^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$")
_ALLOWED_WIDGETS = {"grade", "impact", "collaborators", "focus", "languages", "achievements", "composite"}
def _valid_username(u: str) -> bool:
return bool(u) and bool(_USERNAME_RE.match(u))
# ---- Per-IP rate limiter ---------------------------------------------------
# The edge is the mini PC's front door. Cache hits are cheap, but a hostile
# cache-miss storm (unique usernames, unique widget names) would funnel into
# the generator's render path. Bound it here so the generator's own limiter
# isn't the only layer. Operators who run behind a CDN / nginx should prefer
# the upstream limiter and raise these env vars.
_rate_lock = Lock()
_rate_hits: dict[str, deque] = defaultdict(deque)
def _client_ip() -> str:
fwd = request.headers.get("X-Forwarded-For", "")
if fwd:
return fwd.split(",")[-1].strip()
return request.remote_addr or "unknown"
def _allow(ip: str) -> bool:
now = time.time()
cutoff = now - config.RATE_LIMIT_WINDOW
with _rate_lock:
q = _rate_hits[ip]
while q and q[0] < cutoff:
q.popleft()
if len(q) >= config.RATE_LIMIT_MAX:
return False
q.append(now)
return True
def _cache_key(path: str) -> str:
return f"edge:{path}"
def _fetch_origin(path: str, client_ip: str) -> requests.Response:
url = f"{config.GENERATOR_URL}/api/{path}"
# Forward the caller's IP so the generator's rate limiter can
# discriminate per user rather than treating the edge's single IP as
# one client — otherwise the first 300 requests/min exhaust the bucket
# for everyone behind the edge.
headers = {"X-Forwarded-For": client_ip}
return requests.get(url, headers=headers, timeout=config.UPSTREAM_TIMEOUT)
@app.route("/health", methods=["GET"])
def health():
ok = True
try:
r = requests.get(f"{config.GENERATOR_URL}/api/health", timeout=config.UPSTREAM_TIMEOUT)
ok = r.status_code == 200
except Exception:
ok = False
return jsonify({"service": "edge", "cache_type": config.CACHE_TYPE, "upstream_ok": ok})
@app.route("/<username>", methods=["GET"])
def serve(username: str):
if not _valid_username(username):
return jsonify({"error": "invalid_username"}), 400
# GitHub usernames are case-insensitive; canonicalize to lowercase so the
# cache key and the upstream path don't fragment by case.
username = username.lower()
return _serve(username, path=username)
@app.route("/<username>/<widget>.svg", methods=["GET"])
def serve_widget(username: str, widget: str):
if not _valid_username(username):
return jsonify({"error": "invalid_username"}), 400
if widget not in _ALLOWED_WIDGETS:
return jsonify({"error": "unknown_widget"}), 400
username = username.lower()
return _serve(f"{username}/{widget}", path=f"{username}/{widget}.svg")
def _serve(key_suffix: str, path: str) -> Response:
t0 = time.monotonic()
ip = _client_ip()
if not _allow(ip):
return jsonify({"error": "rate_limited"}), 429
ck = _cache_key(key_suffix)
cached = cache_ext.get(ck)
if cached is not None:
body, content_type = cached
resp = Response(body, mimetype=content_type, headers={
"X-Widget-Status": "ready",
"X-Cache": "HIT",
"Cache-Control": "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400",
})
_record(path, key_suffix, 200, t0, cache_hit=1)
return resp
try:
r = _fetch_origin(path, ip)
except Exception as e:
log.warning("origin unreachable for %s: %s", path, e)
_record(path, key_suffix, 503, t0, cache_hit=0)
return jsonify({"error": "origin unreachable"}), 503
if r.status_code >= 500:
_record(path, key_suffix, 503, t0, cache_hit=0)
return jsonify({"error": "origin error"}), 503
status = r.headers.get("X-Widget-Status", "ready")
content_type = r.headers.get("Content-Type", "image/svg+xml")
if status == "ready" and r.status_code == 200:
cache_ext.set(ck, (r.content, content_type), timeout=config.CACHE_DEFAULT_TIMEOUT)
cc = "public, max-age=3600, s-maxage=86400, stale-while-revalidate=86400"
else:
cc = "no-store"
_record(path, key_suffix, r.status_code, t0, cache_hit=0)
return Response(r.content, status=r.status_code, mimetype=content_type, headers={
"X-Widget-Status": status,
"X-Cache": "MISS",
"Cache-Control": cc,
})
def _record(path: str, key_suffix: str, status: int, t0: float, cache_hit: int) -> None:
"""Normalize the edge URL into (endpoint_template, username, widget)
so the dashboard can group across users without exploding cardinality."""
if "/" in key_suffix:
username, widget = key_suffix.split("/", 1)
endpoint = "/<u>/<widget>.svg"
else:
username = key_suffix
widget = "composite"
endpoint = "/<u>"
analytics.record_request(
endpoint=endpoint, username=username, widget=widget,
status=status, latency_ms=int((time.monotonic() - t0) * 1000),
cache_hit=cache_hit,
)
def main():
app.run(host="0.0.0.0", port=config.PORT)
if __name__ == "__main__":
main()
+16
View File
@@ -0,0 +1,16 @@
"""Flask-Caching config. v1 = SimpleCache (in-process). Swap to RedisCache via env."""
from flask_caching import Cache
from . import config
def build_cache(app) -> Cache:
cfg = {
"CACHE_TYPE": config.CACHE_TYPE,
"CACHE_DEFAULT_TIMEOUT": config.CACHE_DEFAULT_TIMEOUT,
"CACHE_THRESHOLD": config.CACHE_THRESHOLD,
}
if config.CACHE_TYPE == "RedisCache" and config.CACHE_REDIS_URL:
cfg["CACHE_REDIS_URL"] = config.CACHE_REDIS_URL
c = Cache(config=cfg)
c.init_app(app)
return c
+21
View File
@@ -0,0 +1,21 @@
import os
PORT = int(os.getenv("EDGE_PORT", "5003"))
GENERATOR_URL = os.getenv("GENERATOR_URL", "http://localhost:5002")
CACHE_TYPE = os.getenv("CACHE_TYPE", "SimpleCache")
CACHE_REDIS_URL = os.getenv("CACHE_REDIS_URL", "")
CACHE_DEFAULT_TIMEOUT = int(os.getenv("CACHE_DEFAULT_TIMEOUT", "86400"))
CACHE_THRESHOLD = int(os.getenv("CACHE_THRESHOLD", "10000"))
UPSTREAM_TIMEOUT = int(os.getenv("EDGE_UPSTREAM_TIMEOUT", "10"))
# Per-IP rate limit at the edge. Anti-abuse only — cache hits are cheap
# and cache misses are already bounded by the generator's global
# semaphore, so normal traffic should never notice this. Generous by
# default; tighten via env if a specific IP misbehaves.
RATE_LIMIT_MAX = int(os.getenv("EDGE_RATE_LIMIT_MAX", "3000"))
RATE_LIMIT_WINDOW = int(os.getenv("EDGE_RATE_LIMIT_WINDOW", "60"))
ANALYTICS_GENERATOR_URL = os.getenv("ANALYTICS_GENERATOR_URL", os.getenv("GENERATOR_URL", "http://localhost:5002"))
ANALYTICS_INTERNAL_TOKEN = os.getenv("FETCHER_INTERNAL_TOKEN", "")
ANALYTICS_FLUSH_SECONDS = int(os.getenv("ANALYTICS_FLUSH_SECONDS", "5"))
ANALYTICS_QUEUE_MAX = int(os.getenv("ANALYTICS_QUEUE_MAX", "2000"))
View File
+46
View File
@@ -0,0 +1,46 @@
import responses
from src import analytics as a
from src import config as cfg
def test_record_request_enqueues():
a._reset_for_tests()
a.record_request("/<u>", "alice", "composite", 200, 12, cache_hit=1)
assert len(a._QUEUE) == 1
e = a._QUEUE[0]
assert e["service"] == "edge"
assert e["username"] == "alice"
assert e["latency_ms"] == 12
@responses.activate
def test_flush_posts_batch(monkeypatch):
monkeypatch.setattr(cfg, "ANALYTICS_GENERATOR_URL", "http://gen:5002")
monkeypatch.setattr(cfg, "ANALYTICS_INTERNAL_TOKEN", "secret")
a._reset_for_tests()
responses.add(responses.POST, "http://gen:5002/internal/analytics/events",
json={"ingested": 2}, status=200)
a.record_request("/<u>", "alice", "composite", 200, 12, cache_hit=1)
a.record_request("/<u>", "bob", "composite", 200, 8, cache_hit=0)
a.flush_now()
assert len(responses.calls) == 1
import json
body = json.loads(responses.calls[0].request.body)
assert len(body["events"]) == 2
def test_instrument_wraps_serve_and_records(monkeypatch):
monkeypatch.setattr(cfg, "ANALYTICS_INTERNAL_TOKEN", "secret")
a._reset_for_tests()
from src import api as apimod
with apimod.app.test_client() as c:
class FakeResp:
status_code = 200
content = b"<svg/>"
headers = {"X-Widget-Status": "ready", "Content-Type": "image/svg+xml"}
monkeypatch.setattr(apimod, "_fetch_origin", lambda *a, **k: FakeResp())
apimod.cache_ext.clear()
c.get("/alice")
assert len(a._QUEUE) == 1
assert a._QUEUE[0]["username"] == "alice"
assert a._QUEUE[0]["endpoint"] == "/<u>"
+60
View File
@@ -0,0 +1,60 @@
import pytest
import responses
from src import api as apimod
@pytest.fixture
def client(monkeypatch):
monkeypatch.setattr(apimod.config, "GENERATOR_URL", "http://gen:5002")
apimod.cache_ext.clear()
apimod.app.config["TESTING"] = True
with apimod.app.test_client() as c:
yield c
@responses.activate
def test_miss_then_hit_serves_from_cache(client):
responses.add(responses.GET, "http://gen:5002/api/alice",
body=b"<svg>ready</svg>", status=200,
headers={"X-Widget-Status": "ready", "Content-Type": "image/svg+xml"})
r1 = client.get("/alice")
assert r1.status_code == 200
assert r1.data == b"<svg>ready</svg>"
responses.reset()
r2 = client.get("/alice")
assert r2.status_code == 200
assert r2.data == b"<svg>ready</svg>"
@responses.activate
def test_placeholder_not_cached(client):
responses.add(responses.GET, "http://gen:5002/api/alice",
body=b"<svg>building</svg>", status=200,
headers={"X-Widget-Status": "building", "Content-Type": "image/svg+xml"})
r1 = client.get("/alice")
assert r1.status_code == 200
r2 = client.get("/alice")
assert len(responses.calls) == 2
@responses.activate
def test_origin_error_returns_503(client):
responses.add(responses.GET, "http://gen:5002/api/alice", status=500)
r = client.get("/alice")
assert r.status_code == 503
@responses.activate
def test_trailing_slash_tolerated(client):
"""A hand-copied `/alice/` must resolve like `/alice`, not 404."""
responses.add(responses.GET, "http://gen:5002/api/alice",
body=b"<svg>ready</svg>", status=200,
headers={"X-Widget-Status": "ready", "Content-Type": "image/svg+xml"})
r = client.get("/alice/")
assert r.status_code == 200
assert r.data == b"<svg>ready</svg>"
def test_health(client):
r = client.get("/health")
assert r.status_code == 200
+14
View File
@@ -0,0 +1,14 @@
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY src ./src
RUN mkdir -p /app/data
EXPOSE 5001
ENV FETCHER_DB_PATH=/app/data/fetcher.db
# Default is the API. Override CMD for cron: ["python", "-m", "src.cron"]
CMD ["gunicorn", "-b", "0.0.0.0:5001", "-w", "2", "src.api:app"]
+37
View File
@@ -0,0 +1,37 @@
# Fetcher Service
Owns every GitHub API interaction. Holds the PAT. Exposes cached payloads
over an internal-only HTTP API protected by a shared secret.
## Run locally
cd fetcher
pip install -r requirements.txt
FETCHER_INTERNAL_TOKEN=dev GITHUB_PAT=ghp_xxx python -m src.api
Cron (separate process):
FETCHER_INTERNAL_TOKEN=dev GITHUB_PAT=ghp_xxx python -m src.cron
## Test
cd fetcher && pytest
## Docker
docker build -t ghstats-fetcher .
docker run -e GITHUB_PAT=ghp_xxx -e FETCHER_INTERNAL_TOKEN=dev -p 5001:5001 -v $(pwd)/data:/app/data ghstats-fetcher
# cron: override CMD to ["python","-m","src.cron"]
## Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health | none | health check |
| GET | /data/<u> | X-Internal-Token | return stored payload; auto-fetches on miss |
| POST | /fetch | X-Internal-Token | force re-fetch (body: {username}) |
| GET | /avatar/<u> | X-Internal-Token | proxied avatar bytes |
## Env
See `src/config.py`.
View File
+5
View File
@@ -0,0 +1,5 @@
[pytest]
testpaths = tests
python_files = test_*.py
pythonpath = .
addopts = -ra --strict-markers
+5
View File
@@ -0,0 +1,5 @@
flask==3.0.3
requests==2.32.3
pytest==8.3.3
responses==0.25.3
gunicorn==23.0.0
View File
+91
View File
@@ -0,0 +1,91 @@
"""Fetcher analytics — record fetch latency + push batches to the generator.
The hot path enqueues; a daemon thread flushes batches over the internal
Docker network. On push failure we drop the batch and keep going.
"""
import logging
import threading
import time
from collections import deque
import requests
from . import config
log = logging.getLogger("fetcher.analytics")
_QUEUE: deque = deque(maxlen=config.ANALYTICS_QUEUE_MAX)
_QUEUE_LOCK = threading.Lock()
_THREAD_LOCK = threading.Lock()
_FLUSH_THREAD: threading.Thread | None = None
_events_dropped: int = 0
_drop_lock = threading.Lock()
def _reset_for_tests() -> None:
global _events_dropped, _FLUSH_THREAD, _QUEUE
with _QUEUE_LOCK:
_QUEUE = deque(maxlen=config.ANALYTICS_QUEUE_MAX)
with _drop_lock:
_events_dropped = 0
_FLUSH_THREAD = None
def record_fetch(username: str, status: int, latency_ms: int) -> None:
ev = {
"ts": int(time.time()),
"service": "fetcher",
"kind": "fetch",
"username": username,
"endpoint": "github/users/<u>",
"widget": None,
"status": int(status),
"latency_ms": int(latency_ms),
"cache_hit": None,
}
global _events_dropped
with _QUEUE_LOCK:
if len(_QUEUE) >= _QUEUE.maxlen:
with _drop_lock:
_events_dropped += 1
return
_QUEUE.append(ev)
def flush_now() -> int:
with _QUEUE_LOCK:
batch = list(_QUEUE)
_QUEUE.clear()
if not batch:
return 0
if not config.GENERATOR_URL or not config.INTERNAL_TOKEN:
return 0
try:
requests.post(
f"{config.GENERATOR_URL}/internal/analytics/events",
headers={"X-Internal-Token": config.INTERNAL_TOKEN},
json={"events": batch},
timeout=2,
)
except Exception:
log.warning("analytics flush failed (events lost)", exc_info=True)
return 0
return len(batch)
def _flush_loop():
while True:
time.sleep(config.ANALYTICS_FLUSH_SECONDS)
try:
flush_now()
except Exception:
log.exception("flush loop error")
def start_flush_thread():
global _FLUSH_THREAD
with _THREAD_LOCK:
if _FLUSH_THREAD is not None and _FLUSH_THREAD.is_alive():
return
t = threading.Thread(target=_flush_loop, name="fetcher-analytics-flush", daemon=True)
t.start()
_FLUSH_THREAD = t
+272
View File
@@ -0,0 +1,272 @@
"""Flask app for the fetcher service. All endpoints require X-Internal-Token."""
import hmac
import logging
import re
import threading
import time
import requests
from concurrent.futures import ThreadPoolExecutor
from flask import Flask, jsonify, request, Response
from functools import wraps
from . import analytics, config, db, github
app = Flask(__name__)
log = logging.getLogger("fetcher.api")
analytics.start_flush_thread()
# Background pool for /fetch-async. The fetch routinely takes 10-20s of
# wall clock even after parallelization, which is too long to hold an HTTP
# request open from the generator (it would block the worker on its hot
# path). Submitting to this pool lets us return 202 immediately and call
# the generator back when the fetch finishes.
_BG_POOL = ThreadPoolExecutor(
max_workers=max(1, config.ASYNC_FETCH_WORKERS),
thread_name_prefix="fetch-bg",
)
# Per-process in-flight set. If two callers ask us to fetch the same user
# while the first fetch is still running, we ack the second one without
# starting a duplicate GitHub call. Per-process only — fine for v1's single
# fetcher container; a multi-replica deploy would need a distributed lock.
_INFLIGHT: set[str] = set()
_INFLIGHT_LOCK = threading.Lock()
# Must stay in sync with github.py's _USERNAME_RE. Trust boundary: the
# fetcher is called only by the generator over the internal network, but
# a compromised/bugged generator must not be able to turn us into an
# arbitrary GitHub URL fetcher.
_USERNAME_RE = re.compile(r"^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$")
def _valid_username(u) -> bool:
return isinstance(u, str) and bool(_USERNAME_RE.match(u))
def require_internal_token(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
token = request.headers.get("X-Internal-Token", "")
if not config.INTERNAL_TOKEN or not hmac.compare_digest(token, config.INTERNAL_TOKEN):
return jsonify({"error": "unauthorized"}), 401
return fn(*args, **kwargs)
return wrapper
@app.route("/health", methods=["GET"])
def health():
return jsonify({"status": "ok", "service": "fetcher", "users": len(db.list_usernames())})
@app.route("/metrics", methods=["GET"])
def metrics():
"""Prometheus-format fetch-outcome counters for the monitoring stack.
Deliberately unauthenticated (the rest of the API requires the internal
token): it exposes only aggregate counts — no usernames, no payloads — and
the scraper (vmagent) can't send our internal header. The counts are read
from fetcher.db, so they include the cron container's fetches too."""
counts = db.read_fetch_metrics()
lines = [
"# HELP ghstats_fetch_total GitHub fetch outcomes by result.",
"# TYPE ghstats_fetch_total counter",
]
for outcome, n in counts.items():
lines.append(f'ghstats_fetch_total{{outcome="{outcome}"}} {n}')
return Response("\n".join(lines) + "\n", mimetype="text/plain; version=0.0.4")
@app.route("/data/<username>", methods=["GET"])
@require_internal_token
def get_data(username: str):
if not _valid_username(username):
return jsonify({"error": "invalid_username"}), 400
row = db.get_user(username)
if row is None:
# Auto-fetch path
t0 = time.monotonic()
try:
data = github.fetch_github_data(username, token=config.GITHUB_PAT)
except Exception:
analytics.record_fetch(username, 502, int((time.monotonic() - t0) * 1000))
log.exception("github fetch failed for %s", username)
return jsonify({"error": "fetch_failed"}), 502
if _is_github_not_found(data):
data = {"error": "not_found"}
analytics.record_fetch(username, 404, int((time.monotonic() - t0) * 1000))
else:
analytics.record_fetch(username, 200, int((time.monotonic() - t0) * 1000))
h = db.upsert_user(username, data)
return jsonify({"data": data, "payload_hash": h, "fetched": True})
return jsonify({
"data": row["data"],
"payload_hash": row["payload_hash"],
"fetched_at": row["fetched_at"],
"fetched": False,
})
@app.route("/fetch", methods=["POST"])
@require_internal_token
def force_fetch():
body = request.get_json(silent=True) or {}
username = body.get("username")
if not _valid_username(username):
return jsonify({"error": "invalid_username"}), 400
t0 = time.monotonic()
try:
data = github.fetch_github_data(username, token=config.GITHUB_PAT)
except Exception as e:
# Previously returned f"fetch failed: {e}" which leaks internal
# exception text (URLs, stack fragments) across the trust boundary.
analytics.record_fetch(username, 502, int((time.monotonic() - t0) * 1000))
_record_fetch_failure(username, e)
return jsonify({"error": "fetch_failed"}), 502
if _is_github_not_found(data):
data = {"error": "not_found"}
analytics.record_fetch(username, 404, int((time.monotonic() - t0) * 1000))
db.bump_fetch_metric("not_found")
else:
analytics.record_fetch(username, 200, int((time.monotonic() - t0) * 1000))
db.bump_fetch_metric("ok")
old = db.get_user(username)
old_hash = old["payload_hash"] if old else None
new_hash = db.upsert_user(username, data)
return jsonify({"stored": True, "payload_hash": new_hash, "changed": old_hash != new_hash})
def _bg_fetch(username: str) -> None:
"""Background fetch + generator callback. Runs on _BG_POOL.
Always notifies the generator on completion (including not_found and
failure cases) so the generator can decide whether to enqueue a build,
persist a not_found marker, or do nothing. Without the callback the
generator would have to poll, which is exactly the design we're
removing — the worker used to block on the synchronous /data call and
time out on long fetches.
"""
try:
t0 = time.monotonic()
try:
data = github.fetch_github_data(username, token=config.GITHUB_PAT)
if _is_github_not_found(data):
data = {"error": "not_found"}
analytics.record_fetch(username, 404, int((time.monotonic() - t0) * 1000))
db.bump_fetch_metric("not_found")
else:
analytics.record_fetch(username, 200, int((time.monotonic() - t0) * 1000))
db.bump_fetch_metric("ok")
payload_hash = db.upsert_user(username, data)
ok = True
except Exception as e:
analytics.record_fetch(username, 502, int((time.monotonic() - t0) * 1000))
_record_fetch_failure(username, e)
payload_hash = ""
ok = False
_notify_generator_data_ready(username, payload_hash, ok)
finally:
with _INFLIGHT_LOCK:
_INFLIGHT.discard(username)
def _notify_generator_data_ready(username: str, payload_hash: str, ok: bool) -> None:
if not config.GENERATOR_URL or not config.INTERNAL_TOKEN:
return
try:
requests.post(
f"{config.GENERATOR_URL}/internal/data-ready",
headers={"X-Internal-Token": config.INTERNAL_TOKEN},
json={"username": username, "payload_hash": payload_hash, "ok": ok},
timeout=5,
)
except Exception:
log.warning("data-ready callback to generator failed for %s", username, exc_info=True)
@app.route("/fetch-async", methods=["POST"])
@require_internal_token
def fetch_async():
"""Kick off a background GitHub fetch and return immediately.
The generator calls this on enrollment so the user-perceived latency
isn't bounded by GitHub's response time + the generator's HTTP
timeout. When the fetch completes the fetcher posts back to
/internal/data-ready on the generator, which is what enqueues the
build job.
"""
body = request.get_json(silent=True) or {}
username = body.get("username")
if not _valid_username(username):
return jsonify({"error": "invalid_username"}), 400
with _INFLIGHT_LOCK:
if username in _INFLIGHT:
return jsonify({"queued": True, "already_inflight": True}), 202
_INFLIGHT.add(username)
try:
_BG_POOL.submit(_bg_fetch, username)
except RuntimeError:
# Pool was shut down (process exiting). Drop the in-flight marker
# so a retry after restart isn't blocked by a stale entry.
with _INFLIGHT_LOCK:
_INFLIGHT.discard(username)
return jsonify({"error": "shutting_down"}), 503
return jsonify({"queued": True}), 202
@app.route("/avatar/<username>", methods=["GET"])
@require_internal_token
def avatar(username: str):
# SSRF surface: we build https://github.com/<u>.png from path input. The
# <username> Flask converter already refuses slashes, but allowlist the
# shape anyway so any future change to the proxy path can't turn into a
# URL-smuggling primitive.
if not _valid_username(username):
return jsonify({"error": "invalid_username"}), 400
try:
r = requests.get(
f"https://github.com/{username}.png",
timeout=config.API_TIMEOUT,
allow_redirects=True,
)
except Exception:
log.exception("avatar fetch failed for %s", username)
return jsonify({"error": "avatar_unavailable"}), 502
if r.status_code != 200:
return jsonify({"error": "avatar unavailable"}), 404
return Response(r.content, mimetype=r.headers.get("Content-Type", "image/png"))
def _is_github_not_found(data: dict) -> bool:
user = data.get("user")
if user is None:
return True
if isinstance(user, dict) and user.get("message") == "Not Found":
return True
# An error body (rate limit, abuse detection, anything else GitHub answers
# with a bare {"message": ...}) carries no login. It is not user data and
# must never be recorded as a successful fetch. github.py raises
# GitHubTransientError before we get here in practice; this is the backstop.
if isinstance(user, dict) and "login" not in user:
return True
return False
def _record_fetch_failure(username: str, exc: Exception) -> None:
"""Classify a failed fetch for metrics + logs. A transient failure (rate
limit / 5xx / network) is the signal worth surfacing: it means we aborted
and kept the last-good record instead of persisting zeros."""
if isinstance(exc, github.GitHubTransientError):
db.bump_fetch_metric("rate_limited")
log.warning("github fetch transient failure for %s (kept last-good): %s", username, exc)
else:
db.bump_fetch_metric("error")
log.exception("github fetch failed for %s", username)
def main():
db.init_db()
app.run(host="0.0.0.0", port=config.PORT)
if __name__ == "__main__":
main()
+35
View File
@@ -0,0 +1,35 @@
"""Fetcher service configuration, overridable via env vars."""
import os
PORT = int(os.getenv("FETCHER_PORT", "5001"))
DB_PATH = os.getenv("FETCHER_DB_PATH", "./data/fetcher.db")
GITHUB_PAT = os.getenv("GITHUB_PAT", "")
INTERNAL_TOKEN = os.getenv("FETCHER_INTERNAL_TOKEN", "")
REFRESH_INTERVAL_HOURS = int(os.getenv("FETCHER_REFRESH_INTERVAL_HOURS", "24"))
TRIAL_GC_DAYS = int(os.getenv("FETCHER_TRIAL_GC_DAYS", "7"))
API_TIMEOUT = int(os.getenv("API_TIMEOUT", "15"))
# Generator URL is used as a callback target when a /fetch-async background
# task completes. Token-protected via the same FETCHER_INTERNAL_TOKEN that
# secures generator -> fetcher calls. Empty string disables the callback,
# which is fine for tests and one-shot scripts.
GENERATOR_URL = os.getenv("GENERATOR_URL", "http://localhost:5002")
ASYNC_FETCH_WORKERS = int(os.getenv("FETCHER_ASYNC_WORKERS", "2"))
# Collaborator-detection tuning
COLLABORATOR_MAX_REPO_SIZE = int(os.getenv("COLLABORATOR_MAX_REPO_SIZE", "150"))
COLLABORATOR_TOP_REPOS = int(os.getenv("COLLABORATOR_TOP_REPOS", "30"))
SMALL_OWNED_REPO_SIZE = int(os.getenv("SMALL_OWNED_REPO_SIZE", "10"))
COLLABORATOR_LOOKBACK_DAYS = int(os.getenv("COLLABORATOR_LOOKBACK_DAYS", "365"))
MEANINGFUL_MIN_COMMITS = int(os.getenv("MEANINGFUL_MIN_COMMITS", "3"))
FORK_MIN_COMMITS = int(os.getenv("FORK_MIN_COMMITS", "10"))
OWNER_BOOST = float(os.getenv("OWNER_BOOST", "1.5"))
MIN_SHARED_REPOS = int(os.getenv("MIN_SHARED_REPOS", "2"))
DEEP_COLLAB_THRESHOLD = int(os.getenv("DEEP_COLLAB_THRESHOLD", "25"))
# Commit-fetching caps
COMMIT_MAX_REPOS = int(os.getenv("COMMIT_MAX_REPOS", "10"))
COMMIT_PER_REPO = int(os.getenv("COMMIT_PER_REPO", "30"))
ANALYTICS_FLUSH_SECONDS = int(os.getenv("ANALYTICS_FLUSH_SECONDS", "5"))
ANALYTICS_QUEUE_MAX = int(os.getenv("ANALYTICS_QUEUE_MAX", "2000"))
+56
View File
@@ -0,0 +1,56 @@
"""Scheduled refresh + GC loop. Run as its own container (CMD override)."""
import logging
import time
from . import config, db, github
log = logging.getLogger("fetcher.cron")
def tick(hours: int, active_within_days: int, gc_days: int) -> dict:
"""Refresh due users, then GC abandoned ones. Returns counts."""
refreshed = 0
failed = 0
due = db.users_due_for_refresh(hours=hours, active_within_days=active_within_days)
for username in due:
try:
data = github.fetch_github_data(username, token=config.GITHUB_PAT)
user = data.get("user")
if user is None or (isinstance(user, dict) and user.get("message") == "Not Found"):
data = {"error": "not_found"}
db.bump_fetch_metric("not_found")
else:
db.bump_fetch_metric("ok")
db.upsert_user(username, data)
refreshed += 1
except github.GitHubTransientError as e:
db.bump_fetch_metric("rate_limited")
log.warning("refresh rate-limited for %s (kept last-good): %s", username, e)
failed += 1
except Exception as e:
db.bump_fetch_metric("error")
log.warning("refresh failed for %s: %s", username, e)
failed += 1
gc_removed = db.delete_stale(days=gc_days)
return {"refreshed": refreshed, "failed": failed, "gc_removed": gc_removed}
def main():
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s %(message)s")
db.init_db()
interval = 3600 # 1h between ticks
while True:
try:
stats = tick(
hours=config.REFRESH_INTERVAL_HOURS,
active_within_days=config.TRIAL_GC_DAYS,
gc_days=config.TRIAL_GC_DAYS,
)
log.info("tick complete: %s", stats)
except Exception:
log.exception("tick failed")
time.sleep(interval)
if __name__ == "__main__":
main()
+165
View File
@@ -0,0 +1,165 @@
"""SQLite repository for the fetcher service.
Single table: users (raw GitHub payloads keyed by username).
Uses WAL mode so concurrent readers don't block the writer.
"""
import hashlib
import json
import os
import sqlite3
from contextlib import contextmanager
from datetime import datetime, timedelta
from typing import Optional
from . import config
DB_PATH = config.DB_PATH
SCHEMA_SQL = """
CREATE TABLE IF NOT EXISTS users (
username TEXT PRIMARY KEY,
data_json TEXT NOT NULL,
payload_hash TEXT NOT NULL,
fetched_at TEXT NOT NULL,
last_requested_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_users_fetched_at ON users(fetched_at);
CREATE INDEX IF NOT EXISTS idx_users_last_requested_at ON users(last_requested_at);
-- Monotonic fetch-outcome counters, shared across the web workers and the
-- cron container (both mount the same fetcher.db). Scraped via /metrics so
-- rate limits surface in the monitoring stack instead of dying silently.
CREATE TABLE IF NOT EXISTS fetch_metrics (
outcome TEXT PRIMARY KEY,
count INTEGER NOT NULL DEFAULT 0
);
"""
# The full label set is emitted even at zero so the counter exists in the
# scrape target from the first request (rate() needs a prior sample to work).
FETCH_OUTCOMES = ("ok", "not_found", "rate_limited", "error")
def _now() -> str:
return datetime.utcnow().isoformat(timespec="seconds") + "Z"
@contextmanager
def _connect():
os.makedirs(os.path.dirname(DB_PATH) or ".", exist_ok=True)
conn = sqlite3.connect(DB_PATH, timeout=10)
conn.row_factory = sqlite3.Row
conn.execute("PRAGMA journal_mode=WAL")
conn.execute("PRAGMA synchronous=NORMAL")
conn.execute("PRAGMA foreign_keys=ON")
conn.execute("PRAGMA busy_timeout=5000")
try:
yield conn
conn.commit()
finally:
conn.close()
def init_db() -> None:
with _connect() as c:
c.executescript(SCHEMA_SQL)
c.commit()
def payload_hash(data: dict) -> str:
canonical = json.dumps(data, sort_keys=True, separators=(",", ":"))
return hashlib.sha256(canonical.encode("utf-8")).hexdigest()
def upsert_user(username: str, data: dict) -> str:
h = payload_hash(data)
now = _now()
with _connect() as c:
c.execute(
"""INSERT INTO users(username, data_json, payload_hash, fetched_at, last_requested_at)
VALUES (?, ?, ?, ?, ?)
ON CONFLICT(username) DO UPDATE SET
data_json = excluded.data_json,
payload_hash = excluded.payload_hash,
fetched_at = excluded.fetched_at""",
(username, json.dumps(data), h, now, now),
)
c.commit()
return h
def get_user(username: str) -> Optional[dict]:
"""Returns {data, payload_hash, fetched_at, last_requested_at} or None. Updates last_requested_at."""
now = _now()
with _connect() as c:
row = c.execute(
"SELECT data_json, payload_hash, fetched_at, last_requested_at FROM users WHERE username=?",
(username,),
).fetchone()
if row is None:
return None
c.execute("UPDATE users SET last_requested_at=? WHERE username=?", (now, username))
c.commit()
return {
"data": json.loads(row["data_json"]),
"payload_hash": row["payload_hash"],
"fetched_at": row["fetched_at"],
"last_requested_at": now,
}
def delete_stale(days: int) -> int:
cutoff = (datetime.utcnow() - timedelta(days=days)).isoformat(timespec="seconds") + "Z"
with _connect() as c:
cur = c.execute("DELETE FROM users WHERE last_requested_at < ?", (cutoff,))
c.commit()
return cur.rowcount
def users_due_for_refresh(hours: int, active_within_days: int) -> list[str]:
"""Return usernames with fetched_at older than `hours` and last_requested_at within `active_within_days`."""
stale_before = (datetime.utcnow() - timedelta(hours=hours)).isoformat(timespec="seconds") + "Z"
active_after = (datetime.utcnow() - timedelta(days=active_within_days)).isoformat(timespec="seconds") + "Z"
with _connect() as c:
rows = c.execute(
"SELECT username FROM users WHERE fetched_at < ? AND last_requested_at > ?",
(stale_before, active_after),
).fetchall()
return [r["username"] for r in rows]
def list_usernames() -> list[str]:
with _connect() as c:
return [r["username"] for r in c.execute("SELECT username FROM users ORDER BY username").fetchall()]
def bump_fetch_metric(outcome: str, n: int = 1) -> None:
"""Increment the counter for a fetch outcome (one of FETCH_OUTCOMES).
Best-effort telemetry: a metrics write must never break a fetch, so
failures are swallowed."""
if outcome not in FETCH_OUTCOMES:
outcome = "error"
try:
with _connect() as c:
c.execute(
"""INSERT INTO fetch_metrics(outcome, count) VALUES (?, ?)
ON CONFLICT(outcome) DO UPDATE SET count = count + excluded.count""",
(outcome, n),
)
c.commit()
except sqlite3.Error:
pass
def read_fetch_metrics() -> dict:
"""Return {outcome: count} for every outcome in FETCH_OUTCOMES (zero-filled)."""
counts = {o: 0 for o in FETCH_OUTCOMES}
try:
with _connect() as c:
for row in c.execute("SELECT outcome, count FROM fetch_metrics"):
if row["outcome"] in counts:
counts[row["outcome"]] = row["count"]
except sqlite3.Error:
pass
return counts
+307 -124
View File
@@ -1,25 +1,80 @@
"""GitHub data fetching functions.""" """GitHub data fetching functions."""
import re
import requests import requests
import base64 import base64
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Optional, Protocol from typing import Optional, Protocol
from ..config import ( from . import config
COLLABORATOR_MAX_REPO_SIZE,
COLLABORATOR_TOP_REPOS,
COLLABORATOR_LOOKBACK_DAYS, # GitHub's own username rules: alphanumerics and hyphens, 1–39 chars, no
MEANINGFUL_MIN_COMMITS, # leading/trailing hyphen, no double-hyphens. The fetcher hard-refuses
FORK_MIN_COMMITS, # anything else before it reaches URL construction or GraphQL interpolation —
OWNER_BOOST, # the generator validates too, but this is the last line of defense before
MIN_SHARED_REPOS, # we talk to GitHub on a caller's behalf.
DEEP_COLLAB_THRESHOLD, _USERNAME_RE = re.compile(r"^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}$")
SMALL_OWNED_REPO_SIZE,
COMMIT_MAX_REPOS, # Repo full names: owner/repo. Owner matches the username rule; repo allows the
COMMIT_PER_REPO, # same chars plus dot and underscore (matches GitHub's repo-name regex).
API_TIMEOUT, _REPO_FULL_NAME_RE = re.compile(
r"^[A-Za-z0-9](?:[A-Za-z0-9]|-(?=[A-Za-z0-9])){0,38}"
r"/[A-Za-z0-9_.-]{1,100}$"
) )
def _assert_username(name: str) -> str:
if not isinstance(name, str) or not _USERNAME_RE.match(name):
raise ValueError(f"invalid github username: {name!r}")
return name
def _assert_repo_full_name(name: str) -> str:
if not isinstance(name, str) or not _REPO_FULL_NAME_RE.match(name):
raise ValueError(f"invalid github repo name: {name!r}")
return name
class GitHubTransientError(Exception):
"""A GitHub call failed transiently (rate limit, 5xx, or a network error)
rather than returning real data.
This MUST NOT be swallowed into a zero/empty count. A contribution count
computed from a rate-limited response is 0, and persisting that 0 silently
overwrites the last good value in fetcher.db — which is exactly how a
traffic spike turns into permanently-wrong "0 commits" cards until the
next successful fetch. Propagate it instead so the caller aborts the fetch
and keeps the previously-cached record."""
def _raise_if_transient(resp) -> None:
"""Raise GitHubTransientError if `resp` looks like a rate limit or server
error. A genuine NOT_FOUND (unknown user) is left alone — that is a real,
persistable "this user has no data" answer, not a transient failure."""
if resp.status_code in (429, 500, 502, 503, 504):
raise GitHubTransientError(f"HTTP {resp.status_code}")
# Primary/secondary REST rate limits come back as 403 with the remaining
# budget at 0 (or a "secondary rate limit" message).
if resp.status_code == 403 and resp.headers.get("X-RateLimit-Remaining") == "0":
raise GitHubTransientError("REST rate limit exhausted")
if resp.status_code == 403 and "rate limit" in (resp.text or "").lower():
raise GitHubTransientError("REST rate limit exhausted")
# GraphQL reports rate limits as HTTP 200 with an `errors` array — the same
# 200 that a valid response uses — so the body has to be inspected.
try:
body = resp.json()
except ValueError:
return
# REST list endpoints (events, repos, contributors) answer with a JSON
# array — only a GraphQL-shaped object can carry an `errors` block.
if not isinstance(body, dict):
return
for err in (body.get("errors") or []):
if err.get("type") in ("RATE_LIMITED", "SERVICE_UNAVAILABLE"):
raise GitHubTransientError(err.get("message") or err.get("type"))
class GitHubDataSource(Protocol): class GitHubDataSource(Protocol):
"""Protocol for GitHub data sources - allows swapping implementations.""" """Protocol for GitHub data sources - allows swapping implementations."""
@@ -59,6 +114,10 @@ class GitHubDataSource(Protocol):
"""Fetch and encode avatar as base64.""" """Fetch and encode avatar as base64."""
... ...
def fetch_repo_languages(self, full_name: str) -> dict:
"""Return {language: bytes} for a single repo, or {} on failure."""
...
class DirectAPISource: class DirectAPISource:
"""Direct GitHub API implementation - for immediate requests.""" """Direct GitHub API implementation - for immediate requests."""
@@ -91,7 +150,7 @@ class DirectAPISource:
"https://api.github.com/graphql", "https://api.github.com/graphql",
json=payload, json=payload,
headers=headers, headers=headers,
timeout=API_TIMEOUT, timeout=config.API_TIMEOUT,
) )
except Exception as e: except Exception as e:
print(f" GraphQL request failed: {e}") print(f" GraphQL request failed: {e}")
@@ -109,26 +168,36 @@ class DirectAPISource:
def fetch_user_data(self, username: str) -> dict: def fetch_user_data(self, username: str) -> dict:
"""Fetch user profile data.""" """Fetch user profile data."""
return requests.get( _assert_username(username)
resp = requests.get(
f"{self.base}/users/{username}", f"{self.base}/users/{username}",
headers=self.headers headers=self.headers,
).json() timeout=config.API_TIMEOUT,
)
_raise_if_transient(resp)
return resp.json()
def fetch_repos(self, username: str) -> list: def fetch_repos(self, username: str) -> list:
"""Fetch user repositories (owned + contributed to).""" """Fetch user repositories (owned + contributed to)."""
# Fetch owned repos _assert_username(username)
owned = requests.get(
f"{self.base}/users/{username}/repos",
headers=self.headers,
params={"per_page": 100, "sort": "pushed", "type": "owner"},
).json()
# Fetch all repos (includes collabs, orgs) def _get(repo_type: str):
all_repos = requests.get( resp = requests.get(
f"{self.base}/users/{username}/repos", f"{self.base}/users/{username}/repos",
headers=self.headers, headers=self.headers,
params={"per_page": 100, "sort": "pushed", "type": "all"}, params={"per_page": 100, "sort": "pushed", "type": repo_type},
).json() timeout=config.API_TIMEOUT,
)
_raise_if_transient(resp)
return resp.json()
# The two REST calls are independent — fire them in parallel so the
# second isn't waiting on the first to come back.
with ThreadPoolExecutor(max_workers=2, thread_name_prefix="fetch-repos") as pool:
fut_owned = pool.submit(_get, "owner")
fut_all = pool.submit(_get, "all")
owned = fut_owned.result()
all_repos = fut_all.result()
# Combine and deduplicate # Combine and deduplicate
repos = owned if isinstance(owned, list) else [] repos = owned if isinstance(owned, list) else []
@@ -144,12 +213,16 @@ class DirectAPISource:
def fetch_events(self, username: str) -> list: def fetch_events(self, username: str) -> list:
"""Fetch user events.""" """Fetch user events."""
_assert_username(username)
resp = requests.get( resp = requests.get(
f"{self.base}/users/{username}/events", f"{self.base}/users/{username}/events",
headers=self.headers, headers=self.headers,
params={"per_page": 100}, params={"per_page": 100},
).json() timeout=config.API_TIMEOUT,
return resp if isinstance(resp, list) else [] )
_raise_if_transient(resp)
events = resp.json()
return events if isinstance(events, list) else []
def fetch_commits(self, username: str, repos: list = None) -> list: def fetch_commits(self, username: str, repos: list = None) -> list:
""" """
@@ -168,28 +241,33 @@ class DirectAPISource:
from datetime import datetime from datetime import datetime
try: try:
_assert_username(username)
# Get the last year of contribution data # Get the last year of contribution data
now = datetime.now() now = datetime.now()
one_year_ago = now.replace(year=now.year - 1) one_year_ago = now.replace(year=now.year - 1)
from_date = one_year_ago.strftime("%Y-%m-%dT%H:%M:%SZ") from_date = one_year_ago.strftime("%Y-%m-%dT%H:%M:%SZ")
to_date = now.strftime("%Y-%m-%dT%H:%M:%SZ") to_date = now.strftime("%Y-%m-%dT%H:%M:%SZ")
query = f''' # Parameterize username + date range — interpolating username into
query {{ # the query lets a malicious name break out of the string literal
user(login: "{username}") {{ # and smuggle additional GraphQL fields. GitHub's PAT scopes bound
contributionsCollection(from: "{from_date}", to: "{to_date}") {{ # the damage, but the injection is still worth shutting down.
contributionCalendar {{ query = """
weeks {{ query($login: String!, $from: DateTime!, $to: DateTime!) {
contributionDays {{ user(login: $login) {
contributionsCollection(from: $from, to: $to) {
contributionCalendar {
weeks {
contributionDays {
date date
contributionCount contributionCount
}} }
}} }
}} }
}} }
}} }
}} }
''' """
headers = { headers = {
**self.headers, **self.headers,
@@ -201,9 +279,12 @@ class DirectAPISource:
resp = requests.post( resp = requests.post(
'https://api.github.com/graphql', 'https://api.github.com/graphql',
json={'query': query}, json={
'query': query,
'variables': {'login': username, 'from': from_date, 'to': to_date},
},
headers=headers, headers=headers,
timeout=API_TIMEOUT timeout=config.API_TIMEOUT
) )
if not resp.ok: if not resp.ok:
@@ -258,6 +339,13 @@ class DirectAPISource:
return self._fetch_commit_count_graphql_range(username, since_date) return self._fetch_commit_count_graphql_range(username, since_date)
else: else:
return self._fetch_commit_count_graphql_alltime(username) return self._fetch_commit_count_graphql_alltime(username)
except GitHubTransientError:
# Rate limit / 5xx: abort the fetch so the caller keeps the last
# good count instead of persisting a spurious 0.
raise
except requests.RequestException as e:
# A network-level failure is transient too.
raise GitHubTransientError(str(e))
except Exception as e: except Exception as e:
print(f" Error fetching contribution count: {e}") print(f" Error fetching contribution count: {e}")
return 0 return 0
@@ -266,6 +354,7 @@ class DirectAPISource:
"""Fetch all-time contribution count using GraphQL.""" """Fetch all-time contribution count using GraphQL."""
from datetime import datetime from datetime import datetime
_assert_username(username)
# First, get account creation date # First, get account creation date
query = ''' query = '''
query($username: String!) { query($username: String!) {
@@ -287,9 +376,10 @@ class DirectAPISource:
'https://api.github.com/graphql', 'https://api.github.com/graphql',
json={'query': query, 'variables': {'username': username}}, json={'query': query, 'variables': {'username': username}},
headers=headers, headers=headers,
timeout=API_TIMEOUT timeout=config.API_TIMEOUT
) )
_raise_if_transient(resp)
if not resp.ok or 'data' not in resp.json(): if not resp.ok or 'data' not in resp.json():
print(f" GraphQL error: {resp.status_code}") print(f" GraphQL error: {resp.status_code}")
return 0 return 0
@@ -302,39 +392,51 @@ class DirectAPISource:
created_year = int(created_at[:4]) created_year = int(created_at[:4])
current_year = datetime.now().year current_year = datetime.now().year
# Fetch year by year # Fetch year by year, in parallel. Sequentially this was 1 request
total_contributions = 0 # per year of account age (~7-10 calls for typical accounts), each
# ~1s — easily a 10s wall-clock contributor on its own.
print(f" Fetching contributions from {created_year} to {current_year}...") print(f" Fetching contributions from {created_year} to {current_year}...")
for year in range(created_year, current_year + 1): year_query = """
year_query = f''' query($login: String!, $from: DateTime!, $to: DateTime!) {
query {{ user(login: $login) {
user(login: "{username}") {{ contributionsCollection(from: $from, to: $to) {
contributionsCollection(from: "{year}-01-01T00:00:00Z", to: "{year}-12-31T23:59:59Z") {{ contributionCalendar { totalContributions }
contributionCalendar {{ }
totalContributions }
}} }
}} """
}}
}}
'''
def _fetch_year(year: int) -> tuple[int, int]:
year_resp = requests.post( year_resp = requests.post(
'https://api.github.com/graphql', 'https://api.github.com/graphql',
json={'query': year_query}, json={
'query': year_query,
'variables': {
'login': username,
'from': f"{year}-01-01T00:00:00Z",
'to': f"{year}-12-31T23:59:59Z",
},
},
headers=headers, headers=headers,
timeout=API_TIMEOUT timeout=config.API_TIMEOUT,
) )
_raise_if_transient(year_resp)
if year_resp.ok: if not year_resp.ok:
year_data = year_resp.json()
if 'data' in year_data and year_data['data'].get('user'):
year_contributions = year_data['data']['user']['contributionsCollection']['contributionCalendar']['totalContributions']
total_contributions += year_contributions
print(f" {year}: {year_contributions:,} contributions")
else:
print(f" {year}: Error - {year_data}")
else:
print(f" {year}: HTTP {year_resp.status_code}") print(f" {year}: HTTP {year_resp.status_code}")
return year, 0
year_data = year_resp.json()
if 'data' in year_data and year_data['data'].get('user'):
n = year_data['data']['user']['contributionsCollection']['contributionCalendar']['totalContributions']
return year, n
print(f" {year}: Error - {year_data}")
return year, 0
years = list(range(created_year, current_year + 1))
total_contributions = 0
with ThreadPoolExecutor(max_workers=min(10, len(years) or 1)) as pool:
for year, n in sorted(pool.map(_fetch_year, years)):
total_contributions += n
print(f" {year}: {n:,} contributions")
print(f" GraphQL API found {total_contributions:,} contributions (all-time)") print(f" GraphQL API found {total_contributions:,} contributions (all-time)")
return total_contributions return total_contributions
@@ -343,21 +445,20 @@ class DirectAPISource:
"""Fetch contribution count for a specific date range using GraphQL.""" """Fetch contribution count for a specific date range using GraphQL."""
from datetime import datetime from datetime import datetime
_assert_username(username)
# Convert since_date to proper format # Convert since_date to proper format
from_date = f"{since_date}T00:00:00Z" from_date = f"{since_date}T00:00:00Z"
to_date = datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ") to_date = datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ")
query = f''' query = """
query {{ query($login: String!, $from: DateTime!, $to: DateTime!) {
user(login: "{username}") {{ user(login: $login) {
contributionsCollection(from: "{from_date}", to: "{to_date}") {{ contributionsCollection(from: $from, to: $to) {
contributionCalendar {{ contributionCalendar { totalContributions }
totalContributions }
}} }
}} }
}} """
}}
'''
headers = { headers = {
**self.headers, **self.headers,
@@ -369,11 +470,15 @@ class DirectAPISource:
resp = requests.post( resp = requests.post(
'https://api.github.com/graphql', 'https://api.github.com/graphql',
json={'query': query}, json={
'query': query,
'variables': {'login': username, 'from': from_date, 'to': to_date},
},
headers=headers, headers=headers,
timeout=API_TIMEOUT timeout=config.API_TIMEOUT,
) )
_raise_if_transient(resp)
if resp.ok: if resp.ok:
data = resp.json() data = resp.json()
if 'data' in data and data['data'].get('user'): if 'data' in data and data['data'].get('user'):
@@ -401,12 +506,17 @@ class DirectAPISource:
f"{self.base}/search/issues", f"{self.base}/search/issues",
headers=self.headers, headers=self.headers,
params={"q": query, "per_page": 1}, params={"q": query, "per_page": 1},
timeout=API_TIMEOUT timeout=config.API_TIMEOUT
) )
_raise_if_transient(resp)
if resp.ok: if resp.ok:
data = resp.json() data = resp.json()
return data.get("total_count", 0) return data.get("total_count", 0)
except GitHubTransientError:
raise
except requests.RequestException as e:
raise GitHubTransientError(str(e))
except Exception as e: except Exception as e:
print(f"Warning: Failed to fetch PR count via search API: {e}") print(f"Warning: Failed to fetch PR count via search API: {e}")
@@ -428,9 +538,10 @@ class DirectAPISource:
f"{self.base}/repos/{repo_name}/contributors", f"{self.base}/repos/{repo_name}/contributors",
headers=self.headers, headers=self.headers,
params={"per_page": 100}, params={"per_page": 100},
timeout=API_TIMEOUT timeout=config.API_TIMEOUT
) )
_raise_if_transient(resp)
if resp.ok: if resp.ok:
contributors = resp.json() contributors = resp.json()
# Filter by minimum commits # Filter by minimum commits
@@ -438,6 +549,8 @@ class DirectAPISource:
c for c in contributors c for c in contributors
if c.get("contributions", 0) >= min_commits if c.get("contributions", 0) >= min_commits
] ]
except GitHubTransientError:
raise
except Exception as e: except Exception as e:
print(f"Warning: Failed to fetch contributors from {repo_name}: {e}") print(f"Warning: Failed to fetch contributors from {repo_name}: {e}")
@@ -508,13 +621,32 @@ class DirectAPISource:
def fetch_avatar(self, avatar_url: str) -> str: def fetch_avatar(self, avatar_url: str) -> str:
"""Fetch and encode avatar as base64.""" """Fetch and encode avatar as base64."""
try: try:
resp = requests.get(avatar_url + "&s=64", timeout=API_TIMEOUT) resp = requests.get(avatar_url + "&s=64", timeout=config.API_TIMEOUT)
if resp.ok: if resp.ok:
return base64.b64encode(resp.content).decode("ascii") return base64.b64encode(resp.content).decode("ascii")
except Exception: except Exception:
pass pass
return "" return ""
def fetch_repo_languages(self, full_name: str) -> dict:
"""Return {language: bytes} for a repo. REST returns exactly this
shape — total is summed client-side."""
try:
resp = requests.get(
f"{self.base}/repos/{full_name}/languages",
headers=self.headers,
timeout=config.API_TIMEOUT,
)
_raise_if_transient(resp)
if resp.ok:
data = resp.json()
return data if isinstance(data, dict) else {}
except GitHubTransientError:
raise
except Exception:
pass
return {}
# TODO: Future implementation for queue-based batching # TODO: Future implementation for queue-based batching
# class QueuedAPISource: # class QueuedAPISource:
@@ -549,34 +681,44 @@ def fetch_github_data(
# Use provided data source or default to direct API # Use provided data source or default to direct API
source = data_source or DirectAPISource(token) source = data_source or DirectAPISource(token)
# Fetch all data through the data source abstraction
user = source.fetch_user_data(username)
repos = source.fetch_repos(username)
events = source.fetch_events(username)
commits = source.fetch_commits(username)
# Fetch contribution counts (commits + PRs + issues + reviews)
print(" Fetching all-time contribution count...")
total_commits = source.fetch_commit_count(username, repos)
# Recent contributions (last 6 months)
six_months_ago = (datetime.now() - timedelta(days=180)).strftime("%Y-%m-%d") six_months_ago = (datetime.now() - timedelta(days=180)).strftime("%Y-%m-%d")
print(" Fetching recent contribution count (last 6 months)...")
recent_commits = source.fetch_commit_count(username, repos, since_date=six_months_ago)
# Fetch PR count # Stage 1: every fetch with no dependencies on another fetch's result
print(" Fetching PR count...") # runs in parallel. Previously these 8 calls ran one at a time, so the
total_prs = source.fetch_pr_count(username) # whole pipeline was wait-time × 8. Each is I/O-bound (a single HTTPS
# request to GitHub or a small GraphQL query), so threading is the
# right primitive. _fetch_collaborators_data internally calls
# fetch_user_commit_repos and ignores the `repos` arg, so it has no
# ordering dependency on fetch_repos — start them together.
with ThreadPoolExecutor(max_workers=10, thread_name_prefix="fetch-stage1") as pool:
fut_user = pool.submit(source.fetch_user_data, username)
fut_repos = pool.submit(source.fetch_repos, username)
fut_events = pool.submit(source.fetch_events, username)
fut_commits = pool.submit(source.fetch_commits, username)
fut_total = pool.submit(source.fetch_commit_count, username, [])
fut_recent = pool.submit(source.fetch_commit_count, username, [], six_months_ago)
fut_prs = pool.submit(source.fetch_pr_count, username)
fut_collab = pool.submit(_fetch_collaborators_data, username, [], source)
# Fetch collaborators from user's active repos user = fut_user.result()
collaborators_data = _fetch_collaborators_data( repos = fut_repos.result()
username, repos, source events = fut_events.result()
) commits = fut_commits.result()
total_commits = fut_total.result()
recent_commits = fut_recent.result()
total_prs = fut_prs.result()
collaborators_data = fut_collab.result()
# Fetch avatar # Stage 2: avatar needs user.avatar_url, languages need the repos list.
# Both run in parallel against each other.
avatar_b64 = "" avatar_b64 = ""
if user.get("avatar_url"): avatar_url = user.get("avatar_url") if isinstance(user, dict) else None
avatar_b64 = source.fetch_avatar(user["avatar_url"]) with ThreadPoolExecutor(max_workers=2, thread_name_prefix="fetch-stage2") as pool:
fut_lang = pool.submit(_enrich_repo_languages, repos, source)
fut_avatar = pool.submit(source.fetch_avatar, avatar_url) if avatar_url else None
fut_lang.result()
if fut_avatar is not None:
avatar_b64 = fut_avatar.result()
return { return {
"user": user, "user": user,
@@ -591,6 +733,26 @@ def fetch_github_data(
} }
def _enrich_repo_languages(repos: list, source: GitHubDataSource) -> None:
"""Mutates `repos` in-place, attaching `language_bytes: {lang: bytes}` to
each repo. Uses a small thread pool — one REST call per repo is cheap
individually, but sequentially N repos would block the fetch noticeably."""
if not repos:
return
names = [(i, r["full_name"]) for i, r in enumerate(repos) if r.get("full_name")]
print(f" Fetching language byte breakdown for {len(names)} repos...")
with ThreadPoolExecutor(max_workers=10) as pool:
futures = {pool.submit(source.fetch_repo_languages, fn): i for i, fn in names}
for fut in as_completed(futures):
i = futures[fut]
try:
repos[i]["language_bytes"] = fut.result() or {}
except GitHubTransientError:
raise
except Exception:
repos[i]["language_bytes"] = {}
def _fetch_collaborators_data( def _fetch_collaborators_data(
username: str, username: str,
repos: list, repos: list,
@@ -627,7 +789,7 @@ def _fetch_collaborators_data(
low = login.lower() low = login.lower()
return low in BOT_LOGINS or low.endswith("[bot]") or low.endswith("-bot") return low in BOT_LOGINS or low.endswith("[bot]") or low.endswith("-bot")
since = (datetime.now() - timedelta(days=COLLABORATOR_LOOKBACK_DAYS)).strftime("%Y-%m-%d") since = (datetime.now() - timedelta(days=config.COLLABORATOR_LOOKBACK_DAYS)).strftime("%Y-%m-%d")
commit_repos = source.fetch_user_commit_repos(username, since) commit_repos = source.fetch_user_commit_repos(username, since)
if not commit_repos: if not commit_repos:
return [] return []
@@ -636,33 +798,54 @@ def _fetch_collaborators_data(
qualifying = [] qualifying = []
for r in commit_repos: for r in commit_repos:
user_commits = r.get("user_commits", 0) user_commits = r.get("user_commits", 0)
if user_commits < MEANINGFUL_MIN_COMMITS: if user_commits < config.MEANINGFUL_MIN_COMMITS:
continue continue
if r.get("is_fork") and user_commits < FORK_MIN_COMMITS: if r.get("is_fork") and user_commits < config.FORK_MIN_COMMITS:
continue continue
qualifying.append(r) qualifying.append(r)
# Rank user's repos by their own commit count, scan top N # Rank user's repos by their own commit count, scan top N
qualifying.sort(key=lambda r: -r.get("user_commits", 0)) qualifying.sort(key=lambda r: -r.get("user_commits", 0))
qualifying = qualifying[:COLLABORATOR_TOP_REPOS] qualifying = qualifying[:config.COLLABORATOR_TOP_REPOS]
print(f" Scoring collaborators across {len(qualifying)} qualifying repos") print(f" Scoring collaborators across {len(qualifying)} qualifying repos")
# Step 3+4: fetch contributors and score # Step 3: fetch contributors for all qualifying repos in parallel.
# The per-repo REST call is ~300-500ms; sequentially this dominated the
# whole fetch (30 repos × ~0.5s ≈ 15s). Fan out with the same pool size
# used for languages — GitHub's secondary rate limit tolerates this fine.
contributors_by_repo: dict[str, list] = {}
with ThreadPoolExecutor(max_workers=10) as pool:
futures = {
pool.submit(source.fetch_repo_contributors, r["full_name"], 1): r["full_name"]
for r in qualifying
}
for fut in as_completed(futures):
full_name = futures[fut]
try:
contributors_by_repo[full_name] = fut.result() or []
except GitHubTransientError:
raise
except Exception as e:
print(f" failed to fetch contributors for {full_name}: {e}")
contributors_by_repo[full_name] = []
# Step 4: score sequentially (cheap, in-memory) preserving the original
# `qualifying` order so deterministic-output tests still pass.
collab_stats: dict = {} collab_stats: dict = {}
for r in qualifying: for r in qualifying:
full_name = r["full_name"] full_name = r["full_name"]
user_commits = r["user_commits"] user_commits = r["user_commits"]
boost = OWNER_BOOST if r["is_owner"] else 1.0 boost = config.OWNER_BOOST if r["is_owner"] else 1.0
contributors = source.fetch_repo_contributors(full_name, min_commits=1) contributors = contributors_by_repo.get(full_name, [])
# Drop huge OSS projects # Drop huge OSS projects
if len(contributors) >= COLLABORATOR_MAX_REPO_SIZE: if len(contributors) >= config.COLLABORATOR_MAX_REPO_SIZE:
print(f" skipping {full_name}: too many contributors ({len(contributors)})") print(f" skipping {full_name}: too many contributors ({len(contributors)})")
continue continue
# A "tight" repo: one the user owns with few contributors — hackathon # A "tight" repo: one the user owns with few contributors — hackathon
# and side-project partners qualify from a single such repo. # and side-project partners qualify from a single such repo.
is_tight_owned = r["is_owner"] and len(contributors) <= SMALL_OWNED_REPO_SIZE is_tight_owned = r["is_owner"] and len(contributors) <= config.SMALL_OWNED_REPO_SIZE
for c in contributors: for c in contributors:
login = c.get("login", "") login = c.get("login", "")
@@ -705,8 +888,8 @@ def _fetch_collaborators_data(
# or a partner in a tight user-owned project (hackathon/side-project). # or a partner in a tight user-owned project (hackathon/side-project).
filtered = [ filtered = [
s for s in scored s for s in scored
if s["shared_repos"] >= MIN_SHARED_REPOS if s["shared_repos"] >= config.MIN_SHARED_REPOS
or s["raw_score"] >= DEEP_COLLAB_THRESHOLD or s["raw_score"] >= config.DEEP_COLLAB_THRESHOLD
or s["tight_owned_partner"] or s["tight_owned_partner"]
] ]
View File
+57
View File
@@ -0,0 +1,57 @@
import os
import tempfile
import pytest
import responses
from src import analytics as a
from src import config as cfg
from src import db as dbmod
from src import api as apimod
@pytest.fixture
def client(monkeypatch):
with tempfile.TemporaryDirectory() as d:
monkeypatch.setattr(dbmod, "DB_PATH", os.path.join(d, "t.db"))
monkeypatch.setattr(apimod.config, "INTERNAL_TOKEN", "secret")
monkeypatch.setattr(apimod.config, "GITHUB_PAT", "ghp_test")
dbmod.init_db()
app = apimod.app
app.config["TESTING"] = True
with app.test_client() as c:
yield c
def test_record_fetch():
a._reset_for_tests()
a.record_fetch("alice", 200, 312)
assert len(a._QUEUE) == 1
e = a._QUEUE[0]
assert e["service"] == "fetcher"
assert e["kind"] == "fetch"
assert e["status"] == 200
assert e["latency_ms"] == 312
assert e["endpoint"] == "github/users/<u>"
@responses.activate
def test_flush_posts(monkeypatch):
monkeypatch.setattr(cfg, "GENERATOR_URL", "http://gen:5002")
monkeypatch.setattr(cfg, "INTERNAL_TOKEN", "secret")
a._reset_for_tests()
responses.add(responses.POST, "http://gen:5002/internal/analytics/events",
json={"ingested": 1}, status=200)
a.record_fetch("alice", 200, 100)
a.flush_now()
assert len(responses.calls) == 1
def test_force_fetch_records_event(monkeypatch, client):
a._reset_for_tests()
monkeypatch.setattr("src.api.github.fetch_github_data",
lambda u, token: {"user": {"login": u}})
r = client.post("/fetch",
headers={"X-Internal-Token": "secret"},
json={"username": "alice"})
assert r.status_code == 200
assert any(e["kind"] == "fetch" and e["username"] == "alice"
for e in a._QUEUE)
+205
View File
@@ -0,0 +1,205 @@
import os
import tempfile
import pytest
import responses as resp_lib
from src import db as dbmod
from src import api as apimod
@pytest.fixture
def client(monkeypatch):
with tempfile.TemporaryDirectory() as d:
monkeypatch.setattr(dbmod, "DB_PATH", os.path.join(d, "t.db"))
monkeypatch.setattr(apimod.config, "INTERNAL_TOKEN", "secret")
monkeypatch.setattr(apimod.config, "GITHUB_PAT", "ghp_test")
dbmod.init_db()
app = apimod.app
app.config["TESTING"] = True
with app.test_client() as c:
yield c
def test_health_no_auth_required(client):
r = client.get("/health")
assert r.status_code == 200
assert r.get_json()["service"] == "fetcher"
def test_endpoints_require_internal_token(client):
r = client.get("/data/alice")
assert r.status_code == 401
def test_metrics_endpoint_no_auth_and_prometheus_format(client):
from src import db as dbmod
dbmod.bump_fetch_metric("ok")
dbmod.bump_fetch_metric("rate_limited")
r = client.get("/metrics")
assert r.status_code == 200
body = r.get_data(as_text=True)
assert "# TYPE ghstats_fetch_total counter" in body
assert 'ghstats_fetch_total{outcome="ok"} 1' in body
assert 'ghstats_fetch_total{outcome="rate_limited"} 1' in body
# Every outcome is emitted even at zero so rate() has a baseline sample.
assert 'ghstats_fetch_total{outcome="not_found"} 0' in body
@resp_lib.activate
def test_data_auto_fetches_on_miss(client, monkeypatch):
# The fetcher fires the independent GitHub calls in parallel, so we
# can't rely on a fixed FIFO order of `resp_lib.add` calls. Match each
# GraphQL call by inspecting the request body and returning the right
# response for that query — this mirrors how the real GitHub API
# routes by query content rather than insertion order.
import json as _json
def _graphql_callback(request):
body = _json.loads(request.body)
q = body.get("query", "")
variables = body.get("variables", {})
if "weeks" in q:
data = {"user": {"contributionsCollection": {"contributionCalendar": {"weeks": []}}}}
elif "createdAt" in q:
data = {"user": {"createdAt": "2020-01-01T00:00:00Z"}}
elif "commitContributionsByRepository" in q:
data = {"user": {"contributionsCollection": {"commitContributionsByRepository": []}}}
elif "contributionCalendar" in q and "totalContributions" in q:
# Both alltime per-year and 6-month range queries land here. Tests
# don't care about the exact totals — just that a number comes back.
data = {"user": {"contributionsCollection": {"contributionCalendar": {"totalContributions": 10}}}}
else:
data = {"user": None}
return (200, {}, _json.dumps({"data": data}))
resp_lib.add_callback(resp_lib.POST, "https://api.github.com/graphql",
callback=_graphql_callback)
resp_lib.add(resp_lib.GET, "https://api.github.com/search/issues",
json={"total_count": 0, "items": []}, status=200)
resp_lib.add(resp_lib.GET, "https://api.github.com/users/alice",
json={"login": "alice", "public_repos": 1, "followers": 0,
"avatar_url": "https://avatars.example/a"},
status=200)
# fetch_repos fires the owner+all calls in parallel; both hit the same URL.
resp_lib.add(resp_lib.GET, "https://api.github.com/users/alice/repos", json=[], status=200)
resp_lib.add(resp_lib.GET, "https://api.github.com/users/alice/repos", json=[], status=200)
resp_lib.add(resp_lib.GET, "https://api.github.com/users/alice/events", json=[], status=200)
r = client.get("/data/alice", headers={"X-Internal-Token": "secret"})
assert r.status_code == 200
body = r.get_json()
assert body["payload_hash"]
assert body["data"]["user"]["login"] == "alice"
def test_force_fetch_requires_auth(client):
r = client.post("/fetch", json={"username": "alice"})
assert r.status_code == 401
def test_fetch_async_requires_auth(client):
r = client.post("/fetch-async", json={"username": "alice"})
assert r.status_code == 401
def test_fetch_async_rejects_invalid_username(client):
r = client.post("/fetch-async", headers={"X-Internal-Token": "secret"},
json={"username": "../etc/passwd"})
assert r.status_code == 400
def test_fetch_async_runs_in_background_and_calls_back(client, monkeypatch):
"""The async path must (a) return 202 immediately without waiting for
GitHub, and (b) POST back to the generator's /internal/data-ready when
the background fetch completes. Without (a) we'd be back to the old
synchronous-blocking design that timed out the worker; without (b)
nothing would ever enqueue the build job."""
import threading
from src import api as apimod
fetch_done = threading.Event()
callback_calls: list = []
def fake_fetch(username, token=None):
# Block briefly so the test can prove /fetch-async returned before
# this finished.
fetch_done.wait(timeout=2)
return {"user": {"login": username, "avatar_url": "x"}, "repos": []}
def fake_post(url, headers=None, json=None, timeout=None):
callback_calls.append({"url": url, "json": json, "headers": headers})
class _R: status_code = 200
return _R()
monkeypatch.setattr(apimod.github, "fetch_github_data", fake_fetch)
monkeypatch.setattr(apimod.requests, "post", fake_post)
monkeypatch.setattr(apimod.config, "GENERATOR_URL", "http://gen:5002")
r = client.post("/fetch-async", headers={"X-Internal-Token": "secret"},
json={"username": "alice"})
assert r.status_code == 202
assert r.get_json()["queued"] is True
# Let the background fetch finish; wait for the callback.
fetch_done.set()
for _ in range(50):
if callback_calls:
break
threading.Event().wait(0.05)
assert len(callback_calls) == 1
cb = callback_calls[0]
assert cb["url"] == "http://gen:5002/internal/data-ready"
assert cb["json"]["username"] == "alice"
assert cb["json"]["ok"] is True
assert cb["json"]["payload_hash"]
def test_fetch_async_dedupes_inflight(client, monkeypatch):
"""A second /fetch-async call for the same user while the first is
still in flight must not start a second GitHub fetch."""
import threading
from src import api as apimod
started = threading.Event()
release = threading.Event()
fetch_calls = {"n": 0}
def fake_fetch(username, token=None):
fetch_calls["n"] += 1
started.set()
release.wait(timeout=2)
return {"user": {"login": username, "avatar_url": "x"}, "repos": []}
monkeypatch.setattr(apimod.github, "fetch_github_data", fake_fetch)
monkeypatch.setattr(apimod.requests, "post", lambda *a, **kw: type("R", (), {"status_code": 200})())
monkeypatch.setattr(apimod.config, "GENERATOR_URL", "")
r1 = client.post("/fetch-async", headers={"X-Internal-Token": "secret"},
json={"username": "alice"})
assert r1.status_code == 202
assert started.wait(timeout=2)
r2 = client.post("/fetch-async", headers={"X-Internal-Token": "secret"},
json={"username": "alice"})
assert r2.status_code == 202
assert r2.get_json().get("already_inflight") is True
release.set()
# Drain
for _ in range(50):
if fetch_calls["n"] >= 1 and "alice" not in apimod._INFLIGHT:
break
threading.Event().wait(0.05)
assert fetch_calls["n"] == 1
def test_rate_limit_body_is_not_classified_as_valid_user_data():
# A rate-limit body reaching the classifier must never take the success
# branch — that is what overwrote a good record with a blank card.
data = {"user": {"message": "API rate limit exceeded for user ID 123.",
"documentation_url": "https://docs.github.com/"}}
assert apimod._is_github_not_found(data) is True
assert apimod._is_github_not_found({"user": {"login": "alice"}}) is False
assert apimod._is_github_not_found({"user": {"message": "Not Found"}}) is True
assert apimod._is_github_not_found({"user": None}) is True
+52
View File
@@ -0,0 +1,52 @@
import os
import tempfile
import pytest
from unittest.mock import patch
from src import db as dbmod
from src import cron as cronmod
from src import github as ghmod
@pytest.fixture
def tmp_db(monkeypatch):
with tempfile.TemporaryDirectory() as d:
monkeypatch.setattr(dbmod, "DB_PATH", os.path.join(d, "t.db"))
dbmod.init_db()
yield
def test_refresh_tick_calls_github_for_due_users(tmp_db):
dbmod.upsert_user("alice", {"user": {"login": "alice"}})
# Backdate
with dbmod._connect() as c:
c.execute("UPDATE users SET fetched_at='2020-01-01T00:00:00Z', last_requested_at=? WHERE username='alice'",
(dbmod._now(),))
with patch("src.cron.github.fetch_github_data", return_value={"user": {"login": "alice", "updated": True}}) as gh:
stats = cronmod.tick(hours=24, active_within_days=7, gc_days=7)
assert gh.called
assert stats["refreshed"] == 1
def test_refresh_rate_limit_keeps_last_good_and_counts_metric(tmp_db):
# A rate-limited refresh must NOT overwrite the cached row, and must be
# counted as rate_limited so the monitoring stack can see it.
dbmod.upsert_user("alice", {"user": {"login": "alice"}, "total_commits": 1841})
with dbmod._connect() as c:
c.execute("UPDATE users SET fetched_at='2020-01-01T00:00:00Z', last_requested_at=? WHERE username='alice'",
(dbmod._now(),))
with patch("src.cron.github.fetch_github_data",
side_effect=ghmod.GitHubTransientError("rate limited")):
stats = cronmod.tick(hours=24, active_within_days=7, gc_days=7)
assert stats["failed"] == 1 and stats["refreshed"] == 0
# Last-good data retained.
assert dbmod.get_user("alice")["data"]["total_commits"] == 1841
assert dbmod.read_fetch_metrics()["rate_limited"] == 1
def test_tick_runs_gc_for_abandoned_trial_users(tmp_db):
dbmod.upsert_user("ghost", {"user": {"login": "ghost"}})
with dbmod._connect() as c:
c.execute("UPDATE users SET last_requested_at='2020-01-01T00:00:00Z' WHERE username='ghost'")
stats = cronmod.tick(hours=24, active_within_days=7, gc_days=7)
assert stats["gc_removed"] == 1
assert dbmod.get_user("ghost") is None
+82
View File
@@ -0,0 +1,82 @@
import os
import tempfile
import pytest
from src import db as dbmod
@pytest.fixture
def tmp_db(monkeypatch):
with tempfile.TemporaryDirectory() as d:
path = os.path.join(d, "t.db")
monkeypatch.setattr(dbmod, "DB_PATH", path)
dbmod.init_db()
yield path
def test_init_creates_schema_with_wal(tmp_db):
with dbmod._connect() as c:
mode = c.execute("PRAGMA journal_mode").fetchone()[0]
assert mode.lower() == "wal"
cols = [r[1] for r in c.execute("PRAGMA table_info(users)").fetchall()]
assert set(cols) == {"username", "data_json", "payload_hash",
"fetched_at", "last_requested_at"}
def test_upsert_and_get_round_trip(tmp_db):
dbmod.upsert_user("alice", {"user": {"login": "alice"}, "repos": []})
row = dbmod.get_user("alice")
assert row["data"]["user"]["login"] == "alice"
assert row["payload_hash"]
assert row["fetched_at"]
def test_fetch_metrics_round_trip(tmp_db):
# Zero-filled for every known outcome before anything is recorded.
assert dbmod.read_fetch_metrics() == {o: 0 for o in dbmod.FETCH_OUTCOMES}
dbmod.bump_fetch_metric("ok")
dbmod.bump_fetch_metric("ok")
dbmod.bump_fetch_metric("rate_limited")
counts = dbmod.read_fetch_metrics()
assert counts["ok"] == 2
assert counts["rate_limited"] == 1
assert counts["not_found"] == 0
def test_fetch_metric_unknown_outcome_buckets_to_error(tmp_db):
dbmod.bump_fetch_metric("bogus")
assert dbmod.read_fetch_metrics()["error"] == 1
def test_payload_hash_is_deterministic_and_changes_on_diff():
h1 = dbmod.payload_hash({"a": 1, "b": 2})
h2 = dbmod.payload_hash({"b": 2, "a": 1})
h3 = dbmod.payload_hash({"a": 1, "b": 3})
assert h1 == h2
assert h1 != h3
def test_get_updates_last_requested_at(tmp_db):
dbmod.upsert_user("alice", {"user": {"login": "alice"}})
first = dbmod.get_user("alice")["last_requested_at"]
import time; time.sleep(1.1)
second = dbmod.get_user("alice")["last_requested_at"]
assert second > first
def test_delete_stale_removes_old_rows(tmp_db):
dbmod.upsert_user("ghost", {"user": {"login": "ghost"}})
# Manually backdate last_requested_at
with dbmod._connect() as c:
c.execute("UPDATE users SET last_requested_at='2020-01-01T00:00:00Z' WHERE username='ghost'")
removed = dbmod.delete_stale(days=7)
assert removed == 1
assert dbmod.get_user("ghost") is None
def test_users_due_for_refresh(tmp_db):
dbmod.upsert_user("alice", {"user": {"login": "alice"}})
# Backdate fetched_at so alice is due
with dbmod._connect() as c:
c.execute("UPDATE users SET fetched_at='2020-01-01T00:00:00Z' WHERE username='alice'")
due = dbmod.users_due_for_refresh(hours=24, active_within_days=7)
assert "alice" in due
+252
View File
@@ -0,0 +1,252 @@
import responses
import pytest
from src import github
@responses.activate
def test_fetch_user_data_returns_user_payload():
# The fetcher fires the independent GitHub calls in parallel, so the
# mock registry can't depend on FIFO ordering. Route GraphQL requests
# by query content instead.
import json as _json
def _graphql_callback(request):
q = _json.loads(request.body).get("query", "")
if "weeks" in q:
data = {"user": {"contributionsCollection": {"contributionCalendar": {"weeks": []}}}}
elif "createdAt" in q:
data = {"user": {"createdAt": "2020-01-01T00:00:00Z"}}
elif "commitContributionsByRepository" in q:
data = {"user": {"contributionsCollection": {"commitContributionsByRepository": []}}}
elif "totalContributions" in q:
data = {"user": {"contributionsCollection": {"contributionCalendar": {"totalContributions": 10}}}}
else:
data = {"user": None}
return (200, {}, _json.dumps({"data": data}))
responses.add_callback(responses.POST, "https://api.github.com/graphql",
callback=_graphql_callback)
responses.add(responses.GET, "https://api.github.com/search/issues",
json={"total_count": 0, "items": []}, status=200)
responses.add(
responses.GET, "https://api.github.com/users/alice",
json={"login": "alice", "public_repos": 3, "followers": 5,
"avatar_url": "https://avatars.example/1"},
status=200,
)
responses.add(responses.GET, "https://api.github.com/users/alice/repos", json=[], status=200)
responses.add(responses.GET, "https://api.github.com/users/alice/repos", json=[], status=200)
responses.add(responses.GET, "https://api.github.com/users/alice/events", json=[], status=200)
data = github.fetch_github_data("alice", token="t")
assert data["user"]["login"] == "alice"
assert "repos" in data
assert "events" in data
@responses.activate
def test_fetch_handles_404():
responses.add(
responses.GET, "https://api.github.com/users/nope",
json={"message": "Not Found"}, status=404,
)
responses.add(
responses.POST, "https://api.github.com/graphql",
json={"data": {"user": None}}, status=200,
)
# Both fetch_repos calls (owner + all) hit the same URL — register
# twice so the parallel firing gets a response either way round.
responses.add(
responses.GET, "https://api.github.com/users/nope/repos",
json={"message": "Not Found"}, status=404,
)
responses.add(
responses.GET, "https://api.github.com/users/nope/repos",
json={"message": "Not Found"}, status=404,
)
responses.add(
responses.GET, "https://api.github.com/users/nope/events",
json={"message": "Not Found"}, status=404,
)
responses.add(
responses.GET, "https://api.github.com/search/issues",
json={"total_count": 0, "items": []}, status=200,
)
data = github.fetch_github_data("nope", token="t")
assert data["user"].get("message") == "Not Found" or data["user"] is None
@responses.activate
def test_commit_count_raises_on_graphql_rate_limit():
# GraphQL reports a rate limit as HTTP 200 with an `errors` array — the
# exact shape a valid response uses. It must NOT be swallowed into a 0
# that would overwrite the last good count in fetcher.db.
responses.add(
responses.POST, "https://api.github.com/graphql",
json={"data": {"user": None},
"errors": [{"type": "RATE_LIMITED", "message": "API rate limit exceeded"}]},
status=200,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_commit_count("alice", [])
@responses.activate
def test_commit_count_raises_on_rest_rate_limit():
# A 403 with the remaining budget at 0 is a rate limit, not a real answer.
responses.add(
responses.POST, "https://api.github.com/graphql",
json={"message": "rate limited"}, status=403,
headers={"X-RateLimit-Remaining": "0"},
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_commit_count("alice", [])
@responses.activate
def test_commit_count_zero_on_not_found_is_not_transient():
# A genuinely unknown user (NOT_FOUND, no rate-limit error) is a real,
# persistable "no data" answer — return 0, don't raise.
responses.add(
responses.POST, "https://api.github.com/graphql",
json={"data": {"user": None}}, status=200,
)
src = github.DirectAPISource(token="t")
assert src.fetch_commit_count("ghost", []) == 0
# --- REST rate-limit guards -------------------------------------------------
# The REST calls used to hand `.json()` straight back, so a 403 rate-limit body
# ({"message": "API rate limit exceeded for user ID ..."}) was persisted as if
# it were real data, wiping the user's last-good record for up to 24h.
RATE_LIMIT_BODY = {
"message": "API rate limit exceeded for user ID 123.",
"documentation_url": "https://docs.github.com/rest/overview/rate-limits",
}
RATE_LIMIT_HEADERS = {"X-RateLimit-Remaining": "0"}
@responses.activate
def test_fetch_user_data_raises_on_rest_rate_limit():
responses.add(
responses.GET, "https://api.github.com/users/alice",
json=RATE_LIMIT_BODY, status=403, headers=RATE_LIMIT_HEADERS,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_user_data("alice")
@responses.activate
def test_fetch_user_data_raises_on_rate_limit_without_header():
# Secondary rate limits come back as 403 without the remaining-budget
# header — the message is the only signal.
responses.add(
responses.GET, "https://api.github.com/users/alice",
json={"message": "You have exceeded a secondary rate limit."}, status=403,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_user_data("alice")
@responses.activate
def test_fetch_repos_raises_on_rest_rate_limit():
responses.add(
responses.GET, "https://api.github.com/users/alice/repos",
json=RATE_LIMIT_BODY, status=403, headers=RATE_LIMIT_HEADERS,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_repos("alice")
@responses.activate
def test_fetch_events_raises_on_rest_rate_limit():
responses.add(
responses.GET, "https://api.github.com/users/alice/events",
json=RATE_LIMIT_BODY, status=403, headers=RATE_LIMIT_HEADERS,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_events("alice")
@responses.activate
def test_fetch_repo_contributors_raises_on_rest_rate_limit():
responses.add(
responses.GET, "https://api.github.com/repos/alice/proj/contributors",
json=RATE_LIMIT_BODY, status=403, headers=RATE_LIMIT_HEADERS,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_repo_contributors("alice/proj")
@responses.activate
def test_fetch_repo_languages_raises_on_rest_rate_limit():
responses.add(
responses.GET, "https://api.github.com/repos/alice/proj/languages",
json=RATE_LIMIT_BODY, status=403, headers=RATE_LIMIT_HEADERS,
)
src = github.DirectAPISource(token="t")
with pytest.raises(github.GitHubTransientError):
src.fetch_repo_languages("alice/proj")
@responses.activate
def test_single_repo_404_stays_non_fatal():
# A deleted/renamed repo is a real per-repo answer, not a budget problem:
# it must keep degrading gracefully instead of aborting the whole fetch.
responses.add(
responses.GET, "https://api.github.com/repos/alice/gone/languages",
json={"message": "Not Found"}, status=404,
)
responses.add(
responses.GET, "https://api.github.com/repos/alice/gone/contributors",
json={"message": "Not Found"}, status=404,
)
src = github.DirectAPISource(token="t")
assert src.fetch_repo_languages("alice/gone") == {}
assert src.fetch_repo_contributors("alice/gone") == []
@responses.activate
def test_rest_success_path_unchanged():
responses.add(
responses.GET, "https://api.github.com/users/alice",
json={"login": "alice", "followers": 5}, status=200,
)
responses.add(
responses.GET, "https://api.github.com/users/alice/events",
json=[{"type": "PushEvent"}], status=200,
)
responses.add(
responses.GET, "https://api.github.com/repos/alice/proj/languages",
json={"Python": 100}, status=200,
)
responses.add(
responses.GET, "https://api.github.com/repos/alice/proj/contributors",
json=[{"login": "bob", "contributions": 4}], status=200,
)
src = github.DirectAPISource(token="t")
assert src.fetch_user_data("alice")["login"] == "alice"
assert src.fetch_events("alice") == [{"type": "PushEvent"}]
assert src.fetch_repo_languages("alice/proj") == {"Python": 100}
assert src.fetch_repo_contributors("alice/proj") == [{"login": "bob", "contributions": 4}]
@responses.activate
def test_rate_limited_repo_languages_aborts_whole_fetch():
# A rate limit inside the per-repo fan-out means the budget is gone, so it
# must propagate rather than being swallowed into an empty breakdown.
responses.add(
responses.GET, "https://api.github.com/repos/alice/proj/languages",
json=RATE_LIMIT_BODY, status=403, headers=RATE_LIMIT_HEADERS,
)
src = github.DirectAPISource(token="t")
repos = [{"full_name": "alice/proj"}]
with pytest.raises(github.GitHubTransientError):
github._enrich_repo_languages(repos, src)
+27
View File
@@ -0,0 +1,27 @@
# --- stage 1: build the React SPA ---
FROM node:20-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ ./
ARG VITE_GENERATOR_URL=""
ARG VITE_EDGE_URL=""
ENV VITE_GENERATOR_URL=$VITE_GENERATOR_URL
ENV VITE_EDGE_URL=$VITE_EDGE_URL
RUN npm run build
# --- stage 2: python runtime ---
FROM python:3.11-slim AS runtime
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY src ./src
RUN mkdir -p /app/src/static /app/data
COPY --from=frontend-build /app/frontend/dist/ /app/src/static/
EXPOSE 5002
ENV GENERATOR_SETTINGS_DB_PATH=/app/data/settings.db
ENV GENERATOR_WIDGETS_DB_PATH=/app/data/widgets.db
CMD ["gunicorn", "-b", "0.0.0.0:5002", "-w", "2", "src.api:app"]
+56
View File
@@ -0,0 +1,56 @@
# Generator Service
Serves precomputed SVGs to the public internet. Holds user settings and
the widgets cache. Runs a build worker + cron in the background. Also
serves the React SPA (frontend sources live under `frontend/`).
## Run locally (3 processes)
cd generator
pip install -r requirements.txt
# API
FETCHER_URL=http://localhost:5001 FETCHER_INTERNAL_TOKEN=dev python -m src.api
# Build worker
FETCHER_URL=http://localhost:5001 FETCHER_INTERNAL_TOKEN=dev python -m src.worker
# Poll cron
FETCHER_URL=http://localhost:5001 FETCHER_INTERNAL_TOKEN=dev python -m src.cron
## Frontend (dev)
cd generator/frontend && npm install && npm run dev
# Vite dev server proxies /api to the Flask app.
## Test
cd generator && pytest
## Docker
Multi-stage (builds the frontend with node, serves everything from Python):
docker build -t ghstats-generator .
docker run --rm -e FETCHER_URL=http://fetcher:5001 -e FETCHER_INTERNAL_TOKEN=dev \
-p 5002:5002 -v $(pwd)/data:/app/data ghstats-generator
# Worker: override CMD to ["python","-m","src.worker"]
# Cron: override CMD to ["python","-m","src.cron"]
## Endpoints
All API endpoints are under `/api/`. The root and `/assets/*` serve the SPA.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /api/health | none | health |
| GET | /api/<u> | none | composite SVG; auto-enrolls unknown users |
| GET | /api/<u>/<w>.svg | none | individual widget SVG |
| POST | /api/enroll | none | explicit enroll (body: {username}) |
| GET | /api/<u>/settings | stub | current settings |
| PATCH | /api/<u>/settings | stub | update settings (enqueues rebuild) |
| POST | /api/<u>/refresh | stub | one-shot re-fetch + rebuild |
Responses carry `X-Widget-Status: ready | building | rate_limited | not_found`.
## Env
See `src/config.py`.
View File
+2
View File
@@ -0,0 +1,2 @@
VITE_GENERATOR_URL=http://localhost:5002
VITE_EDGE_URL=http://localhost:5003
+24
View File
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
+17
View File
@@ -0,0 +1,17 @@
# Frontend (Vite + React)
Part of the generator service. Sources live here; the production build
is served as static files by the generator's Flask app (at `/`) and
produced by the generator's Dockerfile.
## Dev
npm install
VITE_GENERATOR_URL=http://localhost:5002 VITE_EDGE_URL=http://localhost:5003 npm run dev
Vite proxies `/api/*` to the Flask app at :5002.
## Build
npm run build
# produces dist/ which is copied into generator/src/static/ by the Docker build
+23
View File
@@ -0,0 +1,23 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist']),
{
files: ['**/*.{ts,tsx}'],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
},
])
+54
View File
@@ -0,0 +1,54 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<link rel="icon" type="image/svg+xml" href="/favicon.svg"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>gh-stats - one stats card for your GitHub profile README</title>
<meta name="description"
content="Drop one line into your GitHub profile README and get a single SVG card: your score, contribution timeline, top collaborators, language breakdown, commit streaks and auto-awarded tags. Free, no signup needed."/>
<link rel="canonical" href="https://gh-stats.com/"/>
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="gh-stats"/>
<meta property="og:url" content="https://gh-stats.com/"/>
<meta property="og:title" content="One stats card for your GitHub profile README"/>
<meta property="og:description"
content="Score, contribution timeline, top collaborators, languages, streaks and tags. One line of markdown, five themes, no signup."/>
<meta property="og:image" content="https://gh-stats.com/og.png"/>
<meta property="og:image:width" content="1200"/>
<meta property="og:image:height" content="630"/>
<meta property="og:image:alt" content="A gh-stats card on a GitHub profile README."/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:title" content="One stats card for your GitHub profile README"/>
<meta name="twitter:description"
content="Score, contribution timeline, top collaborators, languages, streaks and tags. One line of markdown, five themes, no signup."/>
<meta name="twitter:image" content="https://gh-stats.com/og.png"/>
<script type="module">
// Import the functions you need from the SDKs you need
import {initializeApp} from "https://www.gstatic.com/firebasejs/12.13.0/firebase-app.js";
import {getAnalytics} from "https://www.gstatic.com/firebasejs/12.13.0/firebase-analytics.js";
// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyCy2pUW8Geo0Aagq9mTYKlfCpa9GUIXpy8",
authDomain: "gh-stats-284de.firebaseapp.com",
projectId: "gh-stats-284de",
storageBucket: "gh-stats-284de.firebasestorage.app",
messagingSenderId: "723662839762",
appId: "1:723662839762:web:4ba5337f6489ea67dc320b",
measurementId: "G-228GR89RYX"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);
</script>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
File diff suppressed because it is too large Load Diff
+34
View File
@@ -0,0 +1,34 @@
{
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"dompurify": "^3.4.0",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@eslint/js": "^9.39.4",
"@tailwindcss/vite": "^4.2.2",
"@types/dompurify": "^3.0.5",
"@types/node": "^24.12.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"tailwindcss": "^4.2.2",
"typescript": "~6.0.2",
"typescript-eslint": "^8.58.0",
"vite": "^8.0.4"
}
}
+9
View File
@@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
<rect width="64" height="64" rx="14" ry="14" fill="#121820"/>
<text x="32" y="47"
text-anchor="middle"
font-family="'Instrument Serif', Georgia, 'Times New Roman', serif"
font-size="46"
font-style="italic"
fill="#f5f1e8">G</text>
</svg>

After

Width:  |  Height:  |  Size: 365 B

+24
View File
@@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="bluesky-icon" viewBox="0 0 16 17">
<g clip-path="url(#bluesky-clip)"><path fill="#08060d" d="M7.75 7.735c-.693-1.348-2.58-3.86-4.334-5.097-1.68-1.187-2.32-.981-2.74-.79C.188 2.065.1 2.812.1 3.251s.241 3.602.398 4.13c.52 1.744 2.367 2.333 4.07 2.145-2.495.37-4.71 1.278-1.805 4.512 3.196 3.309 4.38-.71 4.987-2.746.608 2.036 1.307 5.91 4.93 2.746 2.72-2.746.747-4.143-1.747-4.512 1.702.189 3.55-.4 4.07-2.145.156-.528.397-3.691.397-4.13s-.088-1.186-.575-1.406c-.42-.19-1.06-.395-2.741.79-1.755 1.24-3.64 3.752-4.334 5.099"/></g>
<defs><clipPath id="bluesky-clip"><path fill="#fff" d="M.1.85h15.3v15.3H.1z"/></clipPath></defs>
</symbol>
<symbol id="discord-icon" viewBox="0 0 20 19">
<path fill="#08060d" d="M16.224 3.768a14.5 14.5 0 0 0-3.67-1.153c-.158.286-.343.67-.47.976a13.5 13.5 0 0 0-4.067 0c-.128-.306-.317-.69-.476-.976A14.4 14.4 0 0 0 3.868 3.77C1.546 7.28.916 10.703 1.231 14.077a14.7 14.7 0 0 0 4.5 2.306q.545-.748.965-1.587a9.5 9.5 0 0 1-1.518-.74q.191-.14.372-.293c2.927 1.369 6.107 1.369 8.999 0q.183.152.372.294-.723.437-1.52.74.418.838.963 1.588a14.6 14.6 0 0 0 4.504-2.308c.37-3.911-.63-7.302-2.644-10.309m-9.13 8.234c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.894 0 1.614.82 1.599 1.82.001 1-.705 1.82-1.6 1.82m5.91 0c-.878 0-1.599-.82-1.599-1.82 0-.998.705-1.82 1.6-1.82.893 0 1.614.82 1.599 1.82 0 1-.706 1.82-1.6 1.82"/>
</symbol>
<symbol id="documentation-icon" viewBox="0 0 21 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="m15.5 13.333 1.533 1.322c.645.555.967.833.967 1.178s-.322.623-.967 1.179L15.5 18.333m-3.333-5-1.534 1.322c-.644.555-.966.833-.966 1.178s.322.623.966 1.179l1.534 1.321"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M17.167 10.836v-4.32c0-1.41 0-2.117-.224-2.68-.359-.906-1.118-1.621-2.08-1.96-.599-.21-1.349-.21-2.848-.21-2.623 0-3.935 0-4.983.369-1.684.591-3.013 1.842-3.641 3.428C3 6.449 3 7.684 3 10.154v2.122c0 2.558 0 3.838.706 4.726q.306.383.713.671c.76.536 1.79.64 3.581.66"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M3 10a2.78 2.78 0 0 1 2.778-2.778c.555 0 1.209.097 1.748-.047.48-.129.854-.503.982-.982.145-.54.048-1.194.048-1.749a2.78 2.78 0 0 1 2.777-2.777"/>
</symbol>
<symbol id="github-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M9.356 1.85C5.05 1.85 1.57 5.356 1.57 9.694a7.84 7.84 0 0 0 5.324 7.44c.387.079.528-.168.528-.376 0-.182-.013-.805-.013-1.454-2.165.467-2.616-.935-2.616-.935-.349-.91-.864-1.143-.864-1.143-.71-.48.051-.48.051-.48.787.051 1.2.805 1.2.805.695 1.194 1.817.857 2.268.649.064-.507.27-.857.49-1.052-1.728-.182-3.545-.857-3.545-3.87 0-.857.31-1.558.8-2.104-.078-.195-.349-1 .077-2.078 0 0 .657-.208 2.14.805a7.5 7.5 0 0 1 1.946-.26c.657 0 1.328.092 1.946.26 1.483-1.013 2.14-.805 2.14-.805.426 1.078.155 1.883.078 2.078.502.546.799 1.247.799 2.104 0 3.013-1.818 3.675-3.558 3.87.284.247.528.714.528 1.454 0 1.052-.012 1.896-.012 2.156 0 .208.142.455.528.377a7.84 7.84 0 0 0 5.324-7.441c.013-4.338-3.48-7.844-7.773-7.844" clip-rule="evenodd"/>
</symbol>
<symbol id="social-icon" viewBox="0 0 20 20">
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M12.5 6.667a4.167 4.167 0 1 0-8.334 0 4.167 4.167 0 0 0 8.334 0"/>
<path fill="none" stroke="#aa3bff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.35" d="M2.5 16.667a5.833 5.833 0 0 1 8.75-5.053m3.837.474.513 1.035c.07.144.257.282.414.309l.93.155c.596.1.736.536.307.965l-.723.73a.64.64 0 0 0-.152.531l.207.903c.164.715-.213.991-.84.618l-.872-.52a.63.63 0 0 0-.577 0l-.872.52c-.624.373-1.003.094-.84-.618l.207-.903a.64.64 0 0 0-.152-.532l-.723-.729c-.426-.43-.289-.864.306-.964l.93-.156a.64.64 0 0 0 .412-.31l.513-1.034c.28-.562.735-.562 1.012 0"/>
</symbol>
<symbol id="x-icon" viewBox="0 0 19 19">
<path fill="#08060d" fill-rule="evenodd" d="M1.893 1.98c.052.072 1.245 1.769 2.653 3.77l2.892 4.114c.183.261.333.48.333.486s-.068.089-.152.183l-.522.593-.765.867-3.597 4.087c-.375.426-.734.834-.798.905a1 1 0 0 0-.118.148c0 .01.236.017.664.017h.663l.729-.83c.4-.457.796-.906.879-.999a692 692 0 0 0 1.794-2.038c.034-.037.301-.34.594-.675l.551-.624.345-.392a7 7 0 0 1 .34-.374c.006 0 .93 1.306 2.052 2.903l2.084 2.965.045.063h2.275c1.87 0 2.273-.003 2.266-.021-.008-.02-1.098-1.572-3.894-5.547-2.013-2.862-2.28-3.246-2.273-3.266.008-.019.282-.332 2.085-2.38l2-2.274 1.567-1.782c.022-.028-.016-.03-.65-.03h-.674l-.3.342a871 871 0 0 1-1.782 2.025c-.067.075-.405.458-.75.852a100 100 0 0 1-.803.91c-.148.172-.299.344-.99 1.127-.304.343-.32.358-.345.327-.015-.019-.904-1.282-1.976-2.808L6.365 1.85H1.8zm1.782.91 8.078 11.294c.772 1.08 1.413 1.973 1.425 1.984.016.017.241.02 1.05.017l1.03-.004-2.694-3.766L7.796 5.75 5.722 2.852l-1.039-.004-1.039-.004z" clip-rule="evenodd"/>
</symbol>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

+3
View File
@@ -0,0 +1,3 @@
User-agent: *
Allow: /
Sitemap: https://gh-stats.com/sitemap.xml
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://gh-stats.com/</loc>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
</urlset>
+1
View File
@@ -0,0 +1 @@
/* Intentionally empty — all styles use Tailwind */
+444
View File
@@ -0,0 +1,444 @@
import { useState, useRef, useCallback, useEffect } from 'react'
import './index.css'
import { SearchScreen } from './screens/SearchScreen'
import { WorkshopScreen } from './screens/WorkshopScreen'
import { ResultScreen } from './screens/ResultScreen'
import { DevScreen } from './screens/DevScreen'
import { AuthButton } from './components/AuthButton'
import type { WidgetData } from './lib/renderWidgets'
import { DEMO_WIDGET_DATA } from './lib/demoData'
import { fetchMe, type Me } from './lib/auth'
import { buildEmbedUrl } from './lib/settingsQuery'
export type Achievement = {
title: string
subtitle: string
event_date: string
icon: string
}
export type PerWidgetSettings = {
grade?: { max_tags?: number }
impact?: { line_color?: string }
streaks?: { color?: string }
collaborators?: { max_count?: number; bar_color?: string }
focus?: { max_categories?: number }
languages?: { max_languages?: number }
achievements?: { max_items?: number }
}
export type WidgetSettings = {
theme: string
widgets: string[]
widgetOrder: string[]
impactPeriod: string
customTags: string[]
hiddenLanguages: string[]
achievements: Achievement[]
widgetSettings: PerWidgetSettings
}
const DEFAULT_SETTINGS: WidgetSettings = {
theme: 'midnight',
widgets: ['name', 'grade', 'impact', 'streaks', 'collaborators', 'focus', 'languages'],
widgetOrder: ['name', 'grade', 'impact', 'streaks', 'collaborators', 'focus', 'languages', 'achievements'],
impactPeriod: '6mo',
customTags: [],
hiddenLanguages: [],
achievements: [],
widgetSettings: {},
}
type Step = 'search' | 'workshop' | 'result'
// Signing in navigates the whole tab through GitHub's OAuth flow, and the
// SPA keeps username + settings only in React state, so without this the
// user comes back to an empty search box with their edits gone.
// sessionStorage survives the round trip within the tab.
const RESUME_KEY = 'gh-stats:in-progress'
type Resume = { username: string; settings: WidgetSettings }
function loadResume(): Resume | null {
try {
const raw = sessionStorage.getItem(RESUME_KEY)
if (!raw) return null
const parsed = JSON.parse(raw) as Partial<Resume> | null
if (!parsed || typeof parsed.username !== 'string' || !parsed.username) return null
if (!parsed.settings || typeof parsed.settings !== 'object') return null
return { username: parsed.username, settings: { ...DEFAULT_SETTINGS, ...parsed.settings } }
} catch {
return null
}
}
const POLL_INTERVAL_MS = 2000
const POLL_TIMEOUT_MS = 120_000
// ResultScreen poll: a bit slower than the workshop poll because each tick
// re-fetches the full SVG, not a small JSON. 3s spacing is responsive
// enough to feel near-instant when the widget lands.
const RESULT_POLL_INTERVAL_MS = 3000
// Give up after 3 minutes — long enough to cover even worst-case
// first-time GitHub fetches; past that the user can hit "Check now".
const RESULT_POLL_TIMEOUT_MS = 180_000
type WidgetStatus = 'ready' | 'building' | 'not_found' | 'rate_limited'
function readWidgetStatus(r: Response): WidgetStatus {
const raw = r.headers.get('X-Widget-Status')
if (raw === 'building' || raw === 'not_found' || raw === 'rate_limited') return raw
return 'ready'
}
export default function App() {
if (typeof window !== 'undefined' && window.location.pathname === '/dev') {
return <DevScreen />
}
const [me, setMe] = useState<Me>({ login: null })
// Work in progress left behind by a sign-in redirect, if any.
const [resumed] = useState(loadResume)
const [step, setStep] = useState<Step>(resumed ? 'workshop' : 'search')
const [username, setUsername] = useState(resumed?.username ?? '')
const [settings, setSettings] = useState<WidgetSettings>(resumed?.settings ?? { ...DEFAULT_SETTINGS })
const [widgetData, setWidgetData] = useState<WidgetData | null>(null)
const [fetchDone, setFetchDone] = useState(false)
const [fetchError, setFetchError] = useState<string | null>(null)
// Final SVG produced by POST /api/<u>/generate. Rendered on the Result
// screen so the user sees the actual backend output, not demo data.
const [generatedSvg, setGeneratedSvg] = useState<string | null>(null)
const [generateError, setGenerateError] = useState<string | null>(null)
const [generating, setGenerating] = useState(false)
// The URL we actually fetched for the preview — also the one we show as
// the embed snippet. For owners this is /api/<u> (backed by stored
// settings). For visitors it's /api/<u>?<query>, which round-trips their
// Workshop edits without touching the owner's saved widget.
const [embedUrl, setEmbedUrl] = useState<string>('')
// 'ready' once the backend has actually rendered the user's widget; until
// then the SVG returned by /api/<u> is the "Building @user's widget…"
// placeholder. We poll on this so the page upgrades itself from
// placeholder to real widget without the user having to refresh.
const [widgetStatus, setWidgetStatus] = useState<'ready' | 'building' | 'not_found' | 'rate_limited'>('ready')
const pollTimer = useRef<number | null>(null)
const pollStart = useRef<number>(0)
const aborted = useRef(false)
const resultPollTimer = useRef<number | null>(null)
const resultPollStart = useRef<number>(0)
const stopPolling = useCallback(() => {
if (pollTimer.current != null) {
window.clearTimeout(pollTimer.current)
pollTimer.current = null
}
}, [])
const stopResultPolling = useCallback(() => {
if (resultPollTimer.current != null) {
window.clearTimeout(resultPollTimer.current)
resultPollTimer.current = null
}
}, [])
// Pull and re-render the embed SVG once. Used both by the auto-poll loop
// (when the first /api/<u> returned a building placeholder) and by the
// manual "Check now" button on ResultScreen.
const refetchEmbed = useCallback(async () => {
if (!embedUrl) return
try {
const r = await fetch(`${embedUrl}${embedUrl.includes('?') ? '&' : '?'}t=${Date.now()}`)
if (!r.ok) return
const status = readWidgetStatus(r)
const text = await r.text()
setGeneratedSvg(text)
setWidgetStatus(status)
} catch {
/* transient — let the next poll tick try again */
}
}, [embedUrl])
useEffect(() => stopPolling, [stopPolling])
useEffect(() => stopResultPolling, [stopResultPolling])
useEffect(() => { fetchMe().then(setMe) }, [])
// Result-screen auto-refresh. Backend serves a "Building @user's widget…"
// placeholder SVG (with header X-Widget-Status: building) until the
// worker finishes the first build. Without this loop the user would
// stare at the placeholder until they manually reloaded.
useEffect(() => {
if (step !== 'result' || widgetStatus !== 'building' || !embedUrl) return
resultPollStart.current = Date.now()
const tick = async () => {
await refetchEmbed()
if (Date.now() - resultPollStart.current > RESULT_POLL_TIMEOUT_MS) {
stopResultPolling()
return
}
resultPollTimer.current = window.setTimeout(tick, RESULT_POLL_INTERVAL_MS)
}
resultPollTimer.current = window.setTimeout(tick, RESULT_POLL_INTERVAL_MS)
return stopResultPolling
}, [step, widgetStatus, embedUrl, refetchEmbed, stopResultPolling])
// `keepSettings` is set when resuming after a sign-in redirect: the
// settings already on screen are the user's own unsaved edits, so neither
// the reset nor the server hydration below may overwrite them.
const startFetch = useCallback((user: string, keepSettings = false) => {
stopPolling()
aborted.current = false
pollStart.current = Date.now()
setFetchDone(false)
setFetchError(null)
// Show demo data immediately so Workshop is interactive while the worker builds.
setWidgetData(DEMO_WIDGET_DATA)
// Reset to defaults first so the form doesn't briefly show the previous
// user's settings while we fetch this user's saved blob.
if (!keepSettings) setSettings({ ...DEFAULT_SETTINGS })
// Hydrate the Workshop form from the user's persisted settings.
// Backend stores snake_case keys; we map them onto the camelCase
// state shape here. 404 (not enrolled yet) is expected — keep defaults.
if (!keepSettings) void (async () => {
try {
const r = await fetch(`/api/${encodeURIComponent(user)}/settings`, {
credentials: 'include',
})
if (aborted.current) return
if (!r.ok) return
const body = await r.json().catch(() => null) as { settings?: Record<string, unknown> } | null
const s = body?.settings
if (!s || typeof s !== 'object') return
setSettings(prev => {
const next: WidgetSettings = { ...prev }
if (typeof s.theme === 'string') next.theme = s.theme
if (Array.isArray(s.enabled)) next.widgets = s.enabled.filter(x => typeof x === 'string') as string[]
if (Array.isArray(s.widget_order)) next.widgetOrder = s.widget_order.filter(x => typeof x === 'string') as string[]
if (Array.isArray(s.custom_tags)) next.customTags = s.custom_tags.filter(x => typeof x === 'string') as string[]
if (Array.isArray(s.hidden_languages)) next.hiddenLanguages = s.hidden_languages.filter(x => typeof x === 'string') as string[]
if (s.widget_settings && typeof s.widget_settings === 'object') {
next.widgetSettings = s.widget_settings as PerWidgetSettings
}
if (Array.isArray(s.achievements)) {
next.achievements = s.achievements
.filter((a): a is Record<string, unknown> => !!a && typeof a === 'object')
.map(a => ({
title: typeof a.title === 'string' ? a.title : '',
subtitle: typeof a.subtitle === 'string' ? a.subtitle : '',
event_date: typeof a.event_date === 'string' ? a.event_date : '',
icon: typeof a.icon === 'string' ? a.icon : 'trophy',
}))
}
return next
})
} catch (e) {
if (!aborted.current) console.warn('Settings load failed:', e)
}
})()
const poll = async () => {
if (aborted.current) return
try {
const r = await fetch(`/api/${encodeURIComponent(user)}/data`)
if (aborted.current) return
const body = await r.json().catch(
() => ({} as { status?: string; data?: WidgetData })
)
const status = body.status
if (r.status === 200 && status === 'ready' && body.data) {
setWidgetData(body.data)
setFetchDone(true)
return
}
if (status === 'not_found') {
// Fetcher confirmed the user doesn't exist on GitHub.
setFetchError('User not found')
setFetchDone(true)
return
}
if (r.status === 404) {
// 404 without status==='not_found' means the user simply isn't
// enrolled yet (no settings row). Keep the demo data on screen
// and stop polling — no error to display.
setFetchDone(true)
return
}
if (r.status === 429 || status === 'rate_limited') {
setFetchError('Enrollment limit reached — try again tomorrow')
setFetchDone(true)
return
}
// 202 building (or any non-terminal) — poll again until timeout.
if (Date.now() - pollStart.current > POLL_TIMEOUT_MS) {
setFetchError('Still building — refresh to keep waiting')
setFetchDone(true)
return
}
pollTimer.current = window.setTimeout(poll, POLL_INTERVAL_MS)
} catch (e) {
if (aborted.current) return
console.warn('Data poll failed:', e)
setFetchError('Network error')
setFetchDone(true)
}
}
poll()
}, [stopPolling])
// Keep the in-progress username and settings recoverable across the
// sign-in redirect (and a plain reload). Cleared once the user is back
// on the search screen, so a fresh visit starts fresh.
useEffect(() => {
try {
if (step === 'search' || !username) sessionStorage.removeItem(RESUME_KEY)
else sessionStorage.setItem(RESUME_KEY, JSON.stringify({ username, settings }))
} catch {
/* private mode or quota: resuming is a nicety, not a requirement */
}
}, [step, username, settings])
// Restore: the widget data itself is not persisted, so re-fetch it for
// the username we came back to.
useEffect(() => {
if (resumed) startFetch(resumed.username, true)
}, [resumed, startFetch])
const handleSearch = (user: string) => {
setUsername(user)
startFetch(user)
setStep('workshop')
}
const handleGenerate = async () => {
setStep('result')
setGenerating(true)
setGeneratedSvg(null)
setGenerateError(null)
setWidgetStatus('ready')
const isOwner = !!me.login && me.login.toLowerCase() === username.toLowerCase()
try {
if (isOwner) {
// Owner path: persist settings, then force a server-side render
// against the stored payload. The resulting /api/<u> is the embed.
const backendSettings = {
theme: settings.theme,
enabled: settings.widgets,
widget_order: settings.widgetOrder,
custom_tags: settings.customTags,
hidden_languages: settings.hiddenLanguages,
widget_settings: settings.widgetSettings,
achievements: settings.achievements.filter(a => a.title.trim()),
}
const patchRes = await fetch(`/api/${encodeURIComponent(username)}/settings`, {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(backendSettings),
})
if (!patchRes.ok && patchRes.status !== 404) {
setGenerateError(`Settings sync failed (HTTP ${patchRes.status})`)
return
}
const r = await fetch(`/api/${encodeURIComponent(username)}/generate`, {
method: 'POST',
credentials: 'include',
})
if (r.status === 404) {
const body = await r.json().catch(() => ({} as { status?: string }))
setGenerateError(body.status === 'not_found' ? 'User not found' : 'Not enrolled')
return
}
if (!r.ok) {
setGenerateError(`Generate failed (HTTP ${r.status})`)
return
}
const cleanUrl = `${window.location.origin}/api/${encodeURIComponent(username)}`
// Cache-bust so regenerate after settings change shows the new
// version, not a stale browser copy. The cache-busting `t` param
// is not read server-side (not in the allow-list) so the render
// stays cacheable at the edge.
const svgRes = await fetch(`${cleanUrl}?t=${Date.now()}`)
if (!svgRes.ok) {
setGenerateError(`SVG fetch failed (HTTP ${svgRes.status})`)
return
}
setGeneratedSvg(await svgRes.text())
setEmbedUrl(cleanUrl)
setWidgetStatus(readWidgetStatus(svgRes))
} else {
// Visitor path: encode Workshop edits into a query string and hit
// the same URL we'll hand the user for their README. No owner
// settings are written. The backend renders ad-hoc against the
// fetcher's cached payload for this user.
const url = buildEmbedUrl(window.location.origin, username, settings)
// Same cache-bust trick — unknown query params are ignored by the
// sanitizer, so this doesn't alter the rendered output.
const svgRes = await fetch(`${url}${url.includes('?') ? '&' : '?'}t=${Date.now()}`)
if (svgRes.status === 404) {
setGenerateError('User not enrolled — ask them to sign in and generate first')
return
}
if (!svgRes.ok) {
setGenerateError(`SVG fetch failed (HTTP ${svgRes.status})`)
return
}
setGeneratedSvg(await svgRes.text())
setEmbedUrl(url)
setWidgetStatus(readWidgetStatus(svgRes))
}
} catch (e) {
console.warn('generate call failed:', e)
setGenerateError('Network error')
} finally {
setGenerating(false)
}
}
const handleBack = () => {
if (step === 'result') setStep('workshop')
else if (step === 'workshop') {
aborted.current = true
stopPolling()
setStep('search')
}
}
return (
<div className="min-h-screen bg-gray-50">
<div className="fixed right-4 top-4 z-50">
<AuthButton me={me} onChange={setMe} />
</div>
{step === 'search' && (
<SearchScreen onSearch={handleSearch} />
)}
{step === 'workshop' && (
<WorkshopScreen
username={username}
settings={settings}
onSettingsChange={setSettings}
onGenerate={handleGenerate}
onBack={handleBack}
fetchDone={fetchDone}
fetchError={fetchError}
widgetData={widgetData}
isDemoData={widgetData === DEMO_WIDGET_DATA}
me={me}
onAuthChange={setMe}
/>
)}
{step === 'result' && (
<ResultScreen
username={username}
generating={generating}
generatedSvg={generatedSvg}
generateError={generateError}
embedUrl={embedUrl}
widgetStatus={widgetStatus}
onBack={handleBack}
onRegenerate={handleGenerate}
onRefresh={refetchEmbed}
/>
)}
</div>
)
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

+1
View File
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>

After

Width:  |  Height:  |  Size: 4.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.5 KiB

@@ -0,0 +1,36 @@
import type { Me } from '../lib/auth'
import { signInUrl, signOut } from '../lib/auth'
export function AuthButton({ me, onChange }: { me: Me; onChange: (m: Me) => void }) {
if (!me.login) {
return (
<a
href={signInUrl()}
className="inline-flex items-center gap-2 rounded-full bg-gray-900 px-4 py-1.5 text-sm font-medium text-white shadow-sm transition hover:bg-gray-800"
>
<svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" className="h-4 w-4">
<path d="M8 0C3.58 0 0 3.58 0 8a8 8 0 0 0 5.47 7.59c.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.42 7.42 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z" />
</svg>
Sign in with GitHub
</a>
)
}
return (
<div className="inline-flex items-center gap-2 rounded-full border border-gray-200 bg-white py-1 pr-1 pl-3 text-sm shadow-sm">
{me.avatar_url && (
<img
src={me.avatar_url}
alt=""
className="h-6 w-6 rounded-full object-cover"
/>
)}
<span className="font-medium text-gray-900">{me.login}</span>
<button
onClick={async () => { await signOut(); onChange({ login: null }) }}
className="rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700 transition hover:bg-gray-200"
>
Sign out
</button>
</div>
)
}
@@ -0,0 +1,163 @@
import { useEffect, useState } from 'react'
import { fetchGrowth, type Growth } from '../lib/dev'
type Mode = 'daily' | 'weekly'
export function GrowthChart() {
const [data, setData] = useState<Growth | null>(null)
const [mode, setMode] = useState<Mode>('daily')
useEffect(() => { fetchGrowth().then(setData).catch(() => {}) }, [])
// Trim leading empty buckets so the chart starts at the first day/week
// with traffic instead of e.g. four weeks of zeros from before the
// service went live.
const rawPoints = data ? (mode === 'daily' ? data.daily : data.weekly) : []
const firstActive = rawPoints.findIndex(p => p.requests > 0 || p.users > 0)
const points = firstActive >= 0 ? rawPoints.slice(firstActive) : []
const labels = points.map(p => 'day' in p ? p.day : p.week)
const requests = points.map(p => p.requests)
const users = points.map(p => p.users)
return (
<div className="rounded-lg border border-white/10 bg-white/[0.02] p-4">
<div className="mb-3 flex items-center justify-between">
<div className="text-sm text-white/70">Growth</div>
<div className="flex gap-1 text-xs">
<Tab active={mode === 'daily'} onClick={() => setMode('daily')}>day · 30</Tab>
<Tab active={mode === 'weekly'} onClick={() => setMode('weekly')}>week · 12</Tab>
</div>
</div>
{!data ? (
<div className="text-xs text-white/40">loading…</div>
) : points.length === 0 ? (
<div className="text-xs text-white/40">no traffic yet</div>
) : (
<div className="space-y-4">
<Line label="Requests" values={requests} labels={labels} mode={mode} stroke="#60a5fa" />
<Line label="Unique users" values={users} labels={labels} mode={mode} stroke="#a78bfa" />
</div>
)}
</div>
)
}
function Tab({ active, onClick, children }: { active: boolean; onClick: () => void; children: React.ReactNode }) {
return (
<button
onClick={onClick}
className={`rounded px-2 py-0.5 font-mono transition ${
active ? 'bg-white/10 text-white' : 'text-white/40 hover:text-white/70'
}`}
>
{children}
</button>
)
}
function Line({ label, values, labels, mode, stroke }: {
label: string; values: number[]; labels: string[]; mode: Mode; stroke: string
}) {
const width = 600
const height = 70
const vbH = height + 10 // viewBox height; bottom 10 holds the x-tick marks
const max = Math.max(1, ...values)
const n = values.length
const stepX = n > 1 ? width / (n - 1) : 0
const total = values.reduce((a, b) => a + b, 0)
const latest = values[n - 1] ?? 0
// Map a value to its y coordinate in viewBox space; reused for both the
// line points and the y-axis label positions so they stay aligned.
const yFor = (v: number) => height - (v / max) * (height - 4) - 2
const xy = values.map((v, i) => ({ x: n > 1 ? i * stepX : width / 2, y: yFor(v) }))
const pts = xy.map(p => `${p.x.toFixed(1)},${p.y.toFixed(1)}`).join(' ')
// Sealed area polygon: only valid when we have a real line (n >= 2).
const area = n > 1 ? `0,${height} ${pts} ${width},${height}` : ''
const ticks = pickTicks(labels, Math.min(6, n))
// y-axis labels: top (max), middle, baseline (0). Percent positions are
// relative to the same viewBox the chart is drawn in.
const yMarks = max > 1
? [max, Math.round(max / 2), 0]
: [max, 0]
return (
<div>
<div className="mb-1 flex items-baseline justify-between text-xs">
<span className="text-white/60">{label}</span>
<span className="font-mono tabular-nums text-white/40">
latest <span className="text-white/80">{latest.toLocaleString()}</span>
<span className="ml-3">total <span className="text-white/80">{total.toLocaleString()}</span></span>
</span>
</div>
<div className="flex gap-1.5">
{/* y-axis */}
<div className="relative w-7 shrink-0" style={{ height: vbH }}>
{yMarks.map(v => (
<span key={v}
className="absolute right-0 -translate-y-1/2 font-mono text-[10px] tabular-nums text-white/35"
style={{ top: `${(yFor(v) / vbH) * 100}%` }}>
{fmtCompact(v)}
</span>
))}
</div>
{/* plot + x-axis */}
<div className="min-w-0 flex-1">
<svg viewBox={`0 0 ${width} ${vbH}`} className="w-full" style={{ height: vbH }} preserveAspectRatio="none">
{area && <polyline points={area} fill={stroke} fillOpacity="0.08" stroke="none" />}
{n > 1 && (
<polyline points={pts} fill="none" stroke={stroke} strokeWidth={1.5}
strokeLinecap="round" strokeLinejoin="round"
vectorEffect="non-scaling-stroke" />
)}
{n === 1 && (
<circle cx={xy[0].x} cy={xy[0].y} r={3} fill={stroke} />
)}
{ticks.map(t => {
const x = n > 1 ? t.idx * stepX : width / 2
return (
<line key={`tick-${t.idx}`} x1={x} x2={x} y1={height} y2={height + 3}
stroke="rgb(255 255 255 / 0.15)" strokeWidth={1}
vectorEffect="non-scaling-stroke" />
)
})}
</svg>
<div className="relative mt-1 h-3">
{ticks.map(t => (
<span key={`label-${t.idx}`}
className="absolute -translate-x-1/2 whitespace-nowrap font-mono text-[10px] text-white/40"
style={{ left: n > 1 ? `${(t.idx / (n - 1)) * 100}%` : '50%' }}>
{formatTick(t.label, mode)}
</span>
))}
</div>
</div>
</div>
</div>
)
}
function fmtCompact(n: number): string {
if (n >= 10000) return `${Math.round(n / 1000)}k`
if (n >= 1000) return `${(n / 1000).toFixed(1)}k`
return String(Math.round(n))
}
function pickTicks(labels: string[], n: number): { idx: number; label: string }[] {
if (labels.length === 0 || n <= 0) return []
if (labels.length <= n) return labels.map((label, idx) => ({ idx, label }))
const out: { idx: number; label: string }[] = []
for (let i = 0; i < n; i++) {
const idx = Math.round((i * (labels.length - 1)) / (n - 1))
out.push({ idx, label: labels[idx] })
}
return out
}
function formatTick(label: string, mode: Mode): string {
if (mode === 'daily') {
// "2026-05-27" -> "05-27"
return label.length >= 10 ? label.slice(5) : label
}
// "2026-W21" -> "W21"
const parts = label.split('-')
return parts[1] || label
}
@@ -0,0 +1,30 @@
import { useEffect, useState } from 'react'
import { fetchHealth, type Health } from '../lib/dev'
export function HealthStrip() {
const [h, setH] = useState<Health | null>(null)
useEffect(() => { fetchHealth().then(setH).catch(() => {}) }, [])
if (!h) return null
const pct = (n: number) => `${(n * 100).toFixed(1)}%`
return (
<div className="rounded-lg border border-white/10 bg-white/[0.02] p-4">
<div className="mb-3 text-sm text-white/70">Health</div>
<div className="grid grid-cols-3 gap-3 text-center">
<Pill label="Edge cache hit" value={pct(h.edge_cache_hit_rate)} />
<Pill label="Fetch error" value={pct(h.fetcher_error_rate)} tone={h.fetcher_error_rate > 0.05 ? 'warn' : 'ok'} />
<Pill label="Events dropped 24h" value={h.events_dropped_24h.toLocaleString()}
tone={h.events_dropped_24h > 0 ? 'warn' : 'ok'} />
</div>
</div>
)
}
function Pill({ label, value, tone = 'ok' }: { label: string; value: string; tone?: 'ok' | 'warn' }) {
const color = tone === 'warn' ? 'text-amber-400' : 'text-emerald-400'
return (
<div className="rounded bg-white/[0.03] px-2 py-2">
<div className="text-xs text-white/40">{label}</div>
<div className={`mt-1 font-mono text-lg ${color}`}>{value}</div>
</div>
)
}
@@ -0,0 +1,34 @@
import { useEffect, useState } from 'react'
import { fetchLatency, type LatencyRow } from '../lib/dev'
export function LatencyChart() {
const [rows, setRows] = useState<LatencyRow[]>([])
useEffect(() => { fetchLatency().then(setRows).catch(() => {}) }, [])
const max = Math.max(1, ...rows.map(r => r.p95))
return (
<div className="rounded-lg border border-white/10 bg-white/[0.02] p-4">
<div className="mb-3 text-sm text-white/70">Latency by endpoint</div>
{rows.length === 0 && <div className="text-xs text-white/40">no traffic yet</div>}
<div className="space-y-1.5">
{rows.map(r => (
<div key={r.endpoint} className="grid grid-cols-[1fr_auto] items-center gap-3 font-mono text-xs">
<div>
<div className="text-white/70">{r.endpoint}</div>
<div className="mt-1 h-1.5 w-full overflow-hidden rounded bg-white/[0.04]">
<div className="h-full bg-sky-400/60" style={{ width: `${(r.p50 / max) * 100}%` }} />
<div className="-mt-1.5 h-1.5 bg-sky-300/30" style={{ width: `${(r.p95 / max) * 100}%` }} />
</div>
</div>
<div className="text-right text-white/80 tabular-nums">
<span>{r.p50}</span><span className="text-white/30"> · </span>
<span>{r.p95}</span><span className="text-white/30"> · </span>
<span>{r.p99}ms</span>
</div>
</div>
))}
</div>
</div>
)
}
@@ -0,0 +1,17 @@
type Props = { values: number[]; width?: number; height?: number; stroke?: string }
export function Sparkline({ values, width = 140, height = 32, stroke = '#60a5fa' }: Props) {
if (values.length === 0) return <svg width={width} height={height} />
const max = Math.max(1, ...values)
const stepX = width / Math.max(1, values.length - 1)
const pts = values.map((v, i) => {
const x = i * stepX
const y = height - (v / max) * (height - 2) - 1
return `${x.toFixed(1)},${y.toFixed(1)}`
}).join(' ')
return (
<svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>
<polyline points={pts} fill="none" stroke={stroke} strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round" />
</svg>
)
}
@@ -0,0 +1,26 @@
import type { ReactNode } from 'react'
import { Sparkline } from './Sparkline'
import type { Summary } from '../lib/dev'
function Card({ label, value, sub }: { label: string; value: string; sub?: ReactNode }) {
return (
<div className="rounded-lg border border-white/10 bg-white/[0.02] px-4 py-3">
<div className="text-xs uppercase tracking-wide text-white/50">{label}</div>
<div className="mt-1 text-2xl font-mono text-white">{value}</div>
{sub && <div className="mt-1 text-xs text-white/40">{sub}</div>}
</div>
)
}
export function StatCards({ s }: { s: Summary }) {
const fmt = (n: number) => n.toLocaleString()
return (
<div className="grid grid-cols-1 gap-3 md:grid-cols-4">
<Card label="Requests 7d" value={fmt(s.requests_7d)}
sub={<Sparkline values={s.daily_requests.map(d => d.count)} />} />
<Card label="Active users 7d" value={fmt(s.active_users_7d)} />
<Card label="p50 / p95 latency" value={`${s.p50_ms}/${s.p95_ms}ms`} />
<Card label="Renders 7d" value={fmt(s.renders_7d)} sub={`avg ${s.avg_render_ms}ms`} />
</div>
)
}
@@ -0,0 +1,81 @@
import { useEffect, useMemo, useState } from 'react'
import { fetchUsers, type UserRow } from '../lib/dev'
function timeAgo(ts: number | null): string {
if (!ts) return '—'
const s = Math.max(0, Math.floor(Date.now() / 1000 - ts))
if (s < 60) return `${s}s ago`
if (s < 3600) return `${Math.floor(s / 60)}m ago`
if (s < 86400) return `${Math.floor(s / 3600)}h ago`
return `${Math.floor(s / 86400)}d ago`
}
export function UsersTable() {
const [q, setQ] = useState('')
const [sort, setSort] = useState<'requests' | 'latency' | 'last_seen'>('requests')
const [rows, setRows] = useState<UserRow[]>([])
const [loading, setLoading] = useState(true)
useEffect(() => {
let alive = true
const h = window.setTimeout(() => {
setLoading(true)
fetchUsers(q, sort).then(r => { if (alive) { setRows(r); setLoading(false) } })
.catch(() => { if (alive) setLoading(false) })
}, 200)
return () => { alive = false; window.clearTimeout(h) }
}, [q, sort])
const sorted = useMemo(() => rows, [rows])
return (
<div className="rounded-lg border border-white/10 bg-white/[0.02]">
<div className="flex items-center justify-between border-b border-white/10 px-4 py-2">
<div className="text-sm text-white/70">Users</div>
<div className="flex gap-2">
<select value={sort} onChange={e => setSort(e.target.value as 'requests' | 'latency' | 'last_seen')}
className="rounded bg-white/[0.04] px-2 py-1 text-xs text-white/80">
<option value="requests">requests</option>
<option value="latency">latency</option>
<option value="last_seen">last seen</option>
</select>
<input value={q} onChange={e => setQ(e.target.value)} placeholder="search…"
className="rounded bg-white/[0.04] px-2 py-1 text-xs text-white/80 placeholder:text-white/30" />
</div>
</div>
<table className="w-full text-left text-sm">
<thead className="text-xs uppercase text-white/40">
<tr>
<th className="px-4 py-2 font-normal">User</th>
<th className="px-4 py-2 font-normal">Req 7d</th>
<th className="px-4 py-2 font-normal">Last seen</th>
<th className="px-4 py-2 font-normal">Top endpoint</th>
<th className="px-4 py-2 text-right font-normal">Avg ms</th>
</tr>
</thead>
<tbody>
{loading && <tr><td colSpan={5} className="px-4 py-6 text-center text-white/40">loading…</td></tr>}
{!loading && sorted.length === 0 && (
<tr><td colSpan={5} className="px-4 py-6 text-center text-white/40">no users yet</td></tr>
)}
{sorted.map(u => (
<tr key={u.username} className="border-t border-white/5">
<td className="px-4 py-2 text-white/90">
<div className="flex items-center gap-2">
{u.github_avatar_url
? <img src={u.github_avatar_url} alt="" className="h-5 w-5 rounded-full" />
: <span className="inline-block h-5 w-5 rounded-full bg-white/10" />}
<span className="font-mono">{u.username}</span>
</div>
</td>
<td className="px-4 py-2 font-mono text-white/80">{u.requests_7d.toLocaleString()}</td>
<td className="px-4 py-2 text-white/60">{timeAgo(u.last_seen)}</td>
<td className="px-4 py-2 font-mono text-white/60">{u.top_endpoint || '—'}</td>
<td className="px-4 py-2 text-right font-mono text-white/80">{u.avg_latency_ms}</td>
</tr>
))}
</tbody>
</table>
</div>
)
}
+36
View File
@@ -0,0 +1,36 @@
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap');
@import "tailwindcss";
@theme {
--font-sans: 'DM Sans', system-ui, sans-serif;
--font-serif: 'Instrument Serif', Georgia, serif;
--font-mono: 'JetBrains Mono', monospace;
}
::-webkit-scrollbar { display: none; }
* { -ms-overflow-style: none; scrollbar-width: none; }
body {
margin: 0;
font-family: 'DM Sans', system-ui, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@keyframes fade-in-up {
from { opacity: 0; transform: translateY(16px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
animation: fade-in-up 0.5s ease-out both;
}
@keyframes spin-slow {
to { transform: rotate(360deg); }
}
.animate-spin-slow {
animation: spin-slow 1s linear infinite;
}
+20
View File
@@ -0,0 +1,20 @@
export type Me = { login: string | null; avatar_url?: string }
export async function fetchMe(): Promise<Me> {
const r = await fetch('/api/auth/me', { credentials: 'include' })
if (!r.ok) return { login: null }
return r.json() as Promise<Me>
}
export function signInUrl(next?: string): string {
const n = next ?? (window.location.pathname + window.location.search)
return `/api/auth/github/login?next=${encodeURIComponent(n)}`
}
export async function signOut(): Promise<void> {
await fetch('/api/auth/logout', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
})
}
+47
View File
@@ -0,0 +1,47 @@
import type { WidgetData } from './renderWidgets'
// Used to show a fully-populated Workshop preview instantly while the real
// data is building asynchronously on the server. Swapped out when the
// /data endpoint returns status=ready.
export const DEMO_WIDGET_DATA: WidgetData = {
grade: {
grade: 'A',
score: 78,
stats: { commits: 842, prs: 47, stars: 156, repos: 28, followers: 92 },
tags: [
{ tag: 'backend', source: 'earned', confidence: 0.7 },
{ tag: 'frontend', source: 'earned', confidence: 0.55 },
{ tag: 'devops', source: 'earned', confidence: 0.3 },
],
breakdown: {},
},
impact: Array.from({ length: 24 }, (_, i) => ({
week_start: new Date(Date.now() - (23 - i) * 7 * 86400000).toISOString().slice(0, 10),
commits: Math.max(0, Math.round(14 + Math.sin(i * 0.5) * 9 + (i % 3) * 2)),
})),
collaborators: [
{ username: 'alex', shared_repos: 4, shared_commits: 87 },
{ username: 'jordan', shared_repos: 2, shared_commits: 54 },
{ username: 'sam', shared_repos: 3, shared_commits: 31 },
],
focus: [
{ category: 'Backend', percentage: 45, commit_count: 379 },
{ category: 'Frontend', percentage: 30, commit_count: 252 },
{ category: 'DevOps', percentage: 15, commit_count: 126 },
{ category: 'ML', percentage: 10, commit_count: 84 },
],
languages: [
{ language: 'Python', percentage: 42, loc: 12 },
{ language: 'TypeScript', percentage: 28, loc: 8 },
{ language: 'Go', percentage: 18, loc: 5 },
{ language: 'Rust', percentage: 12, loc: 3 },
],
streaks: {
current: 12,
max: 47,
current_start: new Date(Date.now() - 11 * 86400000).toISOString().slice(0, 10),
last_active_date: new Date().toISOString().slice(0, 10),
max_start: '2024-09-04',
max_end: '2024-10-20',
},
}
+57
View File
@@ -0,0 +1,57 @@
// Read helpers for the /dev dashboard. All four endpoints require a
// Basic-auth session that the browser establishes via the WWW-Authenticate
// challenge the first time the SPA hits /api/dev/summary.
export type Summary = {
requests_7d: number
active_users_7d: number
p50_ms: number
p95_ms: number
renders_7d: number
avg_render_ms: number
daily_requests: { day: string; count: number }[]
}
export type UserRow = {
username: string
requests_7d: number
last_seen: number | null
avg_latency_ms: number
top_endpoint: string
github_avatar_url: string | null
}
export type LatencyRow = {
endpoint: string
count: number
p50: number
p95: number
p99: number
}
export type Health = {
edge_cache_hit_rate: number
fetcher_error_rate: number
events_dropped_24h: number
oldest_event_ts: number | null
}
export type Growth = {
daily: { day: string; users: number; requests: number }[]
weekly: { week: string; users: number; requests: number }[]
}
async function getJSON<T>(path: string): Promise<T> {
const r = await fetch(path, { credentials: 'include' })
if (r.status === 401) throw new Error('unauthorized')
if (r.status === 503) throw new Error('dashboard_disabled')
if (!r.ok) throw new Error(`HTTP ${r.status}`)
return (await r.json()) as T
}
export const fetchSummary = () => getJSON<Summary>('/api/dev/summary')
export const fetchUsers = (q = '', sort = 'requests') =>
getJSON<UserRow[]>(`/api/dev/users?q=${encodeURIComponent(q)}&sort=${sort}`)
export const fetchLatency = () => getJSON<LatencyRow[]>('/api/dev/latency')
export const fetchHealth = () => getJSON<Health>('/api/dev/health')
export const fetchGrowth = () => getJSON<Growth>('/api/dev/growth')
+471
View File
@@ -0,0 +1,471 @@
import { THEMES, TAG_COLORS, GRADE_COLORS, FOCUS_COLORS, LANG_COLORS, type Theme } from './themes'
// --- Types matching the API `format=data` response ---
export type GradeData = {
grade: string; score: number
stats: Record<string, number>
tags: { tag: string; source: string; confidence: number; label?: string | null }[]
breakdown: Record<string, number>
}
export type ImpactWeek = { week_start: string; commits: number }
export type CollaboratorData = { username: string; shared_repos: number; shared_commits: number }
export type FocusCategory = { category: string; percentage: number; commit_count: number }
export type LanguageData = { language: string; percentage: number; loc: number }
export type AchievementInput = { title: string; subtitle: string; event_date: string; icon: string }
export type StreakData = {
current: number; max: number
current_start?: string; last_active_date?: string
max_start?: string; max_end?: string
}
export type WidgetData = {
grade?: GradeData
impact?: ImpactWeek[]
collaborators?: CollaboratorData[]
focus?: FocusCategory[]
languages?: LanguageData[]
streaks?: StreakData
}
export type PerWidgetSettings = {
grade?: { max_tags?: number }
impact?: { line_color?: string }
streaks?: { color?: string }
collaborators?: { max_count?: number; bar_color?: string }
focus?: { max_categories?: number }
languages?: { max_languages?: number }
achievements?: { max_items?: number }
}
// --- Helpers ---
const esc = (s: string) => s.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;')
const font = '-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif'
const TAG_ACRONYMS = new Set(['ml','ai','ui','ux','api','cli','sql','css','html','js','ios'])
function formatTagLabel(tag: string): string {
return tag.split('-')
.map(w => TAG_ACRONYMS.has(w.toLowerCase())
? w.toUpperCase()
: w.charAt(0).toUpperCase() + w.slice(1))
.join(' ')
}
function cardWrapper(inner: string, w: number, h: number, t: Theme, title: string, prefix = '') {
const sid = `${prefix}shadow`
return `<svg xmlns="http://www.w3.org/2000/svg" width="${w}" height="${h}" viewBox="0 0 ${w} ${h}" fill="none">
<defs><filter id="${sid}" x="-2%" y="-2%" width="104%" height="104%"><feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#000" flood-opacity="0.15"/></filter></defs>
<rect x="1" y="1" width="${w-2}" height="${h-2}" rx="10" ry="10" fill="${t.card_bg}" stroke="${t.card_border}" stroke-width="1" filter="url(#${sid})"/>
${title ? `<text x="20" y="30" font-family="${font}" font-size="11" font-weight="600" fill="${t.text_secondary}" letter-spacing="0.8" opacity="0.7">${esc(title.toUpperCase())}</text>` : ''}
<g transform="translate(0, ${title ? 36 : 0})">${inner}</g>
</svg>`
}
function iconSvg(kind: string, color: string): string {
const icons: Record<string, string> = {
commits: `<circle cx="7" cy="7" r="3" fill="none" stroke="${color}" stroke-width="1.4"/><circle cx="7" cy="7" r="1" fill="${color}"/><line x1="7" y1="10" x2="7" y2="14" stroke="${color}" stroke-width="1.4"/><line x1="7" y1="0" x2="7" y2="4" stroke="${color}" stroke-width="1.4"/>`,
prs: `<circle cx="4" cy="4" r="2" fill="none" stroke="${color}" stroke-width="1.2"/><circle cx="10" cy="10" r="2" fill="none" stroke="${color}" stroke-width="1.2"/><path d="M4 6v4c0 1.1.9 2 2 2h2" fill="none" stroke="${color}" stroke-width="1.2"/>`,
stars: `<path d="M7 1l1.8 3.6 4 .6-2.9 2.8.7 4L7 10.2 3.4 12l.7-4L1.2 5.2l4-.6z" fill="none" stroke="${color}" stroke-width="1.2" stroke-linejoin="round"/>`,
repos: `<rect x="2" y="1" width="10" height="12" rx="1.5" fill="none" stroke="${color}" stroke-width="1.2"/><line x1="5" y1="4" x2="9" y2="4" stroke="${color}" stroke-width="1"/><line x1="5" y1="6.5" x2="9" y2="6.5" stroke="${color}" stroke-width="1"/><line x1="5" y1="9" x2="7" y2="9" stroke="${color}" stroke-width="1"/>`,
followers: `<circle cx="5" cy="4" r="2.5" fill="none" stroke="${color}" stroke-width="1.2"/><path d="M0.5 12c0-2.5 2-4 4.5-4s4.5 1.5 4.5 4" fill="none" stroke="${color}" stroke-width="1.2"/><circle cx="11" cy="3.5" r="1.8" fill="none" stroke="${color}" stroke-width="1"/><path d="M10 7.5c1.5 0 3.5 1 3.5 3" fill="none" stroke="${color}" stroke-width="1"/>`,
}
return `<g>${icons[kind] ?? ''}</g>`
}
// --- Widget renderers ---
function renderGrade(data: GradeData, t: Theme, s?: { max_tags?: number }): string {
const tags = s?.max_tags ? data.tags.slice(0, s.max_tags) : data.tags
const base = data.grade[0]
const color = GRADE_COLORS[base] ?? t.accent
const radius = 36
const circ = 2 * Math.PI * radius
const offset = circ * (1 - data.score / 100)
const gf = data.grade.length <= 2 ? 30 : 22
const statLabels: Record<string, string> = { commits:'Commits', prs:'PRs', stars:'Stars', repos:'Repos', followers:'Followers' }
const statKeys = ['commits','prs','stars','repos','followers'].filter(k => k in data.stats)
const sw = 340 / Math.max(statKeys.length, 1)
let statsSvg = ''
for (let i = 0; i < statKeys.length; i++) {
const k = statKeys[i], v = data.stats[k]
const sx = i * sw + sw / 2
const vs = v < 100000 ? v.toLocaleString() : `${Math.round(v/1000)}k`
statsSvg += `<g transform="translate(${sx}, 0)"><g transform="translate(-7, 0)">${iconSvg(k, t.text_secondary)}</g><text x="0" y="28" text-anchor="middle" font-family="${font}" font-size="14" font-weight="700" fill="${t.text}">${vs}</text><text x="0" y="41" text-anchor="middle" font-family="${font}" font-size="9" fill="${t.text_secondary}">${statLabels[k]??k}</text></g>`
}
let tagsSvg = '', tx = 0, ty = 0
for (const tag of tags) {
const tc = TAG_COLORS[tag.tag] ?? t.accent
const label = tag.label || formatTagLabel(tag.tag)
const tw = Math.round(label.length * 6.6 + 18)
const po = tag.source === 'earned' ? 0.9 : 0.55
if (tx + tw > 340) { tx = 0; ty += 30 }
tagsSvg += `<g transform="translate(${tx}, ${ty})" opacity="${po}"><rect width="${tw}" height="24" rx="12" fill="${tc}" opacity="0.12"/><rect width="${tw}" height="24" rx="12" fill="none" stroke="${tc}" stroke-width="1" opacity="0.3"/><text x="${Math.round(tw/2)}" y="16" text-anchor="middle" font-family="${font}" font-size="10" font-weight="500" fill="${tc}">${esc(label)}</text></g>`
tx += tw + 6
}
const tagsH = tags.length ? ty + 24 : 0
const statsY = 100, tagsY = statsY + 54
const tagPad = tagsH > 24 ? 18 : 14
const cardH = tags.length ? tagsY + tagsH + tagPad : statsY + 54
const breakdownLabels: Record<string, string> = {
commits: 'Commits', consistency: 'Consistency', repos: 'Repos',
stars: 'Stars', forks: 'Forks', activity: 'Activity', followers: 'Followers',
}
const topStrengths = Object.entries(data.breakdown || {})
.sort((a, b) => b[1] - a[1])
.slice(0, 2)
.map(([k]) => breakdownLabels[k] ?? k.charAt(0).toUpperCase() + k.slice(1))
const strengthsLine = topStrengths.length ? `Strong in ${topStrengths.join(' · ')}` : ''
let inner = `<g transform="translate(52, 48)"><circle cx="0" cy="0" r="${radius}" fill="none" stroke="${t.grid}" stroke-width="5"/><circle cx="0" cy="0" r="${radius}" fill="none" stroke="${color}" stroke-width="5" stroke-dasharray="${circ.toFixed(1)}" stroke-dashoffset="${offset.toFixed(1)}" stroke-linecap="round" transform="rotate(-90)"/><text x="0" y="${(gf * 0.35).toFixed(2)}" text-anchor="middle" font-family="${font}" font-size="${gf}" font-weight="800" fill="${color}">${esc(data.grade)}</text></g>
<line x1="100" y1="16" x2="100" y2="80" stroke="${t.grid}" stroke-width="1"/>
<g transform="translate(114, 26)"><text x="0" y="10" font-family="${font}" font-size="16" font-weight="700" fill="${t.text}">Developer Profile</text><text x="0" y="32" font-family="${font}" font-size="11" fill="${t.text_secondary}">${esc(strengthsLine)}</text><text x="0" y="50" font-family="${font}" font-size="10" letter-spacing="0.4" fill="${t.text_secondary}">Score <tspan fill="${t.text}" font-weight="600">${data.score.toFixed(0)}</tspan> / 100</text></g>
<line x1="20" y1="${statsY-4}" x2="360" y2="${statsY-4}" stroke="${t.grid}" stroke-width="0.5"/>
<g transform="translate(20, ${statsY})">${statsSvg}</g>`
if (tags.length) {
inner += `<line x1="20" y1="${tagsY-6}" x2="360" y2="${tagsY-6}" stroke="${t.grid}" stroke-width="0.5"/><g transform="translate(20, ${tagsY})">${tagsSvg}</g>`
}
return cardWrapper(inner, 380, cardH, t, '')
}
function renderImpact(weeks: ImpactWeek[], t: Theme, s?: { line_color?: string }): string {
const w = 380, h = 200, cx = 40, cy = 8, cw = 316, ch = 82
const lineColor = s?.line_color ?? t.accent
if (!weeks.length) {
const inner = `<line x1="${cx}" y1="${cy+ch}" x2="${cx+cw}" y2="${cy+ch}" stroke="${t.grid}" stroke-width="0.5"/>
<text x="${cx+cw/2}" y="${cy+ch/2+4}" text-anchor="middle" font-family="${font}" font-size="11" fill="${t.text_secondary}">No contribution data yet</text>
<g transform="translate(20, ${cy+ch+46})"><text x="0" y="0" font-family="${font}" font-size="13" font-weight="700" fill="${t.text}">0</text><text x="0" y="14" font-family="${font}" font-size="9" fill="${t.text_secondary}">commits over 6mo</text></g>`
return cardWrapper(inner, w, h, t, 'Impact Timeline')
}
const maxC = Math.max(...weeks.map(w => w.commits), 1)
const n = weeks.length
const pts = weeks.map((wk, i) => ({
x: cx + (i / Math.max(n-1, 1)) * cw,
y: cy + ch - (wk.commits / maxC) * ch,
}))
let pathD = `M ${pts[0].x.toFixed(1)} ${pts[0].y.toFixed(1)}`
for (let i = 1; i < pts.length; i++) {
const mx = (pts[i-1].x + pts[i].x) / 2
pathD += ` C ${mx.toFixed(1)} ${pts[i-1].y.toFixed(1)}, ${mx.toFixed(1)} ${pts[i].y.toFixed(1)}, ${pts[i].x.toFixed(1)} ${pts[i].y.toFixed(1)}`
}
const areaD = pathD + ` L ${pts[n-1].x.toFixed(1)} ${cy+ch} L ${pts[0].x.toFixed(1)} ${cy+ch} Z`
let yLabels = ''
for (let i = 0; i < 3; i++) {
const v = Math.round(maxC * (1 - i/2))
const yy = cy + (i/2) * ch
yLabels += `<text x="${cx-6}" y="${yy+4}" text-anchor="end" font-family="${font}" font-size="9" fill="${t.text_secondary}">${v}</text><line x1="${cx}" y1="${yy}" x2="${cx+cw}" y2="${yy}" stroke="${t.grid}" stroke-width="0.5" stroke-dasharray="3,3"/>`
}
let xLabels = ''
const li = n > 2 ? [0, Math.floor(n/2), n-1] : Array.from({length: n}, (_, i) => i)
for (const idx of li) {
if (idx < weeks.length) {
const px = cx + (idx / Math.max(n-1,1)) * cw
xLabels += `<text x="${px.toFixed(1)}" y="${cy+ch+14}" text-anchor="middle" font-family="${font}" font-size="9" fill="${t.text_secondary}">${weeks[idx].week_start.slice(0,7)}</text>`
}
}
const total = weeks.reduce((a, w) => a + w.commits, 0)
const sy = cy + ch + 46
const inner = `<defs><linearGradient id="areaGrad" x1="0" y1="${cy}" x2="0" y2="${cy+ch}" gradientUnits="userSpaceOnUse"><stop offset="0%" stop-color="${lineColor}" stop-opacity="0.35"/><stop offset="100%" stop-color="${lineColor}" stop-opacity="0.02"/></linearGradient></defs>
${yLabels}${xLabels}
<path d="${areaD}" fill="url(#areaGrad)"/>
<path d="${pathD}" fill="none" stroke="${lineColor}" stroke-width="2" stroke-linecap="round"/>
<g transform="translate(20, ${sy})"><text x="0" y="0" font-family="${font}" font-size="13" font-weight="700" fill="${t.text}">${total.toLocaleString()}</text><text x="0" y="14" font-family="${font}" font-size="9" fill="${t.text_secondary}">commits over 6mo</text></g>`
return cardWrapper(inner, w, h, t, 'Impact Timeline')
}
function renderCollaborators(collabs: CollaboratorData[], t: Theme, s?: { max_count?: number; bar_color?: string }): string {
const maxCount = Math.min(Math.max(s?.max_count ?? 5, 1), 10)
const barColor = s?.bar_color ?? t.purple
const shown = collabs.slice(0, maxCount)
const barMax = Math.max(...shown.map(c => c.shared_commits), 1)
let items = ''
for (let i = 0; i < shown.length; i++) {
const c = shown[i], y = i * 50
const hue = [...c.username].reduce((h, ch) => h + ch.charCodeAt(0), 0) % 360
const avatar = `<circle cx="0" cy="0" r="18" fill="hsl(${hue}, 50%, 40%)"/><text x="0" y="1" text-anchor="middle" dominant-baseline="middle" font-family="${font}" font-size="14" font-weight="600" fill="white">${esc(c.username[0].toUpperCase())}</text>`
const bw = (c.shared_commits / barMax * 120).toFixed(1)
items += `<g transform="translate(36, ${y+20})">${avatar}<text x="28" y="-2" font-family="${font}" font-size="13" font-weight="600" fill="${t.text}">${esc(c.username)}</text><text x="28" y="14" font-family="${font}" font-size="10" fill="${t.text_secondary}">${c.shared_repos} repos · ${c.shared_commits} commits</text><rect x="200" y="-6" width="130" height="8" rx="4" fill="${t.grid}"/><rect x="200" y="-6" width="${bw}" height="8" rx="4" fill="${barColor}" opacity="0.8"/></g>`
}
return cardWrapper(items, 380, shown.length * 50 + 48, t, 'Top Collaborators')
}
function renderFocus(cats: FocusCategory[], t: Theme, s?: { max_categories?: number }): string {
const maxCats = Math.min(Math.max(s?.max_categories ?? 6, 1), 10)
const sorted = [...cats].sort((a, b) => b.percentage - a.percentage).slice(0, maxCats)
if (!sorted.length) return ''
const maxPct = Math.max(sorted[0].percentage, 1)
const barMaxW = 210
let items = ''
for (let i = 0; i < sorted.length; i++) {
const cat = sorted[i], y = i * 36
const color = FOCUS_COLORS[i % FOCUS_COLORS.length]
const bw = (cat.percentage / maxPct * barMaxW).toFixed(1)
items += `<g transform="translate(16, ${y})"><text x="0" y="14" font-family="${font}" font-size="12" font-weight="600" fill="${t.text}">${esc(cat.category)}</text><rect x="90" y="4" width="${barMaxW}" height="14" rx="7" fill="${t.grid}"/><rect x="90" y="4" width="${bw}" height="14" rx="7" fill="${color}" opacity="0.8"/><text x="90" y="32" font-family="${font}" font-size="9" fill="${t.text_secondary}">${cat.commit_count} commits</text><text x="${90+barMaxW+8}" y="15" font-family="${font}" font-size="12" font-weight="700" fill="${color}">${Math.round(cat.percentage)}%</text></g>`
}
const subY = sorted.length * 36 + 8
items += `<text x="16" y="${subY}" font-family="${font}" font-size="9" fill="${t.text_secondary}" opacity="0.7">Recent activity · last year</text>`
return cardWrapper(items, 380, sorted.length * 36 + 54, t, 'Recent Focus')
}
function renderLanguages(languages: LanguageData[], t: Theme, s?: { max_languages?: number }): string {
const maxLangs = Math.min(Math.max(s?.max_languages ?? 5, 1), 10)
const topLangs = [...languages].sort((a, b) => b.percentage - a.percentage).slice(0, maxLangs)
if (!topLangs.length) return ''
const totalPct = topLangs.reduce((a, l) => a + l.percentage, 0)
const langs = [...topLangs]
if (totalPct < 99.9 && languages.length > maxLangs) {
langs.push({ language: 'Other', percentage: Math.round((100 - totalPct) * 10) / 10, loc: 0 })
} else if (totalPct < 99.9 && totalPct > 0) {
const f = 100 / totalPct
for (const l of langs) l.percentage = Math.round(l.percentage * f * 10) / 10
}
const legendStart = 20, legendH = langs.length * 22
const ccy = legendStart + legendH / 2, ccx = 60, r = 44, innerR = 28
const circ = 2 * Math.PI * r
let arcs = '', legend = '', offset = 0
for (let i = 0; i < langs.length; i++) {
const lang = langs[i]
const color = lang.language === 'Other' ? t.text_secondary : (LANG_COLORS[lang.language] ?? FOCUS_COLORS[i % FOCUS_COLORS.length])
const dash = circ * lang.percentage / 100
const gap = circ - dash
arcs += `<circle cx="${ccx}" cy="${ccy}" r="${r}" fill="none" stroke="${color}" stroke-width="16" stroke-dasharray="${dash.toFixed(1)} ${gap.toFixed(1)}" stroke-dashoffset="${(-offset).toFixed(1)}" transform="rotate(-90 ${ccx} ${ccy})" opacity="0.85"/>`
offset += dash
const ly = i * 22
legend += `<g transform="translate(140, ${ly + legendStart})"><rect width="10" height="10" rx="2" fill="${color}"/><text x="16" y="9" font-family="${font}" font-size="12" fill="${t.text}">${esc(lang.language)}</text><text x="210" y="9" text-anchor="end" font-family="${font}" font-size="11" font-weight="600" fill="${t.text_secondary}">${Math.round(lang.percentage)}%</text></g>`
}
const center = `<circle cx="${ccx}" cy="${ccy}" r="${innerR}" fill="${t.card_bg}"/><text x="${ccx}" y="${ccy+1}" text-anchor="middle" dominant-baseline="middle" font-family="${font}" font-size="11" font-weight="700" fill="${t.text}">${esc(langs[0].language)}</text>`
const inner = `<g transform="translate(16, 0)">${arcs}${center}${legend}</g>`
const rowsH = Math.max(langs.length * 22 + 40, 120)
return cardWrapper(inner, 380, rowsH + 36, t, 'Languages')
}
const STREAK_MONTHS = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
const STREAK_COLOR_RE = /^#[0-9a-fA-F]{3,8}$/
function streaksSafeColor(value: string | undefined, fallback: string): string {
if (typeof value !== 'string' || value.length > 32) return fallback
return STREAK_COLOR_RE.test(value) ? value : fallback
}
function streakParseDate(iso?: string): { y: number; m: number; d: number } | null {
if (!iso) return null
const m = /^(\d{4})-(\d{2})-(\d{2})$/.exec(iso)
if (!m) return null
const y = Number(m[1]), mo = Number(m[2]), d = Number(m[3])
if (!y || mo < 1 || mo > 12 || d < 1 || d > 31) return null
return { y, m: mo, d }
}
function streakFmtDay(dt: { y: number; m: number; d: number }, includeYear: boolean): string {
return includeYear ? `${STREAK_MONTHS[dt.m-1]} ${dt.d}, ${dt.y}` : `${STREAK_MONTHS[dt.m-1]} ${dt.d}`
}
function fmtStreakCurrent(startIso?: string, todayIso?: string): string {
const s = streakParseDate(startIso); if (!s) return ''
const t = streakParseDate(todayIso) ?? { y: new Date().getFullYear(), m: 1, d: 1 }
return `${streakFmtDay(s, s.y !== t.y)} – Today`
}
function fmtStreakLongest(startIso?: string, endIso?: string): string {
const s = streakParseDate(startIso), e = streakParseDate(endIso)
if (s && e) {
if (s.y === e.y) return `${streakFmtDay(s, false)} – ${streakFmtDay(e, true)}`
return `${streakFmtDay(s, true)} – ${streakFmtDay(e, true)}`
}
if (e) return streakFmtDay(e, true)
if (s) return streakFmtDay(s, true)
return ''
}
function renderStreaks(data: StreakData, t: Theme, s?: { color?: string }): string {
const width = 380, height = 170
const currentColor = streaksSafeColor(s?.color, t.accent)
const maxColor = t.text
const leftX = 105, rightX = 275, dividerX = 190
const barX = 50, barW = 280
const fraction = data.max > 0 ? Math.max(0, Math.min(1, data.current / data.max)) : 0
const fillW = +(barW * fraction).toFixed(2)
const currentCaption = data.current > 0
? fmtStreakCurrent(data.current_start, data.last_active_date)
: ''
const longestCaption = fmtStreakLongest(data.max_start, data.max_end)
const endDot = fillW > 0
? `<circle cx="${(barX + fillW).toFixed(2)}" cy="94.5" r="3.5" fill="${currentColor}"/>`
: ''
const inner = `
<text x="${leftX}" y="22" text-anchor="middle" font-family="${font}" font-size="10" font-weight="600" letter-spacing="1.4" fill="${t.text_secondary}">CURRENT</text>
<text x="${leftX}" y="66" text-anchor="middle" font-family="${font}" font-size="40" font-weight="800" fill="${currentColor}">${data.current}</text>
<text x="${rightX}" y="22" text-anchor="middle" font-family="${font}" font-size="10" font-weight="600" letter-spacing="1.4" fill="${t.text_secondary}">LONGEST</text>
<text x="${rightX}" y="66" text-anchor="middle" font-family="${font}" font-size="40" font-weight="800" fill="${maxColor}">${data.max}</text>
<line x1="${dividerX}" y1="10" x2="${dividerX}" y2="76" stroke="${t.card_border}" stroke-width="1"/>
<rect x="${barX}" y="92" width="${barW}" height="5" rx="2.5" fill="${t.grid}"/>
<rect x="${barX}" y="92" width="${fillW}" height="5" rx="2.5" fill="${currentColor}"/>
${endDot}
<text x="${barX}" y="116" font-family="${font}" font-size="10" fill="${t.text_secondary}">${esc(currentCaption)}</text>
<text x="${barX + barW}" y="116" text-anchor="end" font-family="${font}" font-size="10" fill="${t.text_secondary}">${esc(longestCaption)}</text>`
return cardWrapper(inner, width, height, t, 'Streaks')
}
function achievementIconSvg(iconType: string, color: string): string {
// Mirrors generator/src/widgets/achievements.py::_achievement_icon_svg so
// the Workshop client preview matches the backend-rendered composite.
const icons: Record<string, string> = {
trophy: `<svg viewBox="0 0 24 24" width="24" height="24"><path d="M7 2h10v2h2.5c.8 0 1.5.7 1.5 1.5V8c0 1.7-1.3 3-3 3h-.5c-.5 1.5-1.8 2.7-3.5 3v2.5h3c.6 0 1 .4 1 1s-.4 1-1 1H7c-.6 0-1-.4-1-1s.4-1 1-1h3V14c-1.7-.3-3-1.5-3.5-3H6c-1.7 0-3-1.3-3-3V5.5C3 4.7 3.7 4 4.5 4H7V2zm0 4H4.5v2c0 .8.7 1.5 1.5 1.5h1V6zm12.5 0H17v3.5h1c.8 0 1.5-.7 1.5-1.5V6z" fill="${color}" opacity="0.85"/></svg>`,
medal: `<svg viewBox="0 0 24 24" width="24" height="24"><circle cx="12" cy="14" r="5" fill="${color}" opacity="0.2"/><circle cx="12" cy="14" r="4" fill="none" stroke="${color}" stroke-width="1.5"/><path d="M12 11.5l1 2 2.2.3-1.6 1.5.4 2.2-2-1-2 1 .4-2.2-1.6-1.5 2.2-.3z" fill="${color}"/><path d="M9 3l3 8m0-8l3 8m-6-8h6" stroke="${color}" stroke-width="1.5" fill="none" stroke-linecap="round"/></svg>`,
star: `<svg viewBox="0 0 24 24" width="24" height="24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" fill="none" stroke="${color}" stroke-width="1.5" stroke-linejoin="round"/></svg>`,
hackathon: `<svg viewBox="0 0 24 24" width="24" height="24"><rect x="4" y="5" width="16" height="11" rx="1" fill="none" stroke="${color}" stroke-width="1.5"/><rect x="3" y="16" width="18" height="1.5" rx="0.5" fill="${color}" opacity="0.85"/><path d="M9 9l-2 3 2 3m6-6l2 3-2 3" stroke="${color}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>`,
}
return icons[iconType] ?? icons.trophy
}
function renderAchievements(achievements: AchievementInput[], t: Theme, s?: { max_items?: number }): string {
const maxItems = Math.min(Math.max(s?.max_items ?? 5, 1), 10)
const shown = achievements.filter(a => a.title.trim()).slice(0, maxItems)
if (!shown.length) return ''
const accentColors = [t.orange, t.green, t.accent, t.purple, t.pink]
let items = ''
for (let i = 0; i < shown.length; i++) {
const ach = shown[i], y = i * 56
const color = accentColors[i % accentColors.length]
const icon = achievementIconSvg(ach.icon, color)
items += `<g transform="translate(16, ${y+8})"><rect width="348" height="48" rx="8" fill="${color}" opacity="0.06"/><rect width="348" height="48" rx="8" fill="none" stroke="${color}" stroke-width="0.5" opacity="0.3"/><g transform="translate(12, 12)">${icon}</g><text x="48" y="20" font-family="${font}" font-size="13" font-weight="600" fill="${t.text}">${esc(ach.title)}</text><text x="48" y="36" font-family="${font}" font-size="10" fill="${t.text_secondary}">${esc(ach.subtitle)}${ach.event_date ? ' · ' + ach.event_date : ''}</text></g>`
}
return cardWrapper(items, 380, shown.length * 56 + 50, t, 'Achievements')
}
// --- Composite ---
function extractInner(svg: string, key: string): { inner: string; h: number } {
const hm = svg.match(/height="(\d+)"/)
const h = hm ? parseInt(hm[1]) : 160
// Prefix IDs
const ids = [...svg.matchAll(/id="([^"]+)"/g)].map(m => m[1])
let inner = svg
for (const id of ids) {
const nid = `${key}_${id}`
inner = inner.replaceAll(`id="${id}"`, `id="${nid}"`)
inner = inner.replaceAll(`url(#${id})`, `url(#${nid})`)
inner = inner.replaceAll(`href="#${id}"`, `href="#${nid}"`)
}
inner = inner.replace(/<svg[^>]*>/, '').replace(/<\/svg>\s*$/, '')
return { inner, h }
}
// --- Main export ---
export function renderAllWidgets(opts: {
data: WidgetData
theme: string
widgets: string[]
widgetOrder: string[]
achievements: AchievementInput[]
widgetSettings: PerWidgetSettings
hiddenLanguages?: string[]
username: string
}): string {
const t = THEMES[opts.theme] ?? THEMES.dark
const enabled = new Set(opts.widgets)
const widgetSvgs: Record<string, string> = {}
if (enabled.has('grade') && opts.data.grade)
widgetSvgs.grade = renderGrade(opts.data.grade, t, opts.widgetSettings.grade)
if (enabled.has('impact') && opts.data.impact)
widgetSvgs.impact = renderImpact(opts.data.impact, t, opts.widgetSettings.impact)
if (enabled.has('streaks') && opts.data.streaks)
widgetSvgs.streaks = renderStreaks(opts.data.streaks, t, opts.widgetSettings.streaks)
if (enabled.has('collaborators') && opts.data.collaborators)
widgetSvgs.collaborators = renderCollaborators(opts.data.collaborators, t, opts.widgetSettings.collaborators)
if (enabled.has('focus') && opts.data.focus)
widgetSvgs.focus = renderFocus(opts.data.focus, t, opts.widgetSettings.focus)
if (enabled.has('languages') && opts.data.languages) {
// Apply hidden_languages client-side too so the Workshop preview reflects
// the user's choice instantly — backend filtering only kicks in on the
// next prefetch or on POST /generate.
const hiddenSet = new Set(opts.hiddenLanguages ?? [])
const filtered = opts.data.languages.filter(l => !hiddenSet.has(l.language))
const total = filtered.reduce((a, l) => a + l.percentage, 0) || 1
const rescaled = filtered.map(l => ({ ...l, percentage: Math.round(l.percentage / total * 1000) / 10 }))
widgetSvgs.languages = renderLanguages(rescaled, t, opts.widgetSettings.languages)
}
if (enabled.has('achievements'))
widgetSvgs.achievements = renderAchievements(opts.achievements, t, opts.widgetSettings.achievements)
// Compose
const showName = enabled.has('name')
const totalW = 420, headerH = showName ? 60 : 0, padding = 20, gap = 16
// "name" is a pseudo-widget — it controls the header, not a rendered svg.
const ordered = opts.widgetOrder.filter(k => k !== 'name' && enabled.has(k) && widgetSvgs[k])
const parts = ordered.map(key => {
const { inner, h } = extractInner(widgetSvgs[key], key)
return { key, inner, h }
})
const contentH = parts.reduce((a, p) => a + p.h, 0) + gap * Math.max(parts.length - 1, 0)
const totalH = headerH + contentH + padding * 2 + 10
// Header (avatar + username). Only drawn when "name" is enabled. The
// avatar pulls from github.com/<user>.png which redirects to
// avatars.githubusercontent.com; the accent circle underneath is a
// fallback for missing users / slow loads.
let header = ''
if (showName) {
const avatarUrl = opts.username
? `https://github.com/${encodeURIComponent(opts.username)}.png?size=64`
: ''
const avatarImg = avatarUrl
? `<image x="14" y="14" width="32" height="32" href="${esc(avatarUrl)}" clip-path="url(#mainAvatarClip)" preserveAspectRatio="xMidYMid slice"/>`
: ''
const avatar = `<defs><clipPath id="mainAvatarClip"><circle cx="30" cy="30" r="16"/></clipPath></defs><circle cx="30" cy="30" r="16" fill="${t.accent}" opacity="0.3"/>${avatarImg}`
header = `${avatar}<text x="54" y="38" font-family="${font}" font-size="16" font-weight="700" fill="${t.text}">${esc(opts.username || 'Developer')}</text><line x1="${padding}" y1="${headerH}" x2="${totalW-padding}" y2="${headerH}" stroke="${t.card_border}" stroke-width="0.5"/>`
}
let yOffset = headerH + padding
let embedded = ''
for (const { inner, h } of parts) {
embedded += `<svg x="${padding}" y="${yOffset}" width="380" height="${h}" viewBox="0 0 380 ${h}">${inner}</svg>`
yOffset += h + gap
}
return `<svg xmlns="http://www.w3.org/2000/svg" width="${totalW}" height="${totalH}" viewBox="0 0 ${totalW} ${totalH}">
<rect width="${totalW}" height="${totalH}" rx="16" fill="${t.bg}"/>
<rect x="0.5" y="0.5" width="${totalW-1}" height="${totalH-1}" rx="16" fill="none" stroke="${t.card_border}" stroke-width="1"/>
${header}${embedded}
<text x="${totalW/2}" y="${totalH-8}" text-anchor="middle" font-family="${font}" font-size="9" fill="${t.text_secondary}" opacity="0.5">Generated with gh-stats.com</text>
</svg>`
}
@@ -0,0 +1,90 @@
// Settings ⇄ query-string encoder for the public widget embed URL.
//
// The backend's `GET /api/<u>?...` accepts the same fields that
// `PATCH /settings` takes, but encoded flat in the query. The encoding is
// designed to stay human-readable for the common cases (theme, widgets,
// order) and fall back to compact base64 only for achievements, which are
// shape-y enough that spelling them out inflates the URL.
//
// Keep this in sync with `sanitize_settings_query` in `generator/src/api.py`.
import type { WidgetSettings, Achievement } from '../App'
// The theme id the backend treats as the default. Omit from the URL so
// the common case stays terse.
const DEFAULT_THEME = 'midnight'
// Standard widget set / order. If the user hasn't deviated, skip emitting
// the param so the embed URL doesn't balloon with boilerplate.
const DEFAULT_WIDGETS = ['name', 'grade', 'impact', 'streaks', 'collaborators', 'focus', 'languages']
const DEFAULT_ORDER = ['name', 'grade', 'impact', 'streaks', 'collaborators', 'focus', 'languages', 'achievements']
function arrayEquals(a: string[], b: string[]): boolean {
if (a.length !== b.length) return false
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false
return true
}
// RFC-4648 url-safe base64 without padding. Matches what Python's
// `base64.urlsafe_b64decode` re-pads in the backend parser.
function urlsafeB64Encode(s: string): string {
const bytes = new TextEncoder().encode(s)
let bin = ''
for (const b of bytes) bin += String.fromCharCode(b)
return btoa(bin).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/g, '')
}
function achievementsParam(achievements: Achievement[]): string | null {
const keepers = achievements.filter(a => (a.title || '').trim())
if (!keepers.length) return null
const payload = keepers.map(a => ({
title: a.title,
subtitle: a.subtitle,
event_date: a.event_date,
icon: a.icon,
}))
return urlsafeB64Encode(JSON.stringify(payload))
}
export function settingsToQuery(settings: WidgetSettings): string {
const params = new URLSearchParams()
if (settings.theme && settings.theme !== DEFAULT_THEME) {
params.set('theme', settings.theme)
}
if (!arrayEquals(settings.widgets, DEFAULT_WIDGETS)) {
params.set('widgets', settings.widgets.join(','))
}
if (!arrayEquals(settings.widgetOrder, DEFAULT_ORDER)) {
params.set('order', settings.widgetOrder.join(','))
}
if (settings.hiddenLanguages.length) {
params.set('hide', settings.hiddenLanguages.join(','))
}
if (settings.customTags.length) {
params.set('tags', settings.customTags.join(','))
}
// Per-widget settings flatten to `<widget>.<key>=<value>`. Any undefined
// or null leaf is skipped so the URL stays minimal.
for (const [widget, ws] of Object.entries(settings.widgetSettings)) {
if (!ws) continue
for (const [key, val] of Object.entries(ws as Record<string, unknown>)) {
if (val === undefined || val === null || val === '') continue
params.set(`${widget}.${key}`, String(val))
}
}
const ach = achievementsParam(settings.achievements)
if (ach) params.set('ach', ach)
// URLSearchParams.toString() percent-encodes values (including the `#` in
// hex colors), so callers can splice the result straight into a URL.
return params.toString()
}
export function buildEmbedUrl(origin: string, username: string, settings: WidgetSettings): string {
const qs = settingsToQuery(settings)
const base = `${origin}/api/${encodeURIComponent(username)}`
return qs ? `${base}?${qs}` : base
}
+37
View File
@@ -0,0 +1,37 @@
export type Theme = {
bg: string; card_bg: string; card_border: string
text: string; text_secondary: string; accent: string
green: string; orange: string; red: string
purple: string; pink: string; grid: string
}
export const THEMES: Record<string, Theme> = {
dark: { bg:"#121820",card_bg:"#1a2230",card_border:"#2a3444",text:"#d1d9e0",text_secondary:"#7d8895",accent:"#58a6ff",green:"#3fb950",orange:"#d29922",red:"#f85149",purple:"#bc8cff",pink:"#f778ba",grid:"#1e2836" },
onyx: { bg:"#09090b",card_bg:"#18181b",card_border:"#27272a",text:"#fafafa",text_secondary:"#a1a1aa",accent:"#a78bfa",green:"#4ade80",orange:"#fb923c",red:"#f87171",purple:"#c084fc",pink:"#f472b6",grid:"#27272a" },
nord: { bg:"#1e2433",card_bg:"#2a3142",card_border:"#3d4659",text:"#e5e9f0",text_secondary:"#8892a4",accent:"#88c0d0",green:"#a3be8c",orange:"#ebcb8b",red:"#bf616a",purple:"#b48ead",pink:"#d08770",grid:"#333d50" },
light: { bg:"#ffffff",card_bg:"#f6f8fa",card_border:"#d8dee4",text:"#24292f",text_secondary:"#656d76",accent:"#0969da",green:"#1a7f37",orange:"#9a6700",red:"#cf222e",purple:"#8250df",pink:"#bf3989",grid:"#eaeef2" },
paper: { bg:"#faf8f5",card_bg:"#f5f0eb",card_border:"#e0d8cf",text:"#3d3529",text_secondary:"#7a7062",accent:"#b45309",green:"#4d7c0f",orange:"#a16207",red:"#b91c1c",purple:"#7e22ce",pink:"#be185d",grid:"#ebe5dd" },
}
THEMES.midnight = THEMES.dark
THEMES.clean = THEMES.light
export const TAG_COLORS: Record<string, string> = {
"ml-engineer":"#bc8cff","frontend":"#58a6ff","backend":"#3fb950","fullstack":"#d29922",
"devops":"#f0883e","database":"#f778ba","mobile":"#ff6b9d","security":"#f85149",
"data-science":"#79c0ff","systems":"#7ee787","cloud":"#58a6ff","open-source":"#3fb950",
}
export const GRADE_COLORS: Record<string, string> = {
S:"#ff6b9d", A:"#3fb950", B:"#58a6ff", C:"#d29922", D:"#f0883e", F:"#f85149",
}
export const FOCUS_COLORS = [
"#58a6ff","#3fb950","#bc8cff","#d29922","#f0883e","#f778ba","#f85149","#79c0ff",
]
export const LANG_COLORS: Record<string, string> = {
Python:"#3572A5",JavaScript:"#f1e05a",TypeScript:"#3178c6",Go:"#00ADD8",
Rust:"#dea584",Java:"#b07219","C++":"#f34b7d",C:"#555555",Ruby:"#701516",
Shell:"#89e051",HTML:"#e34c26",CSS:"#563d7c",Kotlin:"#A97BFF",Swift:"#F05138",
"Jupyter Notebook":"#DA5B0B",Dockerfile:"#384d54",
}
+10
View File
@@ -0,0 +1,10 @@
import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import './index.css'
import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
)
@@ -0,0 +1,79 @@
import { useEffect, useState } from 'react'
import type { ReactNode } from 'react'
import { fetchSummary, type Summary } from '../lib/dev'
import { StatCards } from '../components/StatCards'
import { UsersTable } from '../components/UsersTable'
import { LatencyChart } from '../components/LatencyChart'
import { HealthStrip } from '../components/HealthStrip'
import { GrowthChart } from '../components/GrowthChart'
const REFRESH_MS = 15_000
export function DevScreen() {
const [s, setS] = useState<Summary | null>(null)
const [error, setError] = useState<string | null>(null)
const [lastRefresh, setLastRefresh] = useState<Date>(new Date())
useEffect(() => {
let alive = true
const load = () =>
fetchSummary()
.then(v => { if (!alive) return; setS(v); setError(null); setLastRefresh(new Date()) })
.catch(e => { if (alive) setError(e.message || 'error') })
load()
const h = window.setInterval(load, REFRESH_MS)
return () => { alive = false; window.clearInterval(h) }
}, [])
if (error === 'dashboard_disabled') {
return (
<Shell>
<div className="rounded-lg border border-amber-500/30 bg-amber-500/[0.06] p-6 text-amber-200">
The /dev dashboard is not configured on this deploy
(set DEV_DASHBOARD_USER and DEV_DASHBOARD_PASSWORD).
</div>
</Shell>
)
}
if (error === 'unauthorized') {
return (
<Shell>
<div className="text-white/60">Sign in to view the dashboard. Reload to retry.</div>
</Shell>
)
}
return (
<Shell lastRefresh={lastRefresh}>
{s ? <StatCards s={s} /> : <div className="text-white/40">loading…</div>}
<div className="mt-6">
<GrowthChart />
</div>
<div className="mt-6">
<UsersTable />
</div>
<div className="mt-6 grid grid-cols-1 gap-4 md:grid-cols-2">
<LatencyChart />
<HealthStrip />
</div>
</Shell>
)
}
function Shell({ children, lastRefresh }: { children: ReactNode; lastRefresh?: Date }) {
return (
<div className="min-h-screen bg-[#0b0d10] px-6 py-6 text-white">
<div className="mx-auto max-w-6xl">
<header className="mb-6 flex items-baseline justify-between">
<h1 className="font-mono text-lg text-white/90">/dev · gh-stats analytics</h1>
{lastRefresh && (
<div className="text-xs text-white/40">
last refresh {lastRefresh.toLocaleTimeString()}
</div>
)}
</header>
{children}
</div>
</div>
)
}
@@ -0,0 +1,157 @@
import DOMPurify from 'dompurify'
import { useMemo, useState } from 'react'
function sanitizeSvg(raw: string): string {
return DOMPurify.sanitize(raw, {
USE_PROFILES: { svg: true, svgFilters: true },
ADD_TAGS: ['image', 'use', 'clipPath', 'defs', 'style', 'animate', 'animateTransform', 'feDropShadow', 'filter', 'linearGradient', 'stop'],
ADD_ATTR: ['xlink:href', 'href', 'clip-path', 'viewBox', 'preserveAspectRatio', 'xmlns', 'xmlns:xlink', 'rx', 'ry', 'attributeName', 'from', 'to', 'dur', 'fill', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'dominant-baseline', 'letter-spacing', 'opacity', 'filter', 'flood-color', 'flood-opacity', 'stdDeviation'],
})
}
type Props = {
username: string
generating: boolean
generatedSvg: string | null
generateError: string | null
// Owner renders embed as /api/<u>; visitors get /api/<u>?<their settings>.
// We display whichever URL was used to produce the SVG above, so the
// snippet they copy matches what they're previewing.
embedUrl: string
// 'building' means the SVG above is still the "Building @user's
// widget…" placeholder; the parent is auto-polling for the real one.
widgetStatus: 'ready' | 'building' | 'not_found' | 'rate_limited'
onBack: () => void
onRegenerate: () => void
// Manual refetch — same fetch the auto-poll runs, exposed as a button
// so the user has a way to nudge it if they want.
onRefresh: () => void
}
export function ResultScreen({ username, generating, generatedSvg, generateError, embedUrl, widgetStatus, onBack, onRegenerate, onRefresh }: Props) {
const safeSvg = useMemo(() => (generatedSvg ? sanitizeSvg(generatedSvg) : ''), [generatedSvg])
const [copied, setCopied] = useState(false)
const fallbackUrl = `${window.location.origin}/api/${encodeURIComponent(username)}`
const finalUrl = embedUrl || fallbackUrl
const embedSnippet = `[![${username}](${finalUrl})](${window.location.origin})`
const copy = async () => {
try {
await navigator.clipboard.writeText(embedSnippet)
setCopied(true)
setTimeout(() => setCopied(false), 1500)
} catch {
/* ignore */
}
}
return (
<div className="min-h-screen flex flex-col items-center animate-fade-in-up">
<div className="w-full max-w-3xl px-6 pt-6 flex items-center justify-between">
<button
onClick={onBack}
className="flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-600 transition-colors"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M19 12H5M12 19l-7-7 7-7" />
</svg>
Back
</button>
<button
onClick={onRegenerate}
disabled={generating}
title="Re-render the widget from the most recent cached data. Does not re-fetch from GitHub."
className="flex items-center gap-1.5 text-xs text-gray-500 hover:text-gray-800 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"
>
<svg
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={generating ? 'animate-spin-slow' : ''}
>
<path d="M21 12a9 9 0 1 1-3-6.7L21 8" />
<path d="M21 3v5h-5" />
</svg>
{generating ? 'Regenerating…' : 'Regenerate'}
</button>
</div>
<div className="flex-1 flex flex-col items-center justify-center px-6 pb-12 w-full max-w-3xl">
<h2 className="font-serif text-3xl text-gray-800 tracking-tight mb-2">
Your Widget
</h2>
{generating && (
<div className="mt-10 flex flex-col items-center gap-3">
<div className="w-6 h-6 border-2 border-gray-300 border-t-gray-600 rounded-full animate-spin-slow" />
<p className="text-xs text-gray-400">Generating with real data…</p>
</div>
)}
{!generating && generateError && (
<div className="mt-10 flex flex-col items-center gap-3">
<p className="text-sm text-red-500">{generateError}</p>
</div>
)}
{!generating && !generateError && safeSvg && (
<>
{widgetStatus === 'building' && (
<div className="mt-6 flex items-center gap-2 text-xs text-gray-500">
<div className="w-3 h-3 border-2 border-gray-300 border-t-gray-600 rounded-full animate-spin-slow" />
<span>Still building on the server — this page will update automatically when ready.</span>
<button
onClick={onRefresh}
className="ml-2 px-2 py-1 rounded-md text-gray-600 hover:text-gray-900 hover:bg-gray-100 transition-colors"
>
Check now
</button>
</div>
)}
<div className="w-full mt-6 rounded-2xl bg-white shadow-lg ring-1 ring-gray-200 p-6 flex justify-center">
{/*
Force the inline SVG to scale up to the card width. The
composite is authored at 380px wide — without this the
preview looked tiny on wide screens.
*/}
<div
className="w-full max-w-xl [&_svg]:w-full [&_svg]:h-auto"
dangerouslySetInnerHTML={{ __html: safeSvg }}
/>
</div>
<div className="w-full mt-8">
<p className="text-xs uppercase tracking-wider text-gray-500 mb-2">Embed in your README</p>
<div className="relative">
<pre className="bg-gray-900 text-gray-100 text-xs p-4 pr-12 rounded-lg overflow-x-auto">
{embedSnippet}
</pre>
<button
onClick={copy}
title={copied ? 'Copied!' : 'Copy'}
className="absolute top-2 right-2 p-1.5 rounded-md text-gray-400 hover:text-gray-100 hover:bg-gray-800 transition-colors"
>
{copied ? (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<polyline points="20 6 9 17 4 12" />
</svg>
) : (
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<rect x="9" y="9" width="13" height="13" rx="2" ry="2" />
<path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" />
</svg>
)}
</button>
</div>
</div>
</>
)}
</div>
</div>
)
}
@@ -0,0 +1,80 @@
import { useState } from 'react'
type Props = {
onSearch: (username: string) => void
}
// A real card served by the live API, so the landing page shows the actual
// product, not a mockup. The frame below has a fixed height so a slow or
// failed load never reflows the page or pushes the input out of view.
const EXAMPLE_URL = 'https://gh-stats.com/api/shaymanor'
export function SearchScreen({ onSearch }: Props) {
const [value, setValue] = useState('')
const [exampleFailed, setExampleFailed] = useState(false)
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
const trimmed = value.trim()
if (trimmed) onSearch(trimmed)
}
return (
<div className="min-h-screen flex items-start md:items-center justify-center px-6 py-12 animate-fade-in-up">
<div className="w-full max-w-4xl grid gap-10 md:grid-cols-2 md:items-center">
<div className="w-full max-w-md mx-auto md:mx-0 text-center md:text-left">
<h1 className="font-serif text-4xl md:text-5xl text-gray-800 tracking-tight mb-3">
GitHub Stats
</h1>
<p className="text-sm text-gray-500 leading-relaxed mb-8">
One image for your profile README: your score, contribution timeline,
top collaborators, language breakdown, commit streaks and auto-awarded tags.
</p>
<form onSubmit={handleSubmit} className="flex gap-2">
<input
type="text"
value={value}
onChange={e => setValue(e.target.value)}
placeholder="Enter GitHub username..."
autoFocus
className="flex-1 min-w-0 px-4 py-3 rounded-xl border border-gray-200 bg-white text-sm text-gray-800 placeholder:text-gray-300 focus:outline-none focus:ring-1 focus:ring-gray-300 transition-colors"
/>
<button
type="submit"
disabled={!value.trim()}
className="px-6 py-3 rounded-xl bg-gray-800 text-white text-sm font-medium hover:bg-gray-700 disabled:opacity-40 disabled:cursor-not-allowed transition-colors"
>
Go
</button>
</form>
<p className="mt-3 text-xs text-gray-400">
Five themes · one line of markdown · no signup
</p>
</div>
<div className="w-full max-w-[420px] mx-auto md:mx-0">
<div className="relative h-[300px] md:h-[420px] overflow-hidden rounded-2xl border border-gray-200 bg-white">
{exampleFailed ? (
<p className="absolute inset-0 flex items-center justify-center text-xs text-gray-400">
Example card unavailable
</p>
) : (
<img
src={EXAMPLE_URL}
width={420}
height={1196}
alt="Example stats card"
onError={() => setExampleFailed(true)}
className="block w-full"
/>
)}
<div className="pointer-events-none absolute inset-x-0 bottom-0 h-14 md:h-16 bg-gradient-to-t from-gray-50 to-transparent" />
</div>
<p className="mt-3 text-center md:text-left font-mono text-[11px] text-gray-400 truncate">
gh-stats.com/api/shaymanor
</p>
</div>
</div>
</div>
)
}
@@ -0,0 +1,771 @@
import { useState, useMemo, type ReactNode } from 'react'
import DOMPurify from 'dompurify'
import type { WidgetSettings, Achievement, PerWidgetSettings } from '../App'
import { renderAllWidgets, type WidgetData } from '../lib/renderWidgets'
import type { Me } from '../lib/auth'
// Defense-in-depth: the client-rendered preview assembles SVG from
// GitHub-sourced strings (collaborator logins, repo names) and user-typed
// achievement text. renderWidgets escapes known fields, but one missed
// interpolation anywhere upstream would turn into HTML in the preview.
// DOMPurify neutralises that without affecting normal SVG shapes/styles.
const SVG_SANITIZE_CONFIG = {
USE_PROFILES: { svg: true, svgFilters: true },
ADD_TAGS: [
'image', 'use', 'clipPath', 'defs', 'style', 'animate', 'animateTransform',
'feDropShadow', 'filter', 'linearGradient', 'stop',
],
ADD_ATTR: [
'xlink:href', 'href', 'clip-path', 'viewBox', 'preserveAspectRatio',
'xmlns', 'xmlns:xlink', 'rx', 'ry', 'attributeName', 'from', 'to', 'dur',
'fill', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap',
'stroke-linejoin', 'dominant-baseline', 'letter-spacing', 'opacity',
'filter', 'flood-color', 'flood-opacity', 'stdDeviation',
],
}
// Mini-preview swatches (bg + card + accent). Flat-color swatches all read
// the same dark/light — showing the accent color is what actually separates
// Midnight (blue) from Onyx (purple) from Nord (cyan), etc.
const THEMES = [
{ id: 'midnight', label: 'Midnight', bg: '#121820', card: '#1a2230', border: '#2a3444', accent: '#58a6ff', light: false },
{ id: 'onyx', label: 'Onyx', bg: '#09090b', card: '#18181b', border: '#27272a', accent: '#a78bfa', light: false },
{ id: 'nord', label: 'Nord', bg: '#1e2433', card: '#2a3142', border: '#3d4659', accent: '#88c0d0', light: false },
{ id: 'clean', label: 'Clean', bg: '#ffffff', card: '#f6f8fa', border: '#d8dee4', accent: '#0969da', light: true },
{ id: 'paper', label: 'Paper', bg: '#faf8f5', card: '#f5f0eb', border: '#e0d8cf', accent: '#b45309', light: true },
]
const ALL_WIDGETS = [
// "name" is the avatar + username header. Pinned at the top — can be
// toggled off but never reordered. Keep this entry first.
{ id: 'name', label: 'Name' },
{ id: 'grade', label: 'Grade' },
{ id: 'impact', label: 'Impact Timeline' },
{ id: 'streaks', label: 'Streaks' },
{ id: 'collaborators', label: 'Top Collaborators' },
{ id: 'focus', label: 'Recent Focus' },
{ id: 'languages', label: 'Languages' },
{ id: 'achievements', label: 'Achievements' },
]
// Lucide-style hollow glyphs: consistent stroke-weight + viewBox so the 4
// buttons line up and read as one icon family. Kept as JSX so they inherit
// currentColor from the surrounding button's text color.
const ICON_SVG_PROPS = {
width: 16,
height: 16,
viewBox: '0 0 24 24',
fill: 'none',
stroke: 'currentColor',
strokeWidth: 1.75,
strokeLinecap: 'round' as const,
strokeLinejoin: 'round' as const,
}
const ICONS: { id: string; svg: ReactNode }[] = [
{
id: 'trophy',
svg: (
<svg {...ICON_SVG_PROPS}>
<path d="M6 9H4.5a2.5 2.5 0 0 1 0-5H6" />
<path d="M18 9h1.5a2.5 2.5 0 0 0 0-5H18" />
<path d="M4 22h16" />
<path d="M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" />
<path d="M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" />
<path d="M18 2H6v7a6 6 0 0 0 12 0V2z" />
</svg>
),
},
{
id: 'medal',
svg: (
<svg {...ICON_SVG_PROPS}>
<path d="M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15" />
<path d="M11 12 5.12 2.2" />
<path d="m13 12 5.88-9.8" />
<path d="M8 7h8" />
<circle cx="12" cy="17" r="5" />
<path d="M12 18v-2h-.5" />
</svg>
),
},
{
id: 'star',
svg: (
<svg {...ICON_SVG_PROPS}>
<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26" />
</svg>
),
},
{
id: 'hackathon',
svg: (
<svg {...ICON_SVG_PROPS}>
<polyline points="16 18 22 12 16 6" />
<polyline points="8 6 2 12 8 18" />
</svg>
),
},
]
const COLOR_PRESETS = [
'#58a6ff', '#a78bfa', '#4ade80', '#fb923c', '#f472b6',
'#ff6b6b', '#38bdf8', '#facc15', '#34d399', '#c084fc',
]
function ChevronIcon({ open }: { open: boolean }) {
return (
<svg
width="12" height="12" viewBox="0 0 24 24" fill="none"
stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"
className={`transition-transform ${open ? 'rotate-90' : ''}`}
>
<path d="M9 18l6-6-6-6" />
</svg>
)
}
function NumberStepper({ value, min, max, onChange }: {
value: number; min: number; max: number; onChange: (v: number) => void
}) {
return (
<div className="flex items-center gap-1.5">
<button
onClick={() => onChange(Math.max(min, value - 1))}
className="w-6 h-6 rounded bg-gray-100 text-gray-500 hover:bg-gray-200 text-xs font-medium flex items-center justify-center"
>-</button>
<span className="text-xs text-gray-700 w-5 text-center tabular-nums">{value}</span>
<button
onClick={() => onChange(Math.min(max, value + 1))}
className="w-6 h-6 rounded bg-gray-100 text-gray-500 hover:bg-gray-200 text-xs font-medium flex items-center justify-center"
>+</button>
</div>
)
}
// Common "noise" languages users typically want to hide — shown even when
// the account-level detection hasn't surfaced them yet (e.g., first load).
const COMMON_HIDE_LANGS = ['HTML', 'CSS', 'SCSS', 'Jupyter Notebook', 'TeX', 'Shell', 'Dockerfile', 'Makefile', 'Batchfile']
function HiddenLanguagesPicker({
detected, hidden, onChange,
}: {
detected: { language: string }[]
hidden: string[]
onChange: (next: string[]) => void
}) {
const seen = new Set<string>()
const options: string[] = []
for (const d of detected) if (d.language && !seen.has(d.language)) { seen.add(d.language); options.push(d.language) }
for (const c of COMMON_HIDE_LANGS) if (!seen.has(c)) { seen.add(c); options.push(c) }
// Preserve any user-set hidden that we haven't otherwise seen.
for (const h of hidden) if (!seen.has(h)) { seen.add(h); options.push(h) }
const toggle = (lang: string) => {
onChange(hidden.includes(lang) ? hidden.filter(h => h !== lang) : [...hidden, lang])
}
return (
<div>
<div className="flex items-center justify-between mb-1.5">
<span className="text-[10px] text-gray-500">Hide languages</span>
{hidden.length > 0 && (
<button
onClick={() => onChange([])}
className="text-[10px] text-gray-400 hover:text-gray-600 transition-colors"
>
Clear
</button>
)}
</div>
<div className="flex flex-wrap gap-1">
{options.map(lang => {
const active = hidden.includes(lang)
return (
<button
key={lang}
onClick={() => toggle(lang)}
className={`px-2 py-0.5 rounded-md text-[10px] transition-colors ${
active
? 'bg-gray-800 text-white border border-gray-800'
: 'bg-white text-gray-500 border border-gray-200 hover:text-gray-800 hover:border-gray-300'
}`}
>
{lang}
</button>
)
})}
</div>
</div>
)
}
function ColorPicker({ value, onChange }: { value: string; onChange: (v: string) => void }) {
return (
<div className="flex gap-1.5 flex-wrap">
{COLOR_PRESETS.map(c => (
<button
key={c}
onClick={() => onChange(c)}
className={`w-5 h-5 rounded-full transition-all ${
value === c ? 'ring-2 ring-offset-1 ring-gray-900' : 'hover:ring-1 hover:ring-gray-300'
}`}
style={{ backgroundColor: c }}
/>
))}
</div>
)
}
type Props = {
username: string
settings: WidgetSettings
onSettingsChange: (s: WidgetSettings) => void
onGenerate: () => void
onBack: () => void
fetchDone: boolean
fetchError: string | null
widgetData: WidgetData | null
isDemoData: boolean
me: Me
onAuthChange?: (m: Me) => void
}
export function WorkshopScreen({
username,
settings,
onSettingsChange,
onGenerate,
onBack,
fetchDone,
fetchError,
widgetData,
isDemoData,
me,
}: Props) {
const canEdit = !!me.login && me.login.toLowerCase() === username.toLowerCase()
const [expandedWidget, setExpandedWidget] = useState<string | null>(null)
// Index being dragged + index currently hovered (for drop-line indicator).
const [dragIndex, setDragIndex] = useState<number | null>(null)
const [dropIndex, setDropIndex] = useState<number | null>(null)
// Same pattern for the achievements list so the two drag interactions
// don't share state and fight each other.
const [achDragIndex, setAchDragIndex] = useState<number | null>(null)
const [achDropIndex, setAchDropIndex] = useState<number | null>(null)
// Build the render-order list from settings.widgetOrder, tolerating
// stale persisted data: drop unknown ids, append any known widgets
// the stored order forgot. Keeps the UI functional if ALL_WIDGETS
// gains or loses an entry between releases.
const knownIds = useMemo(() => new Set(ALL_WIDGETS.map(w => w.id)), [])
// "name" is pinned at index 0 regardless of persisted order. We still keep
// it in orderedIds so the composite-render path can find it, but the drag
// UI below treats it as non-reorderable.
const orderedIds = useMemo(() => {
const seen = new Set<string>()
const out: string[] = ['name']
seen.add('name')
for (const id of settings.widgetOrder) {
if (knownIds.has(id) && !seen.has(id)) { seen.add(id); out.push(id) }
}
for (const w of ALL_WIDGETS) {
if (!seen.has(w.id)) { seen.add(w.id); out.push(w.id) }
}
return out
}, [settings.widgetOrder, knownIds])
const moveWidget = (from: number, to: number) => {
if (from === to || from < 0 || to < 0 || from >= orderedIds.length || to >= orderedIds.length) return
// Never move "name" and never drop another widget above it (index 0).
if (orderedIds[from] === 'name' || to === 0) return
const next = orderedIds.slice()
const [item] = next.splice(from, 1)
next.splice(to, 0, item)
onSettingsChange({ ...settings, widgetOrder: next })
}
const updateSetting = <K extends keyof WidgetSettings>(key: K, val: WidgetSettings[K]) => {
onSettingsChange({ ...settings, [key]: val })
}
const updateWidgetSetting = (widget: keyof PerWidgetSettings, key: string, val: unknown) => {
const current = settings.widgetSettings[widget] || {}
const next = { ...settings.widgetSettings, [widget]: { ...current, [key]: val } }
updateSetting('widgetSettings', next)
}
const getWidgetSetting = <T,>(widget: keyof PerWidgetSettings, key: string, fallback: T): T => {
const ws = settings.widgetSettings[widget] as Record<string, unknown> | undefined
return (ws?.[key] as T) ?? fallback
}
const toggleWidget = (id: string) => {
const next = settings.widgets.includes(id)
? settings.widgets.filter(w => w !== id)
: [...settings.widgets, id]
updateSetting('widgets', next)
}
const toggleAdvanced = (id: string) => {
setExpandedWidget(expandedWidget === id ? null : id)
}
const addAchievement = () => {
updateSetting('achievements', [
...settings.achievements,
{ title: '', subtitle: '', event_date: '', icon: 'trophy' },
])
}
const updateAchievement = (idx: number, field: keyof Achievement, val: string) => {
const next = settings.achievements.map((a, i) =>
i === idx ? { ...a, [field]: val } : a
)
updateSetting('achievements', next)
}
const removeAchievement = (idx: number) => {
updateSetting('achievements', settings.achievements.filter((_, i) => i !== idx))
}
const moveAchievement = (from: number, to: number) => {
const list = settings.achievements
if (from === to || from < 0 || to < 0 || from >= list.length || to >= list.length) return
const next = list.slice()
const [item] = next.splice(from, 1)
next.splice(to, 0, item)
updateSetting('achievements', next)
}
// Render SVG client-side whenever settings change (instant, no API call)
const svgContent = useMemo(() => {
if (!widgetData) return ''
const raw = renderAllWidgets({
data: widgetData,
theme: settings.theme,
widgets: settings.widgets,
widgetOrder: orderedIds,
achievements: settings.achievements,
widgetSettings: settings.widgetSettings,
hiddenLanguages: settings.hiddenLanguages,
username,
})
return DOMPurify.sanitize(raw, SVG_SANITIZE_CONFIG)
}, [widgetData, settings, username, orderedIds])
return (
<div className="min-h-screen animate-fade-in-up">
<div className="flex min-h-screen">
{/* Left settings panel */}
<div className="w-80 flex-shrink-0 border-r border-gray-200 bg-white p-6 flex flex-col overflow-y-auto">
{/* Back */}
<button
onClick={onBack}
className="flex items-center gap-1.5 text-xs text-gray-400 hover:text-gray-600 mb-6 transition-colors self-start"
>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<path d="M19 12H5M12 19l-7-7 7-7"/>
</svg>
Back
</button>
<div className="text-sm font-semibold text-gray-800 mb-4">{username}</div>
<button
onClick={onGenerate}
className="w-full py-3 rounded-xl bg-gray-800 text-white text-sm font-medium hover:bg-gray-700 transition-colors mb-6"
>
Generate →
</button>
{fetchError && (
<div className="flex items-center gap-1.5 text-[10px] text-red-500 mb-6">
<div className="w-1.5 h-1.5 rounded-full bg-red-400" />
{fetchError}
</div>
)}
{!canEdit && me.login && (
<div className="banner">
{`Signed in as ${me.login}. Changes here produce a shareable link with query params. Only ${username} can save them permanently.`}
</div>
)}
{/* Theme */}
<div className="mb-5">
<div className="text-[10px] uppercase tracking-wider text-gray-400 font-medium mb-3">Theme</div>
<div className="flex gap-2 flex-wrap">
{THEMES.map(t => (
<button
key={t.id}
onClick={() => updateSetting('theme', t.id)}
title={t.label}
aria-label={t.label}
className={`w-9 h-9 rounded-lg overflow-hidden transition-all ${
settings.theme === t.id
? 'ring-2 ring-gray-900 ring-offset-2'
: t.light
? 'ring-1 ring-gray-200 hover:ring-gray-300'
: 'hover:ring-1 hover:ring-gray-400 hover:ring-offset-1'
}`}
>
<svg viewBox="0 0 36 36" width="36" height="36">
<rect width="36" height="36" rx="8" fill={t.bg} />
<rect x="6" y="8" width="24" height="20" rx="4" fill={t.card} stroke={t.border} strokeWidth="1" />
<circle cx="11" cy="18" r="3" fill={t.accent} />
<rect x="16" y="16.25" width="10" height="1.75" rx="0.875" fill={t.accent} opacity="0.75" />
<rect x="16" y="19.75" width="7" height="1.5" rx="0.75" fill={t.accent} opacity="0.35" />
</svg>
</button>
))}
</div>
<div className="text-[10px] text-gray-400 mt-1.5">
{THEMES.find(t => t.id === settings.theme)?.label}
</div>
</div>
{/* Widgets with inline advanced settings */}
<div className="mb-5">
<div className="text-[10px] uppercase tracking-wider text-gray-400 font-medium mb-3">Widgets</div>
<div className="flex flex-col gap-0.5">
{orderedIds.map((id, idx) => {
const w = ALL_WIDGETS.find(x => x.id === id)
if (!w) return null
const enabled = settings.widgets.includes(w.id)
const hasAdvanced = ['grade', 'impact', 'streaks', 'collaborators', 'focus', 'languages', 'achievements'].includes(w.id)
const isExpanded = expandedWidget === w.id && enabled
// "name" is pinned — no drag affordance, no drop lines.
// The dropIndex comparisons below still use the real idx
// so downstream rows behave normally when name is skipped.
const isPinned = w.id === 'name'
const isDragging = !isPinned && dragIndex === idx
const showDropLineAbove = !isPinned && idx > 0 && dropIndex === idx && dragIndex !== null && dragIndex !== idx
// Drop-line below the last row when dragging past the end.
const showDropLineBelow = !isPinned && idx === orderedIds.length - 1 && dropIndex === orderedIds.length && dragIndex !== null
return (
<div key={w.id}>
{showDropLineAbove && <div className="h-0.5 bg-gray-900 rounded-full mx-2 mb-0.5" />}
<div
className={`flex items-center transition-opacity ${isDragging ? 'opacity-40' : ''}`}
draggable={!isPinned}
onDragStart={isPinned ? undefined : e => {
setDragIndex(idx)
e.dataTransfer.effectAllowed = 'move'
// Firefox needs some payload to start a drag.
e.dataTransfer.setData('text/plain', String(idx))
}}
onDragOver={isPinned ? undefined : e => {
if (dragIndex === null) return
e.preventDefault()
e.dataTransfer.dropEffect = 'move'
// Midpoint decides whether the drop slot is this row
// or the next — gives a predictable feel between rows.
const rect = e.currentTarget.getBoundingClientRect()
const after = e.clientY - rect.top > rect.height / 2
const target = after ? idx + 1 : idx
// Landing on the drag source's own slot is a no-op;
// hide the indicator so it doesn't look interactive.
if (target === dragIndex || target === dragIndex + 1) {
setDropIndex(null)
} else {
setDropIndex(target)
}
}}
onDrop={isPinned ? undefined : e => {
e.preventDefault()
if (dragIndex === null || dropIndex === null) {
setDragIndex(null); setDropIndex(null); return
}
// Removing the source before inserting shifts later
// indices down by one — adjust the target accordingly.
const to = dropIndex > dragIndex ? dropIndex - 1 : dropIndex
moveWidget(dragIndex, to)
setDragIndex(null); setDropIndex(null)
}}
onDragEnd={isPinned ? undefined : () => { setDragIndex(null); setDropIndex(null) }}
>
{isPinned ? (
<span
className="px-1 text-gray-300 select-none"
title="Pinned — can't be reordered"
aria-hidden
>
<svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<rect x="3" y="11" width="18" height="10" rx="2"/>
<path d="M7 11V7a5 5 0 0 1 10 0v4"/>
</svg>
</span>
) : (
<span
className="px-1 text-gray-300 hover:text-gray-500 cursor-grab active:cursor-grabbing select-none"
title="Drag to reorder"
aria-hidden
>
⋮⋮
</span>
)}
<button
onClick={() => toggleWidget(w.id)}
className={`flex-1 flex items-center gap-2.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors text-left ${
enabled
? 'text-gray-800 bg-gray-50'
: 'text-gray-400 hover:text-gray-500 hover:bg-gray-50/50'
}`}
>
<div className={`w-3.5 h-3.5 rounded flex-shrink-0 transition-colors ${enabled ? 'bg-gray-900' : 'bg-gray-200'}`} />
{w.label}
</button>
{hasAdvanced && enabled && (
<button
onClick={() => toggleAdvanced(w.id)}
className="p-1.5 text-gray-400 hover:text-gray-600 transition-colors"
title="Advanced settings"
>
<ChevronIcon open={isExpanded} />
</button>
)}
</div>
{showDropLineBelow && <div className="h-0.5 bg-gray-900 rounded-full mx-2 mt-0.5" />}
{isExpanded && (
<div className="ml-6 mt-1 mb-2 p-2.5 rounded-lg bg-gray-50/80 border border-gray-100 flex flex-col gap-2.5">
{w.id === 'grade' && (
<div className="flex items-center justify-between">
<span className="text-[10px] text-gray-500">Max tags</span>
<NumberStepper
value={getWidgetSetting('grade', 'max_tags', 6)}
min={1} max={20}
onChange={v => updateWidgetSetting('grade', 'max_tags', v)}
/>
</div>
)}
{w.id === 'impact' && (
<div>
<span className="text-[10px] text-gray-500 block mb-1.5">Line color</span>
<ColorPicker
value={getWidgetSetting('impact', 'line_color', '#58a6ff')}
onChange={v => updateWidgetSetting('impact', 'line_color', v)}
/>
</div>
)}
{w.id === 'streaks' && (
<div>
<span className="text-[10px] text-gray-500 block mb-1.5">Streak color</span>
<ColorPicker
value={getWidgetSetting('streaks', 'color', '#58a6ff')}
onChange={v => updateWidgetSetting('streaks', 'color', v)}
/>
</div>
)}
{w.id === 'collaborators' && (
<div className="flex flex-col gap-2.5">
<div className="flex items-center justify-between">
<span className="text-[10px] text-gray-500">Max shown</span>
<NumberStepper
value={getWidgetSetting('collaborators', 'max_count', 5)}
min={1} max={10}
onChange={v => updateWidgetSetting('collaborators', 'max_count', v)}
/>
</div>
<div>
<span className="text-[10px] text-gray-500 block mb-1.5">Bar color</span>
<ColorPicker
value={getWidgetSetting('collaborators', 'bar_color', '#a78bfa')}
onChange={v => updateWidgetSetting('collaborators', 'bar_color', v)}
/>
</div>
</div>
)}
{w.id === 'focus' && (
<div className="flex items-center justify-between">
<span className="text-[10px] text-gray-500">Max categories</span>
<NumberStepper
value={getWidgetSetting('focus', 'max_categories', 6)}
min={1} max={10}
onChange={v => updateWidgetSetting('focus', 'max_categories', v)}
/>
</div>
)}
{w.id === 'languages' && (
<div className="flex flex-col gap-2.5">
<div className="flex items-center justify-between">
<span className="text-[10px] text-gray-500">Max languages</span>
<NumberStepper
value={getWidgetSetting('languages', 'max_languages', 5)}
min={1} max={10}
onChange={v => updateWidgetSetting('languages', 'max_languages', v)}
/>
</div>
<HiddenLanguagesPicker
detected={widgetData?.languages ?? []}
hidden={settings.hiddenLanguages}
onChange={next => updateSetting('hiddenLanguages', next)}
/>
</div>
)}
{w.id === 'achievements' && (
<div className="flex flex-col gap-2.5">
<div className="flex items-center justify-between">
<span className="text-[10px] text-gray-500">Max shown</span>
<NumberStepper
value={getWidgetSetting('achievements', 'max_items', 5)}
min={1} max={10}
onChange={v => updateWidgetSetting('achievements', 'max_items', v)}
/>
</div>
<div className="flex flex-col gap-2">
{settings.achievements.map((ach, aidx) => {
const achIsDragging = achDragIndex === aidx
const achShowLineAbove = aidx > 0 && achDropIndex === aidx && achDragIndex !== null && achDragIndex !== aidx
const achShowLineBelow = aidx === settings.achievements.length - 1 && achDropIndex === settings.achievements.length && achDragIndex !== null
return (
<div key={aidx}>
{achShowLineAbove && <div className="h-0.5 bg-gray-900 rounded-full mx-2 mb-0.5" />}
<div
className={`p-2.5 rounded-lg border border-gray-100 bg-white transition-opacity ${achIsDragging ? 'opacity-40' : ''}`}
draggable
onDragStart={e => {
setAchDragIndex(aidx)
e.dataTransfer.effectAllowed = 'move'
e.dataTransfer.setData('text/plain', String(aidx))
}}
onDragOver={e => {
if (achDragIndex === null) return
e.preventDefault()
e.dataTransfer.dropEffect = 'move'
const rect = e.currentTarget.getBoundingClientRect()
const after = e.clientY - rect.top > rect.height / 2
const target = after ? aidx + 1 : aidx
if (target === achDragIndex || target === achDragIndex + 1) {
setAchDropIndex(null)
} else {
setAchDropIndex(target)
}
}}
onDrop={e => {
e.preventDefault()
if (achDragIndex === null || achDropIndex === null) {
setAchDragIndex(null); setAchDropIndex(null); return
}
const to = achDropIndex > achDragIndex ? achDropIndex - 1 : achDropIndex
moveAchievement(achDragIndex, to)
setAchDragIndex(null); setAchDropIndex(null)
}}
onDragEnd={() => { setAchDragIndex(null); setAchDropIndex(null) }}
>
<div className="flex items-center gap-1.5 mb-2">
<span
className="text-gray-300 hover:text-gray-500 cursor-grab active:cursor-grabbing select-none pr-1"
title="Drag to reorder"
aria-hidden
>
<svg width="10" height="12" viewBox="0 0 10 16" fill="currentColor" aria-hidden="true">
<circle cx="2.5" cy="3" r="1.2"/><circle cx="7.5" cy="3" r="1.2"/>
<circle cx="2.5" cy="8" r="1.2"/><circle cx="7.5" cy="8" r="1.2"/>
<circle cx="2.5" cy="13" r="1.2"/><circle cx="7.5" cy="13" r="1.2"/>
</svg>
</span>
{ICONS.map(ic => {
const selected = ach.icon === ic.id
return (
<button
key={ic.id}
onClick={() => updateAchievement(aidx, 'icon', ic.id)}
className={`w-8 h-8 rounded-md flex items-center justify-center transition-colors ${
selected
? 'bg-gray-800 text-white border border-gray-800'
: 'bg-white text-gray-500 border border-gray-200 hover:text-gray-800 hover:border-gray-300'
}`}
title={ic.id}
aria-pressed={selected}
>
{ic.svg}
</button>
)
})}
<div className="flex-1" />
<button
onClick={() => removeAchievement(aidx)}
className="text-gray-300 hover:text-red-400 transition-colors text-xs px-1"
title="Remove"
>
✕
</button>
</div>
<input
type="text"
value={ach.title}
onChange={e => updateAchievement(aidx, 'title', e.target.value)}
placeholder="Title (e.g. Hackathon Winner)"
className="w-full px-2 py-1.5 rounded-md border border-gray-200 bg-white text-xs text-gray-800 placeholder:text-gray-300 focus:outline-none focus:ring-1 focus:ring-gray-300 mb-1.5"
/>
<input
type="text"
value={ach.subtitle}
onChange={e => updateAchievement(aidx, 'subtitle', e.target.value)}
placeholder="Subtitle (e.g. 1st Place · AI Track)"
className="w-full px-2 py-1.5 rounded-md border border-gray-200 bg-white text-xs text-gray-800 placeholder:text-gray-300 focus:outline-none focus:ring-1 focus:ring-gray-300 mb-1.5"
/>
<input
type="text"
value={ach.event_date}
onChange={e => updateAchievement(aidx, 'event_date', e.target.value)}
placeholder="Date (e.g. 2025-01)"
className="w-full px-2 py-1.5 rounded-md border border-gray-200 bg-white text-xs text-gray-800 placeholder:text-gray-300 focus:outline-none focus:ring-1 focus:ring-gray-300"
/>
</div>
{achShowLineBelow && <div className="h-0.5 bg-gray-900 rounded-full mx-2 mt-0.5" />}
</div>
)
})}
<button
onClick={addAchievement}
className="w-full py-2 rounded-lg border border-dashed border-gray-200 text-xs text-gray-400 hover:text-gray-600 hover:border-gray-300 transition-colors"
>
+ Add achievement
</button>
</div>
</div>
)}
</div>
)}
</div>
)
})}
</div>
</div>
</div>
{/* Right preview area */}
<div className="flex-1 flex items-start justify-center p-8 overflow-auto">
<div className="relative">
{isDemoData && svgContent && (
<div className="flex items-center gap-1.5 mx-auto mb-3 w-fit rounded-full border border-amber-200 bg-amber-50 px-2.5 py-1 text-[10px] text-amber-700">
<div className="w-1.5 h-1.5 rounded-full bg-amber-400" />
Sample data until your stats finish building
</div>
)}
{svgContent ? (
<div dangerouslySetInnerHTML={{ __html: svgContent }} />
) : (
<div className="w-[420px] h-[600px] rounded-2xl border border-gray-200 bg-white flex items-center justify-center">
{!fetchDone ? (
<div className="w-5 h-5 border-2 border-gray-300 border-t-gray-600 rounded-full animate-spin-slow" />
) : (
<p className="text-xs text-gray-400">No data available</p>
)}
</div>
)}
</div>
</div>
</div>
</div>
)
}
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "esnext",
"types": ["vite/client"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"]
}
+7
View File
@@ -0,0 +1,7 @@
{
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"target": "es2023",
"lib": ["ES2023"],
"module": "esnext",
"types": ["node"],
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"noUnusedLocals": true,
"noUnusedParameters": true,
"erasableSyntaxOnly": true,
"noFallthroughCasesInSwitch": true
},
"include": ["vite.config.ts"]
}

Some files were not shown because too many files have changed in this diff Show More