Giter Site home page Giter Site logo

gist-browser's Introduction

Gist Browser

A single page web application built with Vue.js 3 for browsing GitHub gists.

Installation

  1. Make sure you have the latest nodejs version installed. Read installation instructions here.
  2. Clone the repository: git clone https://github.com/atiberius/gist-browser.git
  3. Install dependencies: npm install
  4. Start the development server: vite
  5. (optional) create an .env file in the root folder and add the following line: VITE_GITHUB_TOKEN=your_token_here. This will allow you to make more requests to the GitHub API. Read more about GitHub API tokens here.

Build

  1. Build the app: vite build

Features

The app opens with a search field where you can type a GitHub username and click on the 'Search' button or press Enter on the keyboard. If the user is found, his name, picture and optional bio are displayed. If the user is not found, an error message is displayed.

If the user is found, a list of his public gists is displayed in an accordion. Each gist item has:

  • a title, replaced with the description if the title is empty or [No title] if both title and description are missing
  • creation date as time elapsed, with the exact date displayed as tooltip
  • a list of GitHub users that forked it (avatar and username)
  • a list of files included in the gist.

All gists accordion items are expanded by default. For each file contained in the gist there is a foldable accordion item, with the name and the programming language badge displayed on the right hand side. Clicking on it will trigger an asynchroneous request to the GitHub API to fetch the file content and display it in a code highlight component. In the future, an additional button to copy the code in the clipboard might prove useful here.

External Components

Notes

  • Because the API calls to GitHub are made from the browser, if you are not using a github token (step 5 above), the user is limited to 60 requests per hour. This is a limitation of the GitHub API and not the app itself.
  • The forks for each gist are loaded by creating multiple threads to fetch the forks for each gist. This might pose an issue if GitHub API decides to limit the number of concurrent requests in the future.
  • To avoid contents overflow, some lists have autoscrolling: the list of gists has vertical auto scrolling and the list of forks for each gist has horizontal auto scrolling.
  • For performance reasons, the file contents for each gist are not loaded until the user clicks on the gist's title. The result is cached, to avoid making repeated requests to the GitHub API endpoint. In the future, a separate 'Refresh' button can be added to trigger refreshing the file contents.
  • The app is not responsive. It was tested on a 1920x1080 screen and it looks good. It might not look good on smaller screens.

Issues

If you find any issues with the app, please open an issue on the GitHub repository

License

This project is licensed under the terms of the MIT license.

gist-browser's People

Contributors

atiberius avatar tibifn avatar

Watchers

 avatar

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.