Skip to content

WangNingkai/gitfolio-online

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

71 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Gitfolio Online

A personal portfolio website for every GitHub user

Quick Start โ€ข Features โ€ข Customization โ€ข Local Development โ€ข Deployment

Gitfolio Demo

Live Demo

GitHub Top Language GitHub Last Commit License Code Style Visitors

ไธญๆ–‡ๆ–‡ๆกฃ


Introduction

Gitfolio is a zero-configuration personal portfolio website that automatically fetches and displays your GitHub profile and repositories. No coding requiredโ€”just use it and showcase your work to the world in seconds.

Perfect for developers, open-source contributors, and anyone who wants a professional GitHub portfolio without the hassle.


Tech Stack

  • Runtime: Node.js 12+
  • Template Engine: Handlebars
  • HTTP Client: Axios
  • Testing: Jest
  • Code Style: Prettier + ESLint
  • Deployment: Vercel

Project Structure

gitfolio-online/
โ”œโ”€โ”€ api/                # Vercel serverless function
โ”‚   โ””โ”€โ”€ index.js        # Main API endpoint
โ”œโ”€โ”€ assets/             # Static assets
โ”‚   โ”œโ”€โ”€ index.html      # Base HTML template
โ”‚   โ”œโ”€โ”€ index.css       # Global styles
โ”‚   โ””โ”€โ”€ themes/         # Theme CSS files
โ”‚       โ”œโ”€โ”€ dark.css
โ”‚       โ”œโ”€โ”€ light.css
โ”‚       โ”œโ”€โ”€ auto.css    # Auto-follow system theme
โ”‚       โ””โ”€โ”€ dracula.css
โ”œโ”€โ”€ src/                # Core modules
โ”‚   โ”œโ”€โ”€ fetch.js        # GitHub GraphQL API fetcher
โ”‚   โ”œโ”€โ”€ render.js       # Handlebars template renderer
โ”‚   โ”œโ”€โ”€ retryer.js      # Token rotation & retry logic
โ”‚   โ””โ”€โ”€ utils.js        # Utility functions
โ”œโ”€โ”€ scripts/            # Development scripts
โ”‚   โ””โ”€โ”€ server.js       # Local dev server
โ”œโ”€โ”€ tests/              # Test files
โ”‚   โ””โ”€โ”€ render.test.js
โ”œโ”€โ”€ .env.example        # Environment variable template
โ”œโ”€โ”€ package.json        # Project configuration
โ””โ”€โ”€ vercel.json         # Vercel deployment config

Quick Start

Get your portfolio up and running in 30 seconds:

Simply change {username} to your GitHub username:

https://gitfolio-online.vercel.app/user/{username}
# Or use the short version
https://gitfolio-online.vercel.app/u/{username}

That's it! ๐ŸŽ‰


Features

๐ŸŽจ Multiple Themes

Switch between light, dark, auto, and dracula themes with a single URL parameter. The auto theme automatically follows your system's color scheme preference.

๐Ÿ”„ Real-time Updates

Automatically fetches your latest GitHub activity (with smart caching).

โšก Blazing Fast

Built with Vercel Edge Network for lightning-fast global performance.

๐Ÿ› ๏ธ Highly Customizable

Fine-tune every aspect of your portfolio with URL parameters.

๐Ÿš€ Zero Setup

No configuration files, no build steps, no deployment neededโ€”just use it.

๐Ÿ“ฆ Repository Filtering

Choose which repositories to display (include/exclude forks, limit count).


Customization

Themes

Switch between built-in themes:

https://gitfolio-online.vercel.app/u/{username}?theme=dark
https://gitfolio-online.vercel.app/u/{username}?theme=light
https://gitfolio-online.vercel.app/u/{username}?theme=auto     # Follows system preference
https://gitfolio-online.vercel.app/u/{username}?theme=dracula  # Dracula color scheme

Include/Exclude Forks

Control whether to display forked repositories:

https://gitfolio-online.vercel.app/u/{username}?includeFork=true
https://gitfolio-online.vercel.app/u/{username}?includeFork=false

All Parameters

Parameter Type Description Default Example
username string Your GitHub username - wangningkai
theme string Built-in theme name dark dark, light, auto, dracula
includeFork boolean Display forked repositories false true, false
repoNum number Number of repositories to display 30 10, 20, 50
cache_seconds number Cache duration in seconds 1800 600, 3600

