Code Monkey home page Code Monkey logo

serverless-sharp's Introduction

Serverless Sharp Image Processor

A solution to dynamically optimize and transform images on the fly, utilizing Sharp and AWS Lambda.

Documentation

Brought to you by Venveo

Who is this for?

This software is for people who want to optimize and run basic transformations (crop, scale, convert, etc) on images from an existing S3 bucket without running computationally expensive processes or servers or paying for expensive third-party services.

Serverless Sharp is a drop-in replacement for most essential features of Imgix and costs magnitudes less for most users.

How does it work?

After deploying this solution, you'll find yourself with a number of AWS resources (all priced based on usage rather than monthly cost). The most important of which are:

  • AWS Lambda: Pulls images from your S3 bucket, runs the transforms, and outputs the image from memory
  • API Gateway: Acts as a public gateway for requests to your Lambda function
  • Cloudfront Distribution: Caches the responses from your API Gateway so the Lambda function doesn't re-execute

Once deployed, a Cloudfront CDN distribution is generated that is directed to the generated API Gateway. This distribution ensures the Lambda function does not get run multiple times for the same image request.

Running Locally

This package uses Serverless to allow for local development by simulating API Gateway and Lambda.

  1. npm ci
  2. cp settings.example.yml settings.yml
  3. Configure settings.yml file
  4. Ensure you have AWS CLI configured on your machine with proper access to the S3 bucket you're using in your settings.
  5. Run serverless offline

serverless-sharp's People

Contributors

mosnar avatar jrm98 avatar proclame avatar bs-thomas avatar tyrauber avatar shsenior avatar stevemorad avatar hyandell avatar dashmug avatar dependabot[bot] avatar kylecotter avatar decafdev avatar marco-primiceri avatar

Forkers

analogrepublic

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.