# rafgraph/spa-github-pages

Host single page apps with GitHub Pages

Repository: https://github.com/rafgraph/spa-github-pages
Canonical: https://ross.abutalabs.com/products/spa-github-pages
Homepage: https://spa-github-pages.rafgraph.dev
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2022-11-12T13:37:03+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3763, "days_push": 1390, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4036, forks 565 (observed 2026-08-28T04:08:32.896233+00:00)

## What it is
A lightweight boilerplate solution for hosting single page apps on GitHub Pages, which doesn't natively support client-side routing. It uses a custom 404.html redirect trick to convert frontend routes into query strings so deep links load correctly.

## Use cases
- deploy a react router spa on github pages
- fix 404 errors on page refresh for frontend routes
- host single page app with client-side routing on github pages
- support deep links in a static site on github pages
- serve index.html for all routes on github pages

## When to choose
- you're hosting a SPA on GitHub Pages and need BrowserRouter-style routing to work on fresh page loads
- you want a zero-dependency, copy-paste fix rather than a build tool or server

## When to avoid
- you can use a host with native SPA fallback support like Netlify or Vercel
- your site is server-rendered or uses hash-based routing
- you need server-side logic or custom headers

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: routing, deployment, web-framework
- domain: web-development, frontend, developer-tools
- platform: browser, cross-platform
- tags: github-pages, spa, static-hosting, client-side-routing, 404-redirect, boilerplate, web-server

## Member repositories
- rafgraph/spa-github-pages (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:32.896233+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:31:27.564627+00:00, confidence not recorded.
  - readme: https://github.com/rafgraph/spa-github-pages (fetched 2026-08-28T04:08:32.896233+00:00, sha 0f46139e48f5)
  - homepage: https://spa-github-pages.rafgraph.dev (fetched 2026-08-29T09:16:39.507928+00:00, sha 35c384f3c6da)
- Data as of 2026-08-30T08:39:29.467469+00:00.
