Git Product home page Git Product logo

prepo-assignment's Introduction

Running the project

  • docker-compose down && docker-compose build --pull && docker-compose up
  • Importing all the WETH transfers will take some time please wait for the message "Nest application successfully started" before testing

Testing

  • Once the application has completed importing all WETH transfers you can test by adding your address to the link:
  • http://localhost:3000/transfers?address=<YOUR_ADDRESS>&limit=10&offset=0. Then visiting it. An invalid address will result in a bad request.
  • To maintain server load, limit and offset properties are mandatory
  • For testing inbound/outbound transfers you can pass the query param direction to the request for e.g. ?direction=out. Acceptable fields are 'in', 'out' or 'both'

Running locally for DEV:

  • docker run -d --name some-postgres -e POSTGRES_PASSWORD=securepassword -e POSTGRES_DB=prepo -p 5432:5432 postgres
  • npx prisma migrate dev --name init
  • npm run start:dev

Improvements:

  • Not listening for new transfers
  • Will not skip imports if a token has zero transfers thus null for blockNumber in the table
  • Import transfers on first request?
  • Push to dockerhub with transfers stored in db image?
  • Custom Offset & limit missing error instead of "message": "Validation failed (numeric string is expected)",
  • Missing upper bound restriction on limit query parameter
  • Missing tests for service layer
  • start.sh script instead of long npm start command

prepo-assignment's People

Contributors

angsin 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.