Sign inSign up

rodrigodelmonte/vireal

By rodrigodelmonte

•Updated about 9 years ago

Sample app from vireal code challenge.

Image
0

200

rodrigodelmonte/vireal repository overview

⁠Code Challenge.

⁠Run app.

You need docker installed on your machine.

$ docker run -p 5000:5000 rodrigodelmonte/vireal

⁠Test app.

$ git clone [email protected]:rodrigodelmonte/vireal.git
$ cd vireal/app/
$ python run_tests.py

⁠Use the app.

⁠Create a property:
  • Resquest example:
curl -H "Content-Type: application/json" -X POST -d '{ "title": "Imovel codigo 1, com 5 quartos e 4 banheiros", "price": 1250000, "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.", "x": 870, "y": 867, "beds": 5, "baths": 4, "squareMeters": 134 }' http://localhost:5000/properties
  • Response example:
{
  "message": "Propertie success created! Id: 6713"
}

⁠To looking for a specific property:
  • Resquest example:
$ curl http://localhost:5000/properties/10
  • Response example:
{
  "baths": 2,
  "beds": 3,
  "description": "In reprehenderit sit dolor nostrud enim nisi proident non deserunt incididunt pariatur sunt. Adipisicing nisi fugiat commodo cillum ea aute anim magna eu magna duis officia.",
  "id": 10,
  "price": 661000,
  "province": "Scavy",
  "squareMeters": 64,
  "title": "Im\u00f3vel c\u00f3digo 10, com 3 quartos e 2 banheiros.",
  "x": 304,
  "y": 225
}
⁠To looking for properties from an specific area:
  • Resquest example:
$ curl -X GET "http://localhost:5000/properties?ax=200&ay=1000&bx=300&by=1000"
  • Response example:
{
    "foundProperties": 1006,
    "properties": [
        {
            "baths": 1,
            "beds": 2,
            "description": "Incididunt dolor ad proident incididunt culpa nostrud ea deserunt dolor. Tempor eiusmod elit esse adipisicing reprehenderit eiusmod mollit ex velit sunt dolor sunt.",
            "id": 5,
            "price": 560000,
            "province": "Gode",
            "squareMeters": 54,
            "title": "Imóvel código 5, com 2 quartos e 1 banheiros.",
            "x": 34,
            "y": 660
        },
        {
            "baths": 4,
            "beds": 5,
            "description": "Enim amet Lorem exercitation consectetur sunt nulla incididunt aliqua nisi do voluptate laborum. Est mollit consectetur qui velit consequat reprehenderit et adipisicing occaecat labore labore ipsum do aliquip.",
            "id": 7,
            "price": 1354000,
            "province": "Gode",
            "squareMeters": 131,
            "title": "Imóvel código 7, com 5 quartos e 4 banheiros.",
            "x": 38,
            "y": 664
        },
        {
            "baths": 4,
            "beds": 5,
            "description": "Ullamco non dolore commodo laboris excepteur officia laboris id duis do velit ullamco esse mollit. Ex sunt enim fugiat culpa mollit cupidatat do laboris magna ut proident id quis.",
            "id": 52,
            "price": 1641000,
            "province": "Scavy",
            "squareMeters": 163,
            "title": "Imóvel código 52, com 5 quartos e 4 banheiros.",
            "x": 8,
            "y": 162
        },
        ...

Tag summary

Content type

Image

Digest

Size

24.9 MB

Last updated

about 9 years ago

docker pull rodrigodelmonte/vireal