Example Combinations

Combine multiple parameters:

https://gitfolio-online.vercel.app/u/wangningkai?theme=light&includeFork=true&repoNum=50

Live Demo

Check out these live examples:


Local Development

Want to run Gitfolio locally? Follow these steps:

Prerequisites

  • Node.js 12+
  • GitHub Personal Access Token (required for GitHub GraphQL API)

Installation

# Clone the repository
git clone https://github.com/wangningkai/gitfolio-online.git
cd gitfolio-online

# Install dependencies
pnpm install
# or
npm install

Configuration

Create a .env file based on .env.example:

# GitHub Personal Access Token (required for GitHub GraphQL API)
# Create one at https://github.com/settings/tokens
# Scopes needed: none (for public repos) or 'repo' (for private repos)
PAT_1=your_github_token_here

# Optional: Additional tokens for rate limit rotation (supports PAT_1 ~ PAT_8)
# When rate limit is hit, the system automatically rotates to the next token
# PAT_2=your_second_token_here
# PAT_3=your_third_token_here

# Custom cache duration in seconds (optional, range: 30min~24h)
CACHE_SECONDS=1800

Running Locally

# Start the development server with hot reload
pnpm dev
# or
npm run dev

# Or start with specific port
PORT=3000 npm run dev

Visit http://localhost:3000/u/{username} to see your portfolio.

Running Tests

# Run all tests
pnpm test
# or
npm test

# Run tests with watch mode
pnpm test -- --watch

Deployment

Deploy to Vercel (Recommended)

Click the button below to deploy to your own Vercel instance:

Deploy to Vercel

Why deploy your own instance?

  • Avoid rate limits: GitHub API has a 5,000 requests/hour limit
  • Custom configuration: Full control over caching and themes
  • Privacy: Your own instance with your own analytics
  • Branding: Add your own domain and customization

Deploy to Other Platforms

Gitfolio works on any Node.js hosting platform:

  • Netlify: Connect your Git repository
  • Heroku: Use Heroku Buildpack for Node.js
  • Railway: One-click deploy from GitHub
  • Render: Deploy as a Node.js service
  • Self-hosted: Run on any VPS or server

FAQ

Why do I need my own instance?

The GitHub API has rate limits (5,000 requests/hour). If many users share the same instance, you might encounter rate limit errors during peak hours. Deploying your own instance ensures consistent performance.

Can I use my own custom theme?

Currently, Gitfolio supports built-in light/dark/auto/dracula themes. Custom theme support is planned for future releases.

How does the auto theme work?

The auto theme detects your system's color scheme preference (light or dark) and automatically applies the matching theme. This works on all modern browsers that support prefers-color-scheme media query.

How do I update my portfolio?

Gitfolio automatically fetches your latest GitHub data. Changes may take up to 30 minutes to appear (configurable with cache_seconds parameter).

Is there a limit on repositories?

Yes, by default Gitfolio displays up to 30 repositories. You can adjust this with the repoNum parameter (max 100 to ensure performance).

Can I hide specific repositories?

Currently, you can only show/hide all forks. Selective repository hiding is planned for future releases.

How does token rotation work?

If you provide multiple tokens (PAT_1 through PAT_8), Gitfolio will automatically rotate to the next token when one hits the GitHub API rate limit, ensuring uninterrupted service.


Contributing

Contributions are welcome! Here's how you can help:

Reporting Bugs

Before reporting bugs, please read How To Ask Questions The Smart Way.

Report bugs via:

Submitting Pull Requests

  1. Fork the repository
  2. Create a feature branch: git checkout -b my-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-feature
  5. Submit a pull request

Development Guidelines

  • Follow Prettier code style
  • Write clear commit messages
  • Test thoroughly before submitting

Support the Project

I open-source almost everything I can, and I try to help everyone using these projects. This takes time, and the service is provided for free.

If you find Gitfolio useful and want to support its development:

๐Ÿ‘ Star and Share

  • Star the repo on GitHub: โญ
  • Share it with your friends and colleagues: ๐Ÿš€

๐Ÿ’ธ Donate

Your support helps me continue creating and maintaining open-source projects! โค๏ธ


License

GPL-3.0 License - see LICENSE for details.


Acknowledgments


Made with โค๏ธ and JavaScript by @wangningkai and the open-source community.

About

:octocat: A personal portfolio website for every GitHub user.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors