{"id":16483659,"url":"https://github.com/shpota/abcdator","last_synced_at":"2025-02-28T19:45:12.104Z","repository":{"id":78769755,"uuid":"283824850","full_name":"Shpota/abcdator","owner":"Shpota","description":"A REST API that performs math operations","archived":false,"fork":false,"pushed_at":"2020-08-02T07:09:29.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-22T23:29:39.170Z","etag":null,"topics":["algorithms","http4k","kotest","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shpota.png","metadata":{"files":{"readme":".github/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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-30T16:31:02.000Z","updated_at":"2020-08-02T07:09:31.000Z","dependencies_parsed_at":"2023-03-08T08:00:50.817Z","dependency_job_id":null,"html_url":"https://github.com/Shpota/abcdator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shpota%2Fabcdator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shpota%2Fabcdator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shpota%2Fabcdator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shpota%2Fabcdator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shpota","download_url":"https://codeload.github.com/Shpota/abcdator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241215516,"owners_count":19928499,"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":["algorithms","http4k","kotest","kotlin"],"created_at":"2024-10-11T13:14:40.265Z","updated_at":"2025-02-28T19:45:12.078Z","avatar_url":"https://github.com/Shpota.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# abcdator [![build](https://github.com/Shpota/abcdator/workflows/build/badge.svg)](https://github.com/Shpota/abcdator/actions?query=workflow%3Abuild)\nA REST API that performs math operations. Implemented as\na part of a technical interview process.\n\n## Build \u0026 Run\nIn order to build and run the application, you need to have\n`Docker` on your machine.\n\n### Build:\n```sh\ndocker build --tag abcdator .\n```\n### Run:\n```sh\ndocker run -p 8000:8000 abcdator \n```\nThe REST API of the application will be available on\nport 8000 with 3 endpoints:\n- `/calculate/base`\n- `/calculate/custom-1`\n- `/calculate/custom-2`\n\nHere are examples of `curl` queries to different substitute\nexpressions.\n\nBase:\n```sh\ncurl -X GET \"http://localhost:8000/calculate/base?A=true\u0026B=true\u0026C=false\u0026D=1.3\u0026E=1\u0026F=1\"\n```\nCustom 1:\n```sh\ncurl -X GET \"http://localhost:8000/calculate/custom-1?A=true\u0026B=true\u0026C=false\u0026D=1.3\u0026E=1\u0026F=1\"\n```\nCustom 2:\n```sh\ncurl -X GET \"http://localhost:8000/calculate/custom-2?A=true\u0026B=true\u0026C=false\u0026D=1.3\u0026E=1\u0026F=1\"\n```\n\n## Architecture\nThe application consists of a business logic layer and \nan HTTP layer.\n\nThe business logic layer operates with `predicates` and \n`formulas` abstractions which represent correspondingly\nboolean mappings like `A \u0026\u0026 B \u0026\u0026 !C =\u003e H` and numeric\nformulas like `K = D + (D * (E - F) / 25.5)`. Predicates\nand formulas can then be passed to the `execute()` function\nwhich would produce a result based on the input.\n\nThe HTTP layer is responsible for user-facing API, input validation,\nand HTTP server. It binds REST paths to the `execute()` function\nand predicates/formulas based on the selected set of rules\n(base/custom).\n\n## Technologies\nThe application is implemented in `Kotlin` using the `http4k`\nlibrary. It is built and run using `Docker`. It is covered with\n`Kotest`-based unit tests.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshpota%2Fabcdator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshpota%2Fabcdator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshpota%2Fabcdator/lists"}