{"id":22899665,"url":"https://github.com/hazratgs/online-storage","last_synced_at":"2025-06-17T19:05:41.643Z","repository":{"id":57141004,"uuid":"119969819","full_name":"hazratgs/online-storage","owner":"hazratgs","description":"⚡️Online implementation of localStorage","archived":false,"fork":false,"pushed_at":"2018-06-16T15:38:17.000Z","size":68,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T07:43:11.995Z","etag":null,"topics":["cloud","key-value","localstorage","mongodb","nodejs","online-storage","online-store","storage-api","storage-service"],"latest_commit_sha":null,"homepage":"https://storage.hazratgs.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hazratgs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-02T10:46:57.000Z","updated_at":"2023-02-15T19:07:58.000Z","dependencies_parsed_at":"2022-09-01T23:51:53.330Z","dependency_job_id":null,"html_url":"https://github.com/hazratgs/online-storage","commit_stats":null,"previous_names":["hazratgs/kurtuba-storage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazratgs%2Fonline-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazratgs%2Fonline-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazratgs%2Fonline-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazratgs%2Fonline-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hazratgs","download_url":"https://codeload.github.com/hazratgs/online-storage/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hazratgs%2Fonline-storage/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258833024,"owners_count":22764994,"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":["cloud","key-value","localstorage","mongodb","nodejs","online-storage","online-store","storage-api","storage-service"],"created_at":"2024-12-14T01:15:26.869Z","updated_at":"2025-06-17T19:05:36.630Z","avatar_url":"https://github.com/hazratgs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## online-storage\n[![npm](https://img.shields.io/npm/v/npm.svg)](https://www.npmjs.com/package/online-storage-client)\n\nThis is a cloud-key data store with a REST API interface, the database uses the NoSQL MongoDB database.\n\n**Get rid of all the complex configurations, installation scenarios and maintenance for storing your data!**\n\n### Features\n - Create token\n - Refresh token\n - Get value of a property from the storage\n - Get all storage data\n - Set key/value\n - Remove element it storage\n - Delete storage\n - Create backup\n - Get backup list\n - Restoring the vault from a backup\n\n## Getting Started\nDemand:\n - Node: v9.3.0+ \n - MongoDB: v3.6.2+\n\nClone this repository:\n\n    git clone git@github.com:hazratgs/online-storage.git\nGo to the directory:\n\n    cd online-storage\nInstall all dependencies:\n\n    npm install\nThen start MongoDB:\n###### Installation instructions for your system can be found on the [the official website of MongoDB](https://docs.mongodb.com/manual/tutorial/#installation)\nMac OS\n\n    mongod\n    \nUbuntu\n\n    sudo service mongod start\n\nAfter that you can run the repository on your working machine with the command:\n\n    node index.js\n\nFor the background work of the repository, you need to install the npm package [pm2](https://www.npmjs.com/package/pm2), you can read more about it in the corresponding repository, if you have it installed, run the command:\n\n    npm run start\n\nThat's all!\n\nFor convenience in working with the repository, you can use the kurtub-client library [online-storage-client](https://www.npmjs.com/package/online-storage-client)\n\n## API\n*All examples are given using the axios JavaScript library*\n#### Creating a token\nAll parameters (domains, backup, password) are optional:\n\n| param | description |\n|--|--|\n| domains | list of domains that can receive data from the storage, use http header \"Origin\" as verification | \n| backup | the function of storing backup copies of the storage with the subsequent possibility to return to one of the points | \n| password | set a password if you need to protect the storage from being written by third-party users |\n\n```js\naxios.post('https://storage.hazratgs.com/create', {\n  domains: ['example.com', 'google.com'],\n  backup: true,\n  password: 'qwerty'\n})\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"data\":{\n    \"token\": \"002cac23-aa8b-4803-a94f-3888020fa0df\",\n    \"refreshToken\": \"5bf365e0-1fc0-11e8-85d2-3f7a9c4f742e\"\n  }\n}\n```\n\u003c/details\u003e\n\n#### Writing data to storage\nTo write data to the storage, you need to transfer the data object:\n```js\naxios.post('https://storage.hazratgs.com/{token}', {\n  name: 'hazratgs',\n  age: 25,\n  city: 'Derbent'\n  skills: ['javascript', 'react+redux', 'nodejs', 'mongodb']\n})\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"message\": \"Successfully added\"\n}\n```\n\u003c/details\u003e\n\n#### Get property\n```js\naxios.get('https://storage.hazratgs.com/{token}/name')\n```\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"data\": \"hazratgs\"\n}\n```\n\u003c/details\u003e\n\n#### Get all storage\n```js\naxios.get('https://storage.hazratgs.com/{token}')\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"data\": {\n    name: 'hazratgs',\n    age: 25,\n    city: 'Derbent'\n    skills: ['javascript', 'react+redux', 'nodejs', 'mongodb']\n  }\n}\n```\n\u003c/details\u003e\n\n#### Remove property\n```js\naxios.delete('https://storage.hazratgs.com/{token}/city')\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"message\": \"Successfully deleted\"\n}\n```\n\u003c/details\u003e\n\n\n#### Delete storage\n```js\naxios.delete('https://storage.hazratgs.com/{token}')\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"message\": \"Storage deleted\"\n}\n```\n\u003c/details\u003e\n\n\n#### Get backup list storage\nIf you passed a parameter `backup` when creating a token, then your repository will have backup copies, which are created every 2 hours and stored during the day.\nIn order to get a list of active copies of the repository, send the request:\n```js\naxios.get('https://storage.hazratgs.com/{token}/backup/list')\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"data\": [\n    'Sun Mar 04 2018 19:39:42 GMT+0300 (MSK)', \n    'Sun Mar 04 2018 20:39:42 GMT+0300 (MSK)'\n  ]\n}\n```\n\u003c/details\u003e\n\n\n#### Create backup\nBackups are automatically created every 2 hours, but if you need to make a copy immediately, then this method will work for you.\nThe method has limitations, there should not be more than 999 backups, and by default 1 backup can be done within 1 minute, when trying to do more, you get an error.\n```js\naxios.post('https://storage.hazratgs.com/{token}/backup')\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true\n}\n```\n\u003c/details\u003e\n\n\n#### Restoring the vault from a backup\nTo return the store to a specific checkpoint, pass the date of the checkpoint:\n```js\naxios.post('https://storage.hazratgs.com/{token}/backup/Sun Mar 04 2018 19:39:42 GMT+0300 (MSK)')\n```\n\n \u003cdetails\u003e\n  \u003csummary\u003eView Response\u003c/summary\u003e\n\n```js \t\t \n{\n  \"status\":  true,\n  \"message\": \"Successfully restored\"\n}\n```\n\u003c/details\u003e\n\n\n\n## Test\nTests are written using Chai \u0026 Mocha and to run them use the npm script:\n\n    npm run test\n\n## License\nCode released under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazratgs%2Fonline-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhazratgs%2Fonline-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhazratgs%2Fonline-storage/lists"}