Coder Social home page Coder Social logo

github-views's Introduction

GitHub Views

โญ Features

  • Login With GitHub
  • View all time views and unique views charts for your repos
  • Share your repos views data with other users
  • Create aggregate line-charts of multiple repos
  • Email & Password authentication
  • Export data as CSV
  • Configurable time window for charts
  • Display commits as vertical markers (lines) on the repo chart
  • Cumulative charts summing the views of multiple repos into one line chart
  • Create aggregate bar-charts of multiple repos

๐Ÿš€ Deployment

Clone this repository.

In the project folder create a file called .env. This file is used to configure the variables used by Docker. There is an example file called .example.env in this repo.

The complete list of variables that have to be in your .env file is:

  • ENVIRONMENT

  • MONGO_USERNAME=

  • MONGO_PASSWORD=

  • MONGO_DATABASE=

  • ME_CONFIG_BASICAUTH_USERNAME=

  • ME_CONFIG_BASICAUTH_PASSWORD=

  • GH_CLIENT_ID=

  • GH_CLIENT_SECRET=

  • MSFT_IDENTITY_META=

  • MSFT_CLIENT_ID=

  • MSFT_CLIENT_SECRET=

  • MSFT_REDIRECT_URL=

  • MSFT_COOKIE_ENC_KEY_1=

  • MSFT_COOKIE_ENC_KEY_2=

  • MSFT_COOKIE_ENC_IV_1=

  • MSFT_COOKIE_ENC_IV_2=

  • TOKEN_ENC_KEY=

  • TOKEN_SIG_KEY=

  • MAIL_SERVICE=

  • MAIL_AUTH_TYPE=

  • MAIL_AUTH_USER=

  • MAIL_AUTH_CLIENT_ID=

  • MAIL_AUTH_CLIENT_SECRET=

  • MAIL_AUTH_ACCESS_TOKEN=

  • MAIL_AUTH_REFRESH_TOKEN=

  • MAIL_AUTH_EXPIRES=

  • MAIL_ADMINS=

  • PUBLIC_REPO_OWNERS=

  • REACT_APP_FEEDBACK_MODAL_CONTENT=

  • REACT_APP_AAD_ORGANIZATION_NAME=

MONGO_USERNAME, MONGO_PASSWORD, MONGO_DATABASE, ME_CONFIG_BASICAUTH_USERNAME, ME_CONFIG_BASICAUTH_PASSWORD values you can chose freely.

Login

With Github

Create a new GitHub OAuth application. You will need the client id and the client secret associated with this GitHub OAuth application. These will be added in the .env file as the values of GH_CLIENT_ID and GH_CLIENT_SECRET.

With Microsoft

In order to create a Microsoft Azure AD application follow the instruction in their tutorial.

The name of the Azure Tenant used in to create the app must be passed to the frontend as the env variable REACT_APP_AAD_ORGANIZATION_NAME.

Token encryption in the databse

TOKEN_ENC_KEY and TOKEN_SIG_KEY keys are used to protect the GitHub access tokens once saved in the database. Use the following commands to generate them:

$ openssl rand -base64 32
$ openssl rand -base64 64

The PUBLIC_REPOS_OWNERS variable is a space separated list of users and/or organizations whos repos will be visible by default to all users who used login with Microsoft options. Also those repos can be self-shared and are returned by the public repos endpoint.

REACT_APP_FEEDBACK_MODAL_CONTENT is a varaible for the react app (this is visible on the client code) that holds the HTML code inside the modal for the feedback button.

Install the npm dependencies and start the application.

$ cd src
$ npm i
$ cd ..
$ docker-compose up

Windows+Docker: frontend is not refreshing automatically on changes

This issue can be fixed by adding a .env file in the frontend folder with the following cotent:

CHOKIDAR_USEPOLLING=true

Visit http://loclahost:8000 and login with your GitHub account.

The tool will start collecting views data for all the repos you have access to.

๐Ÿ‘ Your contribution is awesome

Feel free to add features and this project and submit a PR. We will add you to the contributors list below.

m17336 filipgeorge CristianSabiuta

github-views's People

Contributors

alexmchp avatar alexnix avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

Watchers

 avatar

github-views's Issues

Don`t duplicate repo data if two users have GitHub access to the same repo

Currently if two users have GitHub "native" access to a repo (for example both are admins) the views data for that repo are saved twice (once for each user). Possible optimization is that the data are saved only once. This means that in the repo model instead of having a single user there must be an array of users.

A more Docker-like approach

Currently the backend needs a "npm install" from the host machine before running. This is not very in sync with the Docker philosophy where absolutely everything needs to happen in the container only.

Zombie repositories

When a repo is deleted from GitHub and no more views data are available for it move it in a new category called Zombie repositories so it does not appear on the main page anymore since it is probably not of interest any more.

Lazy data fetch

Fetch data automatically once a week, only. If a user requests it in between the 1 week interval fetch it immediately so the users don`t see any difference from the daily fetch approach.

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.