{"id":21862040,"url":"https://github.com/viniciusls/enhanced-image-handler-service","last_synced_at":"2025-10-04T15:51:43.917Z","repository":{"id":42869440,"uuid":"416024968","full_name":"viniciusls/enhanced-image-handler-service","owner":"viniciusls","description":"Enhanced image handler service that generates thumbnails and evaluate image for metadata generation/analysis","archived":false,"fork":false,"pushed_at":"2025-09-29T21:34:47.000Z","size":158,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T23:38:15.259Z","etag":null,"topics":["aws","hacktoberfest","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"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/viniciusls.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-10-11T17:30:13.000Z","updated_at":"2024-08-13T22:46:24.000Z","dependencies_parsed_at":"2023-10-16T02:31:53.407Z","dependency_job_id":"1751bc50-c053-41e4-8967-afd744f67dbc","html_url":"https://github.com/viniciusls/enhanced-image-handler-service","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/viniciusls/enhanced-image-handler-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusls%2Fenhanced-image-handler-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusls%2Fenhanced-image-handler-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusls%2Fenhanced-image-handler-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusls%2Fenhanced-image-handler-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viniciusls","download_url":"https://codeload.github.com/viniciusls/enhanced-image-handler-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusls%2Fenhanced-image-handler-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278335450,"owners_count":25970129,"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-10-04T02:00:05.491Z","response_time":63,"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":["aws","hacktoberfest","terraform"],"created_at":"2024-11-28T03:13:36.186Z","updated_at":"2025-10-04T15:51:43.898Z","avatar_url":"https://github.com/viniciusls.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# enhanced-image-handler-service\n![Travis (.com) branch](https://img.shields.io/travis/com/viniciusls/enhanced-image-handler-service/main)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/viniciusls/enhanced-image-handler-service)\n![GitHub](https://img.shields.io/github/license/viniciusls/enhanced-image-handler-service)\n\nAn image uploader built on top of AWS - using Terraform - to analyze the content of uploaded images using \nClarifai IA to predict the content and saving the results to database for further use. It also generates a thumbnail \nfor each image and save it to S3.\n\n## What's used in this project?\n- **Terraform** to build Infrastructure as Code;\n- **AWS API** Gateway to provide endpoints for image uploading and data retrieve;\n- **AWS S3** to save the images and its generated thumbnails;\n- **AWS Lambda** to handle the image upload notification from S3, to generate thumbnails and to integrate with Clarifai API\nand save the results on MongoDB. Also to retrieve the results from Elasticache/MongoDB;\n- **AWS SNS** to fan-out the uploaded image notification to SQS queues;\n- **AWS SQS** to subscribe to SNS topic and call Lambdas to analyze images and generate thumbnails;\n- **AWS ElastiCache/ElasticSearch** to cache search results;\n- **MongoDB Atlas** hosted on AWS (shared) to save the analysis results;\n- **Clarifai** to analyze images and predict what's inside them.\n\n## Prerequisites\nHere's the minimum requirements for running this project smoothly:\n- [Terraform CLI](https://www.terraform.io/downloads.html)\n- [AWS CLI](https://aws.amazon.com/pt/cli/)\n- [AWS Free Tier Account](https://aws.amazon.com/pt/free/)\n- [Clarifai Community Account](https://portal.clarifai.com/signup)\n- [MongoDB Atlas Free Account](https://www.mongodb.com/cloud/atlas/register)\n\n## How to install and deploy it?\n\n1) Run `terraform init` to registry Terraform modules;\n2) Install dependencies on the following directories:\n```\ncd ./analyzer\nyarn install // or npm install\n\ncd ./handler\nyarn install // or npm install\n\ncd ./thumbnailer\nSHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install --arch=x64 --platform=linux sharp \n// we have to run this custom command to avoid execution errors when running the Lambda. Ref: https://sharp.pixelplumbing.com/install#aws-lambda.\n```\n3) Add the following environment variables to your run config or use a `.tfvars` file:\n```\nTF_VAR_analyzer_clarifai_model_id=\nTF_VAR_clarifai_api_key=\nTF_VAR_mongodb_user=\nTF_VAR_mongodb_password=\nTF_VAR_mongodb_host=\nTF_VAR_mongodb_database=\n```\nYou can reach out [www.clarifai.com](https://www.clarifai.com) and create a free Community Account to get \nan API Key and find out the Clarifai Model ID that you want to use. You can also build a custom model and use it here!\n\nAlso, this project was built to support only MongoDB at the moment as a target for analysis results. Clarifai returns a \nJSON Array containing each object/food/person/etc inside the image sent for analysis and I thought it'd be a good idea to\nuse a Document-Oriented Database. You can create a free Shared-Host account at \n[www.mongodb.com/cloud/atlas](https://www.mongodb.com/cloud/atlas).\n4) Setup [AWS CLI](https://aws.amazon.com/pt/cli/) with your credentials or use environment variables to setup your Access Key - Remember that it needs to have \nenough permission to setup your Cloud environment using these services I've mentioned above. You can use a Free Tier account on \nAWS to run this project - it's totally enough as I'm using only the basics and in some cases these resources are free forever.\n5) Run `terraform plan` and check if everything works.\n6) Run `terraform apply`, approve the changes and check if everything works.\n7) Go to your `AWS Console` and get the URL on `API Gateway` to upload your image.\n8) Voi lá! If everything went well, you should see your image on S3 along with the thumbnail (in a separated folder in the same bucket \ncalled `/thumbnails`) and the analysis results on your MongoDB database (in a Collection called `documents`).\n\n## Issues? Questions?\nFeel free to reach me out using `Issues` tab here and also on [Twitter](https://twitter.com/iviniciusls). I'll be glad to help you :)\n\n## Contribute\nYou are certainly welcome to contribute to this project and I'll be very happy to work with you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusls%2Fenhanced-image-handler-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciusls%2Fenhanced-image-handler-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusls%2Fenhanced-image-handler-service/lists"}