Skip to content

jacruzca/github_watching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GithubWatching

Tasks

  • Initial Phoenix project
  • Keep GitHub API Key in a environment variable and read it from mix config.
  • Create separate module called github_api to interact with GitHub API
  • Connect to Github API using GraphQL
  • Domain modeling using structs
  • Paginate results retrieved from API
  • Provide a way to test github_api without hitting the actual github api. (use this: https://medium.com/flatiron-labs/elixir-test-mocking-with-mox-b825a955143f)
  • Create a page for taking a github username and display a list of watching repos
  • Each retrieved repo should redirect to its github location
  • Bonus: Display starred repos
  • Bonus: Display more info about the user
  • Bonus: Deploy to Heroku

How to run it

Make sure you set the following environment variable in yous sytem: GITHUB_WATCHING_KEY. Its value must be the github api key with appropiate scopes

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Install Node.js dependencies with cd assets && npm install
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Testing it

Run:

  • mix test

Demo

Go here: https://polar-ravine-36455.herokuapp.com/

Problems and lessons

The following is the list of problems I've found developing this:

  • I still struggle creating specs. I don't understand some error that ElixirLS Dialyzer throws. I don't know if it's my code or VSCode tooling.
  • I learned how to mock modules for testing. It was easier than I thought using mox

About

Example connecting Github GraphQL to a Phoenix app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors