{"id":15530957,"url":"https://github.com/wtrocki/rhmap-storage-service","last_synced_at":"2025-11-11T23:33:45.151Z","repository":{"id":149982542,"uuid":"77345626","full_name":"wtrocki/rhmap-storage-service","owner":"wtrocki","description":"RHMAP file data storage service using express and mongodb for storage","archived":false,"fork":false,"pushed_at":"2017-01-23T18:28:47.000Z","size":5996,"stargazers_count":4,"open_issues_count":3,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-23T13:09:59.712Z","etag":null,"topics":["data-storage","mongodb","storage-service","storage-solution"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/wtrocki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2016-12-25T22:44:41.000Z","updated_at":"2022-08-14T15:59:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"c60098d5-7598-451d-872e-7f86f767b58b","html_url":"https://github.com/wtrocki/rhmap-storage-service","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wtrocki/rhmap-storage-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtrocki%2Frhmap-storage-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtrocki%2Frhmap-storage-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtrocki%2Frhmap-storage-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtrocki%2Frhmap-storage-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtrocki","download_url":"https://codeload.github.com/wtrocki/rhmap-storage-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtrocki%2Frhmap-storage-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283950016,"owners_count":26921648,"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","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["data-storage","mongodb","storage-service","storage-solution"],"created_at":"2024-10-02T11:24:30.230Z","updated_at":"2025-11-11T23:33:45.136Z","avatar_url":"https://github.com/wtrocki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RHMAP File Storage Service\n\nStore and retrieve your files without hassle using mongodb gridfs storage engine.\nStorage service was designed to run on RHMAP, but it can be easly adapted to run on docker and other servers with node.js and npm installed. \n\n##  Goal\n\n- Provide abstraction for data storage\n- Allow to store and retrieve any file using simple API\n- Use mongodb and gridfs as storage solution\n\n## Technologies used:\n\n- node 4.4.x\n- express\n- mongose \n\nSee package.json for more information\n\n## RHMAP Setup\nThere are currently some workarounds needed to get the service up and running within RHMAP the platform. \n\n1. Make the newly created service public\n2. Visit the data browser, depending on your application configuration a \"Upgrade Database\" action will be available, this means the application is using an old/legacy shared database and it needs to be upgraded to use a dedicated one. Note the application needs to be first finished its initial deploy and be running to perform this task.\n3. Re-deploy the service\n4. You can now use the service under the \"Preview\" section of the studio. \n\n## Local and development setup\n\nInstall dependencies\n    \n    npm install\n\nExecute grunt \n\n    grunt serve \n\n## Web interface\n\n![](./images/mainview.png)\n\n## API\n\n### Upload files \n\u003e POST /api/files/\n\nUpload file using multipart form-data body.\n\n#### Form body:\n    \n\u003e file \n\nRepresents binary file that would be uploaded.\nExample html form element:  \n\n`\u003cinput type=\"file\" name=\"file\"/\u003e`\n    \n\u003e redirectOnSuccess\n\nIf added instead of returning json results backend would redirect to path provided as value.\nExample html form element: \n\n    `\u003cinput type=\"hidden\" name=\"redirectOnSuccess\" value=\"/\"/\u003e`\n    \n\nExample body containing both parameters:\n```\n------WebKitFormBoundaryKKdzzkCch9eo2hG0\nContent-Disposition: form-data; name=\"file\"; filename=\"yourfile.txt\"\nContent-Type: text/plain\n\n------WebKitFormBoundaryKKdzzkCch9eo2hG0\nContent-Disposition: form-data; name=\"redirectOnSuccess\"\n/\n```\n\n### Retrieve files \n\u003e GET /api/files/:filename\n\nStream uploaded file. Returns file octet stream \n\n### Delete file from database\n\n\u003e DELETE /api/files/:filename\n\nDelete uploaded file by `filename`. Object id can be also specified as filename.\n\n## Why using mongodb as storage solution\n\n- When using mongo data and files are stored in one place\n- Ability to replicate files using mongo mechanisms\n- Seamless way to backup data using existing mongo backup solutions\n- Possibility to stream data\n- Easy to monitor storage and provide alerts\n- Possible to manage and query file metadata without effort\n\n![](./images/meme.png)\n\n## Contributing\n\nSee CONTRIBUTING.md \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtrocki%2Frhmap-storage-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtrocki%2Frhmap-storage-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtrocki%2Frhmap-storage-service/lists"}