/dev-hiring-challenge

Ateliware hiring challenge for devs

Primary LanguageElixir

HighlightRepo

HighlighRepo is a fullstack application to show you the top 10 highlighted git repos languages built in Elixir, Python, Javascript, PHP and Rust.

Application deployed and available at: Gigalixir

This application was built with the stack:

Backend: Elixir (Phoenix)

Frontend: Javascript (No framework)

Database: Postgres

Environment: Docker

Note: since this project's API is using the free githup repositories API, multiple searches at the same time or too much requests in a short period may exceed the Github's rate limit per request and an error will be returned.

Installation

To use this service you'll need Elixir, Phoenix e PostgreSql.

You may want to use postgres from a docker container. For that, type the following command to create an "up and running" postgres container automatically for you docker-compose -f postgres-compose.yml up -d

  • Install dependencies by using mix deps.get
  • Setup your database structure by using mix ecto.setup
  • Initialize Phoenix locally by typing mix phx.server

Now you can visit localhost:4000 from your browser or api tool to access routes.

Tests

This application has 100% tests coverage. So in order to run follow the below:

  • Run the tests using the command mix test

  • Check tests coverage with the command mix coveralls.html

API

Here's a little bit about the api in case you want to use it alone without the frontend.

Why not? It's a open source project.

Note: Using the api, you can search for ANY languages to get highlighted repos on github

Routes

Repos Info

endpoint: /repos

type: POST

Params

  • Language to be searched on Git: language string

Body Params (JSON)

{
 "language": "elixir"
}

Response

{
  "data": [
    {
      "description": "Elixir is a dynamic, functional language designed for building scalable and maintainable applications",
      "forks": 2833,
      "name": "elixir",
      "owner": {
        "avatar_url": "https://avatars.githubusercontent.com/u/1481354?v=4",
        "name": "elixir-lang",
        "url": "https://github.com/elixir-lang"
      },
      "stars": 19799,
      "url": "https://github.com/elixir-lang/elixir"
    }
  ]
}

Get Repo

endpoint: /repo?name={name}

Params

  • Repo name: name string

type: GET

Response

{
  "description": "Elixir is a dynamic, functional language designed for building scalable and maintainable applications",
  "forks": 2833,
  "name": "elixir",
  "owner": {
    "avatar_url": "https://avatars.githubusercontent.com/u/1481354?v=4",
    "name": "elixir-lang",
    "url": "https://github.com/elixir-lang"
  },
  "stars": 19799,
  "url": "https://github.com/elixir-lang/elixir"
}