{"id":17329948,"url":"https://github.com/coderbyheart/rheactor-image-service","last_synced_at":"2025-03-27T05:43:55.277Z","repository":{"id":138005406,"uuid":"92075473","full_name":"coderbyheart/rheactor-image-service","owner":"coderbyheart","description":"An image processing backend running on AWS Lambda.","archived":false,"fork":false,"pushed_at":"2017-05-22T15:04:21.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T11:11:12.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderbyheart.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-22T16:31:12.000Z","updated_at":"2017-05-22T16:31:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"26df76e5-72a0-4a11-8a10-9d858a8d10c8","html_url":"https://github.com/coderbyheart/rheactor-image-service","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderbyheart%2Frheactor-image-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderbyheart%2Frheactor-image-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderbyheart%2Frheactor-image-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderbyheart%2Frheactor-image-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderbyheart","download_url":"https://codeload.github.com/coderbyheart/rheactor-image-service/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791927,"owners_count":20672669,"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-15T14:49:54.048Z","updated_at":"2025-03-27T05:43:55.244Z","avatar_url":"https://github.com/coderbyheart.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rheactor-image-service\n  \n[![npm version](https://img.shields.io/npm/v/@resourcefulhumans/rheactor-image-service.svg)](https://www.npmjs.com/package/@resourcefulhumans/rheactor-image-service)\n[![Build Status](https://travis-ci.org/ResourcefulHumans/rheactor-image-service.svg?branch=master)](https://travis-ci.org/ResourcefulHumans/rheactor-image-service)\n[![monitored by greenkeeper.io](https://img.shields.io/badge/greenkeeper.io-monitored-brightgreen.svg)](http://greenkeeper.io/) \n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n[![semantic-release](https://img.shields.io/badge/semver-semantic%20release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Test Coverage](https://codeclimate.com/github/ResourcefulHumans/rheactor-image-service/badges/coverage.svg)](https://codeclimate.com/github/ResourcefulHumans/rheactor-image-service/coverage)\n[![Code Climate](https://codeclimate.com/github/ResourcefulHumans/rheactor-image-service/badges/gpa.svg)](https://codeclimate.com/github/ResourcefulHumans/rheactor-image-service)\n\nAn image processing backend running on AWS Lambda.\n\nUses [gm](https://www.npmjs.com/package/gm) with GraphicsMagick (which is available by default)\non AWS lambda.\n\nIt takes JPEG or PNG images that are uploaded base64 encoded, crops and resizes them on the fly to\n256x256px size, and stores them on an S3 bucket.\n\n| Original | Result  |\n|:--------:|:-------:|\n| ![Original](./test/data/d4d4d4.jpg) | ![Result](./doc/d4d4d4-resized.jpg) |\n| JPEG  | JPEG |\n| 600x300  | 256x256 |\n| ![Original](./test/data/d4d4d4.png) | ![Result](./doc/d4d4d4-png-resized.jpg) |\n| PNG  | JPEG |\n| 600x300  | 256x256 |\n| ![Original](./test/data/11154d.jpg) | ![Result](./doc/11154d-resized.jpg) |\n| JPEG  | JPEG | \n| 300x600  | 256x256 |\n\n## Request\n\nUsers need to provide an [JsonWebToken](https://jwt.io/) which is checked against the configured public key.\n\n    POST /upload\n    Content-Type: application/vnd.resourceful-humans.rheactor-image-service.v1+json\n    Authorization: Bearer \u003ctoken\u003e\n    \n    {\n      \"$context\":\"https://github.com/ResourcefulHumans/rheactor-image-service#Upload\",\n      \"image\":\"R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\",\n      \"mimeType\":\"image/png\"\n    }\n\n## Response\n\n    Content-Type: application/vnd.resourceful-humans.rheactor-image-service.v1+json\n    \n    {\n      \"$context\":\"https://github.com/ResourcefulHumans/rheactor-image-service#UploadResult\",\n      \"url\":\"https://s3.eu-central-1.amazonaws.com/rheactor-image-service/example.com/33f24f55-e435-4198-a148-fdd1095ffa96-user-5.jpg\",\n      \"mimeType\":\"image/jpeg\"\n    }\n\nThis implementation expects token's `sub` to be an URL, which will be used to prefix and suffix URLs. \nA `sub` value of `https://example.com/user/5` was used in the example above.\n\n## Configuration\n\nThese environment variables need to be set on the lambda function:\n\n - `S3_BUCKET`  \n   Name of the S3 bucket, e.g. `rheactor-image-service` to where files are uploaded.\n - `S3_REGION`  \n   Region to use.\n - `MOUNT_URL`  \n   Public endpoint for the lamba function (as provided by API Gateway)\n - `WEB_LOCATION`  \n   Public URL for the bucket\n - `PUBLIC_KEY_FILE`  \n   Public key file in the bucket to be used for verifying tokens\n\n## Setup\n\n    npm install\n    \n    # Configure these environment variables\n    AWS_ROLE=…\n    AWS_ACCESS_KEY_ID=…\n    AWS_SECRET_ACCESS_KEY=…\n    AWS_REGION=…\n    AWS_FUNCTION_NAME=…\n    NODE_ENV=…\n    VERSION=…\n    \n    # install this as a new lambda function\n    make install\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderbyheart%2Frheactor-image-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderbyheart%2Frheactor-image-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderbyheart%2Frheactor-image-service/lists"}