Giter Club home page Giter Club logo

github-api-client-with-django's Introduction

Building a Github api client with django

Build Status Coverage Status

Run the application

You can run the application with docker or without it. In the last case, you'll need a postgres db up. In both cases, you can visit the site at localhost:8000.

Running with Docker (Recommendable)

Execute the command below to start the application and its dependencies:

docker-compose up

Visit localhost:8000 for overview the app.

This tutorial from Docker was followed to set up the environment.

Running WITHOUT Docker

Make sure you have a postgres database. You'll probably need to change database default config.

Run the commands below:

pip install -r requirements.txt
./bin/run.sh

Visit localhost:8000 for overview the app.

Solution explanations

  • Migrations: Used migrations utility for database changes.
  • DB Model: Two tables are implemented:
    • Repo: Three fields for all information required. name is PK because is no repeatable for the required scenarios.
    • Stats: Is a table with a unique row where is stored the last request of the Api? The name of the stat is also the PK.
  • PEP 8: Passed Pycharm PEP 8 inspection. Only using bare except is warning.
  • forms: Only one form is used for the search feature.
  • Unit tests: Implemented unit tests mainly for services.py. I assume test coverage can be improved.
  • Coverage: coverage library is used, and Coveralls service is applied for easy coverage report viewing Coverage Status
  • urls.py: Two endpoints are implemented. One for each action of the user: List all repos, and search by name. Common templates and services are reused for each action.

Other considerations

  • I've used lambdas for Searcher algorithm
  • Travis has been implemented for test passing

Features NOT implemented

  • Is not possible to invert order in list
  • Ordering for results returned from cache are not ordered

Tests

You can run them with coverage:

coverage run --source=webapp manage.py test

Or without it:

python3 manage.py test

Tech debt

  • Implements test for views.py
  • Create end to end tests

Support

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.