Giter Club home page Giter Club logo

swapi_viewer's Introduction

  1. How to run it
  • Go to the project root directory
  • sudo docker-compose build web
  • sudo docker-compose up

  1. Testing

python3 manage.py test tests/ --pattern="*_tests.py"


  1. Assumptions
  • SWAPI data can be modified between requests, so I can't cache home world name
  • SWAPI people endpoint returns only 10 rows from one request

  1. What should be done, but was not due to the lack of time
  • Error handling on accessing SWAPI endpoints, and error handling in general
  • The fetching view should be asynchronous so user is not blocked, while waiting for the response, plus message that report is being downloaded
  • Move it to ASGI, because with current implementation waiting time is sum of the requests times
  • Maybe 'load more' should be taking only new rows, old could be stored in the session, browser, or cache system
  • Store csv data folder name in config file
  • Better to use key-value database instead of relational db, especially because the reports are immutable
  • Split unit tests and integration
  • Load environment variables in configuration class, instead of creating dependencies in services
  • Report download status - if something went wrong, report should be marked as crashed

  1. Implementation details
  • I didn't want to store cached response between sessions, so implemented map_homeworld_to_name_with_cache which stores cache only within current reqeust closure

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.