Giter VIP home page Giter VIP logo

square-of-squares-challenge's Introduction

Square of Squares - Challenge

Version: 2.0

Challenge description

Author: Vitor Marcelino

Technologies Used: Adonis Framework, NodeJs

Running

cp docker.env .env
docker-compose up -d

Live Demo

You can try a live demo here

Requests

The insomnia-workspace.json file can be imported with all the requisitions for the api. Alternatively we have the requests in CURL:

Create Territory (POST)

curl --request POST \
  --url http://square-of-squares.vitta.localhost/territories \
  --header 'content-type: application/json' \
  --data '{
  "name": "A",
  "start": { "x": 30, "y": 30 },
  "end": { "x": 40, "y": 40 }
}'

Territory List (GET)

curl --request GET \
  --url http://square-of-squares.vitta.localhost/territories

Territory Show (GET)

Optional parameter withpainted can be set to true

curl --request GET \
  --url http://square-of-squares.vitta.localhost/territories/1?withpainted=true

Territory Delete (DELETE)

curl --request DELETE \
  --url http://square-of-squares.vitta.localhost/territories/2

Squares Show by Position (GET)

curl --request GET \
  --url http://square-of-squares.vitta.localhost/squares/20/50

Squares Paint by Position (PATCH)

curl --request PATCH \
  --url http://square-of-squares.vitta.localhost/squares/30/31/paint

Dashboard

To access the dashboad access the url: http://square-of-squares.vitta.localhost/dashboard

Features in dashboard:

  • Most Painted Area
  • Most Proportional Painted Area
  • Last 5 Painted Squares
  • Last 5 Errors
  • Total Area
  • Total Painted Area
  • Percentage Painted Area:

Scaling

To scaling our project, we need to run docker command with a --scale parameter, like a example:

docker-compose up --scale app=3 -d

square-of-squares-challenge's People

Contributors

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