An open API service indexing awesome lists of open source software.

https://github.com/tejasbubane/repo_search

Simple sinatra app to show github repos by search term
https://github.com/tejasbubane/repo_search

Last synced: 7 days ago
JSON representation

Simple sinatra app to show github repos by search term

Awesome Lists containing this project

README

          

# Repo Search

Try it out: https://evening-meadow-90548.herokuapp.com/

### Problem Statement

Make a simple web app where you can display public repositories from github based on search term provided. Super simple page with input search field and result right under it.

### Setup

Install dependencies:

```sh
bundle install
```

[Create github access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) & add to `.env` file. Refer [.env-example](./.env-example).

Run the app:

```sh
bundle exec puma -C config/puma.rb
```

Run all tests:

```sh
bundle exec rspec
```

**Sidenote:** This project uses `Ruby 2.7` which [emits deprecation warnings with many libraries](https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/). Prefix all above commands with `RUBYOPT='-W:no-deprecated -W:no-experimental'` to silence them.

### Decisions

* Keep the app as minimal as possible.

* Scope of given problem statement does not require database, so don't use one.

* Use sinatra since there are only couple of routes.

* Bootstrap from CDN to reduce hassle of management of static assets within repo.

* Github search API supports pagination & returns only 30 results per page by default, did not implement pagination to limit scope & complete in minimal time.

* `rspec` for basic testing of routes & rendering.