This repo is both:
- A Vite + React + TS template for a GitHub profile site.
- An npm CLI package named
gitforgethat generates static data from the GitHub API.
Two-branch setup:
| Branch | Purpose |
|---|---|
main |
Development — code only. data/*.json files are always empty []. |
web |
Deployment — code + personal data. data/ files hold real content. |
validate-main.ymlenforces thatdata/*.jsonstay empty onmain.- When a user forks the repo they get
mainwith empty data, then create their ownwebbranch for personal data. sync-to-web.ymlmerges code frommain→webon every push, but always restoresweb'sdata/andgitforge.config.jsonso personal data is never overwritten.deploy.ymlalways checks out thewebbranch (explicitref: web) for all trigger types (push, schedule, workflow_dispatch).- Because
GITHUB_TOKENpushes don't trigger other workflows,sync-to-web.ymlexplicitly dispatchesdeploy.ymlvia the GitHub API after pushing toweb.
- Config source of truth:
gitforge.config.json(git-ignored). Onlygitforge.config.example.jsonis tracked. - Generator script:
scripts/generate-github-data.js, exposed as thegitforgebinary viapackage.json. - Usage:
gitforge [owner] [--type user|org]— or readsgitforge.config.jsonwhen no CLI args given.
Do not hand-edit or rely on these for long-term docs — they are regenerated:
src/generated/githubData.tssrc/siteContent.json
When editing site content, work against src/siteContent.json (keeping in mind it gets regenerated).
- Functional React components, TypeScript, Tailwind CSS.
- Single-page app (React Router for internal nav), clean/dark/minimal/developer-focused.
- Deterministic and static — no runtime GitHub API calls from the browser.
- React + Vite + TypeScript
- Tailwind CSS
- pnpm
- Rich text editor:
luxe-edit(v0.2.0)- Save content as JSON via
getEditorJSON(editorState)inonChange - Render saved JSON as HTML via
getDOMFromJSON(savedJson)
- Save content as JSON via
scripts/generate-github-data.js— CLI / data generatorgitforge.config.example.json— tracked config templatesrc/generated/githubData.ts— generated GitHub data (do not hand-edit)src/siteContent.json— generated site content (do not hand-edit)src/admin/pages/AdminBlogsPage.tsx— blog editor (uses LuxeEditor)src/pages/BlogPage.tsx— blog display (renders JSON viagetDOMFromJSON)src/types/contentTypes.ts— shared content types (Blog,Project,Post,Video).github/workflows/— CI/CD workflows