Giter VIP home page Giter VIP logo

githitserver's Introduction

GitHitServer

Server-side SVG generator for displaying README cards containing GitHub's Traffic Insights. It uses the traffic data fetched by GitHits GitHub Action from the Insights/Traffic section of your repository.

Usage

Setting up GitHits GitHub Action

Head over to GitHits to setup a GitHub action to store traffic insights in your repository.

NOTE:

  • This only works for public repositories
  • This action generates a hits.json file in the master branch of your repository.
  • This file is required by GitHitServer for fetching Traffic Data

Adding a card to markdown

![<image-description>](https://githits.vercel.app/api/<route>?param_n=value_n&...)

Routes

  • views
  • clones

Parameters

Name Description
user REQUIRED Your GitHub username
repo REQUIRED Your repository name
mode DEFAULT=light Can be light or dark. Applies GitHub's colour scheme
theme A pre-defined theme. Overrides mode parameter
disable Total or Unique. Hides the chosen statistic
icon_color COLOR for card's icon
title_color COLOR for card's title
text_color COLOR for card's body text
bg_color COLOR for card's background

COLOR accepts all URI Encoded CSS color values, including:

  • RGB-Hex [#fafafa as %23fafafa]
  • rgb/rgba [rgb(4,6,8) as rgb(4%2C6%2C8)]
  • hsl/hsla [same as above]
  • Color Keywords

Example

Example Example

Testing and self-hosting

  • Run npm i or yarn in the cloned directory
  • Install vercel cli globally using npm i -g vercel or yarn global add vercel and login using vercel login (one-time setup only)
  • Run vercel to setup your project locally
  • Generate a Personal Access Token (PAT) from GitHub's developer settings
  • Run vercel secrets add <secret-name> <PAT>. This secret can be used in all of your Vercel projects.
  • Run vercel env add secret <secret-name>
  • Create a .env file and add <secret-name>=<PAT>
  • Run vercel dev to start the localhost server
  • Run vercel again to deploy

Replace <secret-name> with any name of your choice and <PAT> with the 40 character PAT (All without angular brackets)

Inspired by

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.