Giter Club home page Giter Club logo

image-upload-service's Introduction

Image-upload-service

  • Architecture
  • Documentation
  • IMPORTANT NOTE

Architecture

In the AWS console, there are the following resources:

  1. A Source S3 Bucket that will be used for the input.
  2. A Destination S3 Bucket that will be store as a destination bucket.
  3. A SQS queue that will be triggered when an object is put into s3.
  4. A SQS queue that will be a dead-letter queue that will hold failure events.
  5. A Lambda that processes the image to thumbnail and stores in destination S3 bucket.
  6. An API that can be used to upload the file.
  7. An API to download the original image.
  8. An API to download the thumbnail image.

Documentation

This project contains 3 APIs and a lambda function

Upload an image -> https://XXXXXXXXXXXXXX.execute-api.ap-south-1.amazonaws.com/dev/upload -> The images are present inside a folder called input so you can directly make use of the same, since there's no UI to specifically select an image.

download the image -> https://XXXXXXXXXX.execute-api.ap-south-1.amazonaws.com/dev/download/image?user_id=ab11ed09-03da-4d77-9b8d-6d07b5db1e5e&image_id=cat

download the thumbnail -> https://XXXXXXXXXXX.execute-api.ap-south-1.amazonaws.com/dev/download/thumbnail?user_id=ab11ed09-03da-4d77-9b8d-6d07b5db1e5e&image_id=cat A lambda which will convert the image to URL

The SQS and S3 resources are available in my personal AWS Account.

Fixed this issue: There was an issue with an external dependency in lambda W.R.T thumbnail generation, the code worked fine in local, however, in the provided time I was not able to resolve the underlying cause for the same, I have fixed this now

To run these APIs you can provide the following inputs:

Upload API:

{
    "file_name": "cat.jpg",
    "user_id": "eb2128f2-5c0a-4dd1-90a5-2f0e39db7aa3"
}

Download images APIs: The Query parameter is already provided

IMPORTANT NOTE

Please use only any of these User Ids and Use either dog or cat as Image id, since it doesn't have a database these images are stored along with the code:

USER_IDS = [
    "eb2128f2-5c0a-4dd1-90a5-2f0e39db7aa3",
    "ebe7b1c9-951b-4f92-aa42-9d65c19a8fc5",
    "ab11ed09-03da-4d77-9b8d-6d07b5db1e5e",
    "b92a45f3-147d-4829-a362-d798282a041e",
    "6edc5e55-2c2a-4e3e-8d1c-5044f6c68d09",
]

image-upload-service's People

Contributors

abutahir12 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.