Skip to content

Repository files navigation

GitHub

GitHub From Token

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.

MIT License Next.js TypeScript Primer


Why this exists

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.

Preview

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.

Features

Browse & read

  • 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

Write & collaborate

  • 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

Built right

  • 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

Quick start

Prerequisites

Install

git clone https://github.com/Hashim1999164/github-from-token.git
cd github-from-token
npm install
cp .env.local.example .env.local

Edit .env.local and set a random secret (32+ characters):

SESSION_SECRET=your-long-random-string-at-least-32-chars

Run

npm run dev

Open http://localhost:3000/login and sign in with your GitHub username and PAT.

Production build

npm run build
npm start

Architecture

flowchart 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
Loading
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

URL structure

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

Security notes

  • Your PAT is stored only in an encrypted server-side session cookie.
  • Never commit .env.local or 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.

Scripts

Command Description
npm run dev Start development server
npm run build Production build
npm start Run production server
npm run lint ESLint

Contributing

Contributions are welcome! Feel free to open an issue or pull request.

  1. Fork the repo
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Commit your changes
  4. Push and open a PR

License

MIT © Hashim1999164


Built with ☕ for developers who live in pull requests.

About

A GitHub-faithful Next.js client powered by username + PAT authentication

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages