Coder Social home page Coder Social logo

gh-repo-browse's Introduction

Github Repo Browser (gh-repo-browse)

Overview

This application is webapp, built in react, which can be used to search and browse Github repositories. gh-repo-browse uses the public Github API for searching the available repositories. (authentication is not required)

Run the app

For development, you can run this app by performing the following steps. Please ensure to have a current version of nodejs installed on your system first.

# clone the git repository 
git clone github.com/napisani/gh-repo-browse.git
cd gh-repo-browse


# install all dependencies using npm
npm install

# start the app in dev-mode
npm run start

# open http://localhost:3000 in a web browser

For production builds/deploys you can package this application into an nginx-based container which exposes an http server port 8080. Here are the steps for building the docker image with production-mode bundled code. Please ensure that you have a current version of docker installed on your system.

# clone the git repository 
git clone github.com/napisani/gh-repo-browse.git
cd gh-repo-browse

# this will start the multi-stage docker image build process which 
# will both build the react app and package it into the nginx contianer
docker build -t gh-repo-browse .

# start the resulting container and map 8080 to a local port
docker run -p 8080:8080 gh-repo-browse

# open a web browser to http://localhost:8080

Testing

After having cloned the project locally for development, you can also run the jest test suite by using the following commands

# run the jest tests
npm run test

# run the tests in watch mode
npm run test --watchAll

Linting

The linter can be run periodically using the following commands

# check for lint issues without fixing anything 
npm run lint

# check and fix the fixable lint issues in-place
npm run lint:fix 

How to deploy this gh-repo-browse

Since this app is packaged as a docker image, the intention is that the docker image can be published to a docker image registry and deployed to any popular hosting solution that supports docker images. Alternatively, this docker can also be easily deployed to an existing Kubernetes cluster with some supporting resources for defining the gh-repo-browse application as a deployment/service.

Technical Decisions

This app was initialized by the create-react-app script in the interest of getting an app started without a lot of manual configuration.

Two notable 3rd-party packages used to improve this project were: eslint/prettier - I configured eslint a prettier to support standard linting rules and code style across the codebase tailwind - Tailwind is a CSS utility framework which I added in hopes of making it easier to style each individual component

Structure and organization

components/ and pages/ All of the react components in this project are separated into two main categories "components" and "pages". Components are categorized as tiny, highly-reusable react components that can be used in 1 or many contexts. Conversely, pages are typically single-purpose components without properties that represent a given page/route. Page components, generally utilize many reusable components to implement a given page.

mocks/ this contains modules that export mock data used for unit testing

utils/ this contains pure-typescript modules that export common reusable types, functions etc.

Future development

Here are some ideas for future development:

  1. add a list of selectable columns to be displayed in the table ( what is displayed right now is a small subset of the API response data)
  2. improve search usability by detecting key strokes and submitting the form automatically
  3. debounce searches to ensure that rapid search submissions and sorts do not result it an too many API requests
  4. add a loading indicator when the search results are being requested

gh-repo-browse's People

Contributors

napisani avatar

Watchers

 avatar  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.