{"id":15927329,"url":"https://github.com/derveloper/kalfor","last_synced_at":"2025-10-18T19:30:21.940Z","repository":{"id":57715496,"uuid":"62494637","full_name":"derveloper/kalfor","owner":"derveloper","description":"Combine multiple HTTP GET requests into a single POST. The most simplest alternative to Facebook's GraphQL and Netflix Falcor.","archived":true,"fork":false,"pushed_at":"2021-02-18T21:35:17.000Z","size":25975,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-06T23:02:54.617Z","etag":null,"topics":[],"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/derveloper.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":"2016-07-03T12:02:59.000Z","updated_at":"2023-08-25T11:25:44.000Z","dependencies_parsed_at":"2022-09-03T08:13:37.163Z","dependency_job_id":null,"html_url":"https://github.com/derveloper/kalfor","commit_stats":null,"previous_names":["vileda/kalfor-java","vileda/kalfor"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derveloper%2Fkalfor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derveloper%2Fkalfor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derveloper%2Fkalfor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derveloper%2Fkalfor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derveloper","download_url":"https://codeload.github.com/derveloper/kalfor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237003890,"owners_count":19239524,"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":[],"created_at":"2024-10-06T23:00:49.250Z","updated_at":"2025-10-18T19:30:15.275Z","avatar_url":"https://github.com/derveloper.png","language":"Kotlin","funding_links":[],"categories":["Microservices"],"sub_categories":[],"readme":"# DISCONTINUED\n\n# kalfor\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/cc.vileda.kalfor/kalfor-library/badge.svg)](https://maven-badges.herokuapp.com/maven-central/cc.vileda.kalfor/kalfor-library)\n[![Build Status](https://travis-ci.org/derveloper/kalfor.svg?branch=master)](https://travis-ci.org/derveloper/kalfor)\n[![](https://tokei.rs/b1/github/derveloper/kalfor)](https://github.com/Aaronepower/tokei)\n[![codecov](https://codecov.io/gh/derveloper/kalfor/branch/master/graph/badge.svg)](https://codecov.io/gh/derveloper/kalfor)\n[![Dependency Status](https://www.versioneye.com/user/projects/591f41b98dcc41003af21ec7/badge.svg?style=flat-square)](https://www.versioneye.com/user/projects/591f41b98dcc41003af21ec7)\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/vert-x3/vertx-awesome#microservices)\n\nkalfor is a HTTP multiplexer microservice\n\n## what?\nkalfor transforms a single HTTP `POST` request to multiple parallel HTTP `GET` requests to a given HTTP backend\nwhich then are combined and send back to the client in a single JSON response.\n\n## why\nwhile developing frontends for REST APIs you'll face performance problems because you have to make too many requests.\nwith kalfor you can combine all your REST Calls into a single `POST` request.\nkalfor will fetch each endpoint in parallel for you and and respond all API responses in a single JSON to you.\n\n## demo instance\n\nYou can find the demo instance at https://kalfor.app.vileda.cc/combine\n\n### try it yourself\n```\n$ curl -H'Content-Type: application/json' \\\n--data '[{\"proxyBaseUrl\":\"https://api.github.com\", \"proxyRequests\":[{\"path\":\"/\", \"key\":\"github\"}]},'\\\n'{\"proxyBaseUrl\":\"https://api.spotify.com\", \"proxyRequests\":[{\"path\":\"/v1\", \"key\":\"spotify\"}]}]' \\\n'https://kalfor.app.vileda.cc/combine'\n```\n\n## api\n\n### request schema\n\nThe schema for a kalfor request\n```javascript\n{\n  \"$schema\": \"http://json-schema.org/draft-04/schema#\",\n  \"type\": \"array\",\n  \"items\": {\n    \"type\": \"object\",\n    \"properties\": {\n      \"proxyBaseUrl\": {\n        \"type\": \"string\"\n      },\n      \"headers\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"name\": {\n              \"type\": \"string\"\n            },\n            \"value\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"name\",\n            \"value\"\n          ]\n        }\n      },\n      \"proxyRequests\": {\n        \"type\": \"array\",\n        \"items\": {\n          \"type\": \"object\",\n          \"properties\": {\n            \"path\": {\n              \"type\": \"string\"\n            },\n            \"key\": {\n              \"type\": \"string\"\n            }\n          },\n          \"required\": [\n            \"path\",\n            \"key\"\n          ]\n        }\n      }\n    },\n    \"required\": [\n      \"proxyBaseUrl\",\n      \"proxyRequests\"\n    ]\n  }\n}\n```\n\nA request with all current features\n```javascript\n[\n  {\n    \"proxyBaseUrl\": \"https://api.github.com\",\n    \"proxyRequests\": [\n      {\n        \"path\": \"/\",\n        \"key\": \"github\"\n      }\n    ]\n  },\n  {\n    \"proxyBaseUrl\": \"https://api.spotify.com\",\n    \"headers\": [\n      {\n        \"name\": \"Authorization\",\n        \"value\": \"Bearer \u003cYOUR_SPOTIFY_API_KEY\u003e\"\n      }\n    ],\n    \"proxyRequests\": [\n      {\n        \"path\": \"/v1/me\",\n        \"key\": \"spotify\"\n      }\n    ]\n  }\n]\n```\n\n## installation\n\n### maven\n\n#### Add kalfor dependency\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003ecc.vileda.kalfor\u003c/groupId\u003e\n        \u003cartifactId\u003ekalfor-library\u003c/artifactId\u003e\n        \u003cversion\u003e4.0.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### gradle\n\n#### Add kalfor dependency\n```groovy\ncompile 'cc.vileda.kalfor:kalfor-library:4.0.0'\n```\n\n## Use it\n\n### create your http server\n\n```kotlin\nfun main(args: Array\u003cString\u003e) {\n    print(\"starting kalfor server...\")\n    embeddedServer(Netty, 8080) {\n        routing {\n            post(\"/combine\") {\n                val json = call.request.receive(String::class)\n                val resp = validateSchema(json)\n                        .fold({\n                            Gson().toJson(kalforPost(Gson()\n                                    .fromJson\u003cList\u003cKalforRequest\u003e\u003e(json)))\n                        }, {\n                            it.printStackTrace()\n                            it.message!!\n                        })\n                call.respondText(resp)\n            }\n        }\n    }.start(wait = true)\n}\n```\n\n### combine\n```\n$ curl -H'Content-Type: application/json' \\\n--data '[{\"proxyBaseUrl\":\"https://api.github.com\", \"proxyRequests\":[{\"path\":\"/\", \"key\":\"github\"}]},'\\\n'{\"proxyBaseUrl\":\"https://api.sipgate.com\", \"proxyRequests\":[{\"path\":\"/v1\", \"key\":\"sipgate\"}]}]' \\\n'http://localhost:8080/combine'\n{\n    \"github\": {\n        \"current_user_url\" : ...,\n        ...\n    },\n    \"sipgate\" : {\n        \"authorizationOauthClientsSecretUrl\" : ...,\n        ...\n    }\n}\n```\n\n#### headers\nkalfor is able to send specific headers to each backend. Just provide a list of headers in your request JSON\n\n```\n$ curl -H'Content-Type: application/json' \\\n--data '[{\"proxyBaseUrl\":\"https://api.github.com\", \"proxyRequests\":[{\"path\":\"/\", \"key\":\"github\"}]},'\\\n'{\"proxyBaseUrl\":\"https://api.spotify.com\", \"headers\":[{\"name\":\"Authorization\", \"value\": \"Bearer \u003cYOUR_SPOTIFY_API_KEY\u003e\"}], '\\\n'\"proxyRequests\":[{\"path\":\"/v1/me\", \"key\":\"spotify\"}]}]' \\\n'http://localhost:8080/combine'\n```\n\n## license\n```\nCopyright 2016 Tristan Leo\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderveloper%2Fkalfor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderveloper%2Fkalfor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderveloper%2Fkalfor/lists"}