Giter VIP home page Giter VIP logo

orderbook's Introduction

Orderbook

Backend

The files stored at / are used by the Node.js server.

Steps to run

  • Install the dependencies npm install
  • Start the server npm run start

The server should be running on port 3000.

Frontend

The client folder contains all the code of the React.js application.

Steps to run

  • Go into the client folder cd client
  • Install the dependencies npm install
  • Build the application npm run start

You browser should open http://localhost:3001 and show the app.

Improvements

This project has been built in 4 hours so there are a few things that could be improved:

  • Add some security to the API. Currently all the endpoints can be called without any permission. Implementing an x-api-key header or a jwtToken mecanism would prevent the API from being public.
  • Increase performance. Currently every time an action is done (place or cancel an order), all the orders are fetched again from the API. In this case, there are very few orders so it doesn't cause any issue. But if there were a lot of orders, we could directly insert/remove the order in the frontend state depending on the API call result.
  • Another performance improvement would be to add some pagination to the orders endpoints (with a limit and an offset). This would allow to only fetch a few orders and then if the user wants to load more (via infinite scrolling or clicking on the next page button) we could load more orders. Also, implementing some filters such as only "ASK" orders or with an amount greater than X would allow the user to find specific orders without loading everything.
  • This app could also face concurrency issues. If several users are using the app, the changes done by one user won't be reflected in the orderbook of the other users. To improve that, we could add a websocket connexion between the server and the different frontend instances. This way, when an order is placed/cancelled, the server would be able to notify the frontend instances that there has been some changes so they can refresh the data accordingly.
  • Extend the test coverage.

orderbook's People

Contributors

nicob927 avatar

Watchers

 avatar

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.