{"id":18658529,"url":"https://github.com/voliveirajr/jsondiffapi","last_synced_at":"2026-04-09T11:32:55.552Z","repository":{"id":52705030,"uuid":"139235171","full_name":"voliveirajr/JsonDiffApi","owner":"voliveirajr","description":"A Flask RestAPI running in uWSGI server and MongoDB over Docker containers managed by Docker-compose","archived":false,"fork":false,"pushed_at":"2021-04-20T17:22:25.000Z","size":28,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T15:27:47.409Z","etag":null,"topics":["docker","docker-compose","flask-api","json","mongodb","uwsgi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voliveirajr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-30T09:07:21.000Z","updated_at":"2019-05-29T09:41:58.000Z","dependencies_parsed_at":"2022-08-22T10:21:37.902Z","dependency_job_id":null,"html_url":"https://github.com/voliveirajr/JsonDiffApi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voliveirajr%2FJsonDiffApi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voliveirajr%2FJsonDiffApi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voliveirajr%2FJsonDiffApi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voliveirajr%2FJsonDiffApi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voliveirajr","download_url":"https://codeload.github.com/voliveirajr/JsonDiffApi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239475962,"owners_count":19645041,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","flask-api","json","mongodb","uwsgi"],"created_at":"2024-11-07T07:33:18.622Z","updated_at":"2025-11-05T23:30:34.864Z","avatar_url":"https://github.com/voliveirajr.png","language":"Python","readme":"# JsonDiffAPI\n\nThe purpose is exercise an rest api to receive two json objects encoded in base64 and return their differences.\nThe problem requested 3 endpoints:\n\n`\u003chost\u003e/v1/diff/\u003cID\u003e/left`\n\n`\u003chost\u003e/v1/diff/\u003cID\u003e/right`\n\nTo provide documents to be compared\n\n`\u003chost\u003e/v1/diff/\u003cID\u003e`\n\nTo request the result\n\nThis application consists in a containerized Flask Rest api running aside a MongoDB container\n\n## Requirements\nThis application was developed and tested using:\n* Python 2.7.13\n* Docker 17.12.0-ce\n* Docker-compose version 1.18.0\n* Virtualenv 15.1.0\n\n## TL;DR\nif you know all setup steps just:\n\nrun `docker-compose up -d`\n\nApplication served at `http://localhost:8080`\n\n## Environment setup\nCreate a new environment with virtualenv\n\n`virtualenv env`\n\nload it\n\n`source env/bin/activate`\n\ninstall requirements\n\n`pip install -r requirements.txt`\n\n## Testing\nTests are available running this script\n`./run_tests.sh`\n\n## API Usage\nTo create a new diff object and feed with left and right documents you can curl it passing the json document coded in base64 and using an id of your choice\n\n`curl -X POST -i 'http://127.0.0.1:8080/v1/diff/111111111/left' --data eW91IHNob3VsZCBoaXJlIG1lIHRobw==`\n\n`curl -X POST -i 'http://127.0.0.1:8080/v1/diff/111111111/right' --data eW91IHNob3VsZCBoaXJlIG1lIHRobw==`\n\nTo retrieve the result you execute a get by id you defined\n\n`curl -X GET -i 'http://127.0.0.1:8080/v1/diff/111111111'`\n\n:warning: Considering the purpose of the tool, in order to save resources all requests have a TTL of 1 hour, after that they will be automatically removed from database.\n\n## Response examples\n\nThe response returned is a json object with a result element or error\n\nerror:\n\n`{ \"error\": \"Resource does not exist\" }`\n\nvalid requests examples\"\n\n`{\n    \"result\": \"objects have no difference\"\n}`\n\nwhen idenfied the differences it returns mentioning what sould be deleted, inserted and/or deleted\n\n`{\n  \"result\": {\n    \"delete\": [\n      \"test\"\n    ],\n    \"insert\": {\n      \"newfield\": \"lerolero\"\n    },\n    \"update\": {\n      \"name\": \"volmar\"\n    }\n  }\n}`\n\n## Improvements\nFollowing a list of possible improvements ordered by priority:\n* Database authentication\n* HTTP authentication\n* Nginx loadbalancing\n* Swagger UI\n* Ansible or Kubernetes automation\n    * http server horizontal scaling \u0026 MongoDB clustering\n\n## Author\n Volmar Oliveira Junior\n volmar.oliveira.jr@gmail.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoliveirajr%2Fjsondiffapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoliveirajr%2Fjsondiffapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoliveirajr%2Fjsondiffapi/lists"}