A beautiful, GitHub-faithful web client built with Next.js — authenticate with your username and Personal Access Token, then browse and manage repos exactly like github.com.
GitHub’s UI is the gold standard for code collaboration. GitHub From Token recreates that experience as a self-hosted Next.js app: same URL patterns, navigation, PR timelines, diffs, and sidebars — powered entirely by the official GitHub REST & GraphQL APIs through your own PAT.
No OAuth app setup. No GitHub App registration. Just your username and token.
| Dashboard | Pull request conversation |
|---|---|
| Repos, activity feed, profile links | Full timeline — reviews, merges, inline comments, sidebar metadata |
Run locally and sign in with your PAT to explore your public and private repositories.
- Dashboard — top repositories and authenticated activity feed
- Profiles — repos, stars, followers, contribution graph
- Code — tree, blob, README, blame, branch selector
- Commits & diffs — history, compare branches, syntax-highlighted patches
- Pull requests — conversation timeline, files changed, commits, checks
- Issues — list, detail, labels, milestones, comments
- Search — repositories, code, issues, users, commits
- Orgs — people, repositories
- Actions, releases, notifications, settings
- Star, fork, create repositories
- Open, review, comment on, and merge pull requests (merge / squash / rebase)
- Create and close issues, add comments
- Edit and create files in the browser
- Create releases and branches
- iron-session — encrypted server-side session; token never exposed to the client
- Octokit — typed REST + GraphQL against GitHub
- Primer React — GitHub’s design language (light / dark)
- App Router — server components, streaming, view transitions
- Node.js 20+
- A GitHub account
- A Personal Access Token with
repo,workflow, andnotificationsscopes
git clone https://github.com/Hashim1999164/github-from-token.git
cd github-from-token
npm install
cp .env.local.example .env.localEdit .env.local and set a random secret (32+ characters):
SESSION_SECRET=your-long-random-string-at-least-32-charsnpm run devOpen http://localhost:3000/login and sign in with your GitHub username and PAT.
npm run build
npm startflowchart LR
Browser --> NextJS[Next.js App Router]
NextJS --> Session[iron-session cookie]
NextJS --> Octokit[Octokit REST / GraphQL]
Octokit --> GitHub[GitHub API]
Session -.->|encrypted PAT| NextJS
| Layer | Technology |
|---|---|
| Framework | Next.js 16, React 19, TypeScript |
| Auth | iron-session (httpOnly encrypted cookie) |
| API | @octokit/rest, @octokit/graphql |
| UI | @primer/react, Tailwind CSS, custom GitHub-like tokens |
| Markdown | react-markdown, remark-gfm |
| Diffs | react-diff-view, shiki |
Mirrors GitHub’s routes:
/ Dashboard
/{owner} User profile
/{owner}/{repo} Repository code
/{owner}/{repo}/pull/{n} Pull request
/{owner}/{repo}/issues/{n} Issue
/{owner}/{repo}/tree/{branch}/… File tree
/{owner}/{repo}/blob/{branch}/… File viewer
/search?q=… Global search
/orgs/{org} Organization
- Your PAT is stored only in an encrypted server-side session cookie.
- Never commit
.env.localor share your token. - Use a fine-grained or classic PAT with the minimum scopes you need.
- This project is for personal / team use — you are responsible for securing your deployment.
| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Production build |
npm start |
Run production server |
npm run lint |
ESLint |
Contributions are welcome! Feel free to open an issue or pull request.
- Fork the repo
- Create a feature branch (
git checkout -b feature/amazing) - Commit your changes
- Push and open a PR
Built with ☕ for developers who live in pull requests.
