Skip to content

GitHubHero is a Dockerized Python app using FastAPI, Streamlit, and Plotly to analyze and display your language trends and contributions via GitHub GraphQL API

License

Notifications You must be signed in to change notification settings

jrbrowning/GitHubHero

Repository files navigation

🔍 GitHubHero

GitHubHero is a full-stack application written mostly in python that processes your GitHub contributions (from the CLI using GraphQL) and visualizes how your preferred languages have evolved year to year.

Built with Docker, FastAPI, and Poetry for development reproducibility and Streamlit, Plotly, and Pandas interactive data visualization. (FYI, Claude is awesome at generating single page streamlit apps)

Motivation

Every developer/engineer I've met has followed a different path that has led them to who they are today. We are all unique and always changing.

This tool is for developers who want to introspect on their GitHub history.

It's not about comparing yourself against something (there are no other metrics), it's about you; The unique path you've taken to become the developer you are today.


✨ Features

  • 📊 Contribution summary: Commits, PRs, issues, and reviews by year
  • 🏷️ Repo language breakdown: Language composition per repo/year
  • 🔀 Sankey visualization: Year-over-year language flow
  • 🎛️ Interactive filtering: Select top N languages
  • 🐳 Containerized: Built with Docker containers (FastAPI and Streamlit)
  • 🧠 Offline/online modes: Use live API or download the JSON and run locally.

🖥️ Example data Preview

Sankey Diagram (Top 5 Languages)
Sankey

(Why's this look different than the streamlit app? This image is from a companion repo which is frontend focused.

Want to see your contributions in the same format or learn how this particular sankey data viz was made?

Check out jrbrowning.github.io repo.

(With both of these repos, you can publish this exact same image of your history to <your username>.github.io!)


🔧 Setup and Configuration

git clone https://github.com/jrbrowning/githubhero.git
cd githubhero

Set environment variables in .env:

cp .env.sample .env

🔐 Required GitHub Access Token

Go to Token Settings

🔗 Visit: https://github.com/settings/tokens

  1. Click “Generate new token (classic)”.

  2. Set Token Name and Expiration • Note: Choose a descriptive name like githubhero-token • Expiration: Select an minimal expiration date (e.g. 30 days) as a good practice. You can always generate another at a later date!

  3. Select Required Scopes. Your token must have:

  • repo - Access private repositories

  • read:user - To identify the user or get public profile info

  • read:org - (optional) Access organization details (repos, teams, etc)

    (Don’t select admin, write, or workflow scopes)

    You must be:

    • A collaborator on the private repo or
    • A member of a team with access to the repo

    You must use a personal access token (PAT) that is:

    • Owned by the user making the request
    • Installed correctly if using a GitHub App
  1. Generate and Copy the Token

    • Click “Generate token”, then copy it immediately. You won’t be able to see it again later.
  2. Add your token to env GITHUB_TOKEN=ghp_...

BUILD

This app is built using Docker running on Mac Silicon (M4).

docker-compose build; docker-compose up

Visit the Dashboards

FastAPI swagger docs (autogenerated by FastAPI)

Streamlit App


🗃️ Main Project Structure

.
├── api/                 # FastAPI backend
├── streamlit/           # Streamlit frontend
├── githubhero/          # Core data processing for API including GraphQL
├── .env                 # API keys and config
├── docker-compose.yml   # Container orchestration
├── pyproject.toml       # Poetry dependency and config

🧪 Development

Debug mode supported via debugpy (port 5678).


📦 Tech Stack


Local Debugging

  • VSCODE

Import "pandas" could not be resolved from sourcePylancereportMissingModuleSource

--> This means your local shell ENV doesn't have pandas install. Want to create a venv with all the dependencies? Check out the python ENV source script in the (toolshed)

🤖🧠 Credits

Built mostly by AI (Claude 3.7/4.0 Sonnet, OpenAI GPT-4o/4.1, MS VSCode CoPilot) with human direction and decision making.

Human director Jeff Browning — who is powered by curiosity and coffee ☕.

About

GitHubHero is a Dockerized Python app using FastAPI, Streamlit, and Plotly to analyze and display your language trends and contributions via GitHub GraphQL API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published