{"id":22320904,"url":"https://github.com/raulil/varasto-server-cpp","last_synced_at":"2025-03-26T04:40:51.746Z","repository":{"id":265656543,"uuid":"860443221","full_name":"RauliL/varasto-server-cpp","owner":"RauliL","description":"C++17 implementation of Varasto server","archived":false,"fork":false,"pushed_at":"2024-11-30T12:12:05.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T06:32:27.108Z","etag":null,"topics":["json-database"],"latest_commit_sha":null,"homepage":"http://rauli.dev/varasto-server-cpp/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RauliL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2024-09-20T12:52:19.000Z","updated_at":"2024-11-30T12:12:30.000Z","dependencies_parsed_at":"2024-12-01T16:33:02.822Z","dependency_job_id":null,"html_url":"https://github.com/RauliL/varasto-server-cpp","commit_stats":null,"previous_names":["raulil/varasto-server-cpp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauliL%2Fvarasto-server-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauliL%2Fvarasto-server-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauliL%2Fvarasto-server-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RauliL%2Fvarasto-server-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RauliL","download_url":"https://codeload.github.com/RauliL/varasto-server-cpp/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245591622,"owners_count":20640692,"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":["json-database"],"created_at":"2024-12-04T00:15:18.110Z","updated_at":"2025-03-26T04:40:51.722Z","avatar_url":"https://github.com/RauliL.png","language":"C++","readme":"# Varasto server C++ implementation\n\nC++17 implementation of [Varasto server].\n\n[Varasto server]: https://www.npmjs.com/package/@varasto/server\n\n## Compilation\n\n```bash\n$ git submodule update --init\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make\n```\n\n## Usage\n\nCreate directory where the data will stored into, then launch `varasto-server`\nwith the directory as argument, such as:\n\n```bash\n$ mkdir data\n$ varasto-server ./data\n```\n\nBy default port `8080` will be used. This can be overridden with `-p` switch.\n\n### Storing items\n\nTo store an item, you can use a `POST` request like this:\n\n```http\nPOST /foo/bar HTTP/1.0\nContent-Type: application/json\nContent-Length: 14\n\n{\"foo\": \"bar\"}\n```\n\nOr you can use [curl] to store an item like this:\n\n```bash\n$ curl -X POST \\\n    -H 'Content-Type: application/json' \\\n    -d '{\"foo\": \"bar\"}' \\\n    http://localhost:8080/foo/bar\n```\n\n[curl]: https://curl.haxx.se/\n\nIf you want an key to the entry to be automatically generated (it will be\n[UUID]) you can omit the key from the request like this:\n\n```http\nPOST /foo HTTP/1.0\nContent-Type: application/json\nContent-Length: 14\n\n{\"foo\": \"bar\"}\n```\n\nAnd you get an response like this that contains the automatically generated\nkey:\n\n```json\n{ \"key\": \"13aa0984-af0f-11ef-a02b-2743ddb77e05\" }\n```\n\n[UUID]: https://en.wikipedia.org/wiki/Universally_unique_identifier\n\n### Retrieving items\n\nTo retrieve a previously stored item, you make an `GET` request, where the\nrequest path again acts as the identifier of the item.\n\n```http\nGET /foo/bar HTTP/1.0\n```\n\nTo which the HTTP server will respond with the JSON object previously stored\nwith namespace `foo` and key `bar`. If an item with given key under the given\nnamespace does not exist, HTTP error 404 will be returned instead.\n\n### Listing items\n\nTo list all items stored under an namespace, you make an `GET` request with\nname of the namespace as the request path.\n\n```http\nGET /foo HTTP/1.0\n```\n\nTo which the HTTP server will respond with an JSON object which contains each\nitem stored under namespace foo mapped with the key that they were stored with.\n\n```json\n{\n  \"bar\": {\n    \"foo\": \"bar\"\n  }\n}\n```\n\n### Removing items\n\nTo remove an previously stored item, you make a `DELETE` request with the\nrequest path again acting as the identifier of the item you wish to remove.\n\n```http\nDELETE /foo/bar HTTP/1.0\n```\n\nIf item with key bar under namespace foo exists, it's value will be returned\nas response. If such item does not exist, HTTP error 404 will be returned\ninstead.\n\n### Removing namespaces\n\nTo remove all entries stored under an namespace, you make a `DELETE` request\nwith the request path acting as identifier of the namespace you wish to remove.\n\n```http\nDELETE /foo HTTP/1.0\n```\n\nIf an namespace with the given identifier exists, an object containing all the\nentries that existed in the namespace will be returned as response. If such\nnamespace does not exist, HTTP error 404 will be returned instead.\n\n### Updating items\n\nYou can also partially update an already existing item with `PATCH` request.\nThe JSON sent with an PATCH request will be shallowly merged with the already\nexisting data and the result will be sent as response.\n\nFor example, you have an item john-doe under namespace people with the following data:\n\n```json\n{\n  \"name\": \"John Doe\",\n  \"address\": \"Some street 4\",\n  \"phoneNumber\": \"+35840123123\"\n}\n```\n\nAnd you send an `PATCH` request like this:\n\n```http\nPATCH /people/john-doe HTTP/1.0\nContent-Type: application/json\nContent-Length: 71\n\n{\n  \"address\": \"Some other street 5\",\n  \"faxNumber\": \"+358000000\"\n}\n```\n\nYou end up with:\n\n```json\n{\n  \"name\": \"John Doe\",\n  \"address\": \"Some other street 5\",\n  \"phoneNumber\": \"+35840123123\",\n  \"faxNumber\": \"+358000000\"\n}\n```\n\n## TODO\n\n- Caching.\n- SSL support.\n- Basic authentication support.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraulil%2Fvarasto-server-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraulil%2Fvarasto-server-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraulil%2Fvarasto-server-cpp/lists"}