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

https://github.com/librity/ignite_repo

Rocket Seat - Ignite - Elixir - Challenge 11 - A repo fetcher backend made with Phoenix and Tesla.
https://github.com/librity/ignite_repo

challenge elixir github-api phoenix rocketseat-ignite tesla-api

Last synced: 3 months ago
JSON representation

Rocket Seat - Ignite - Elixir - Challenge 11 - A repo fetcher backend made with Phoenix and Tesla.

Awesome Lists containing this project

README

        

# Rocket Seat Ignite - Repo

## Table of Contents

- [About](#about)
- [Endpoints](#endpoints)
- [Setup](#setup)
- [Bash Commands](#bash_commands)
- [Elixir Commands](#elixir_commands)
- [Libs](#libs)
- [Docs](#docs)
- [Resources](#resources)

## About

A repo fetcher backend made with Phoenix and Tesla.

## Endpoints

Built-in:

- `GET` http://localhost:4000/dashboard

`Repos`

- `GET` http://localhost:4000/api/repos/:username

## Setup

Install `Erlang`, `Elixir` and `Phoenix`.

## Bash Commands

```bash
# Create phoenix app without webpacker or html views
$ mix phx.new app_name --no-webpack --no-html

# Intall dependencies
$ mix deps.get

# Compile project
$ mix compile

# Generate linter config file
$ mix credo.gen.config

# Run linter
$ mix credo --strict

# Start Phoenix dev server on http://localhost:4000
$ mix phx.server

# Start your project as an Interactive Elixir session
$ iex -S mix

# List all configured routes
$ mix phx.routes
```

Tests

```bash
# Run tests
$ mix test

# Run tests w/ coverage report
$ mix test --cover
```

## Elixir Commands

Github client:

```elixir
> Github.Client.get_user_repos("teamon")
> Github.Client.get_user_repos("danilo-vieira")
> Github.Client.get_user_repos("librity")
```

## Libs

- https://github.com/phoenixframework/phoenix
- https://github.com/teamon/tesla

## Docs

- https://elixir-lang.org/crash-course.html

## Resources

- https://www.tutorialspoint.com/elixir/elixir_lists_and_tuples.htm
- https://stackoverflow.com/questions/29566248/how-to-use-io-inspect-on-a-long-list-without-trimming-it
- https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent