Giter VIP home page Giter VIP logo

serverless-html-pdf's Introduction

⚡️ HTML to PDF conversion SQS Worker

This serverless app creates consumers and workers that process incoming messages from an SQS queue. The workers convert an HTML (in an S3 bucket) to a pdf which is finally uploaded to the same bucket. Additionally, this serverless project uses iopipe for lambda tracing and debugging.

Components

  • SQS Queue to hold messages
  • SNS Topic to handle CloudWatch Alarms
  • DynamoDB table to persist configuration
  • CloudWatch Schedule as cron replacement
  • Three (scale, worker, process) AWS Lambda functions

Workflow

  • CloudWatch Alarms triggered by changes in queue length post to SNS
  • SNS Topic triggers scale Lambda function
  • Function scale updates configuration in DynamoDB
  • CloudWatch Schedule invokes consumer every x minute(s)
  • Function consumer reads configuration from DynamoDB
  • Function consumer invokes worker function(s)

Getting Started

  1. yarn aws-init: script to instantiate the serverless work environment (yarn install --> create s3 bucket to store html and pdf files --> generates serverless.env.yml)
  2. yarn deploy: deploys your serverless code to AWS
  3. yarn test: trigger tests (optional)
  4. sls invoke local -f worker --stage dev --path event.json: will convert the sample html uploaded by yarn aws-init to a pdf with unique file name

Todo

  1. Fix html-pdf.spec.js test scenario
  2. Add unit tests
  3. Fix issue preventing asynchronous function tracing from appearing on iopipe

serverless-html-pdf's People

Contributors

ranimufid avatar

Watchers

James Cloos 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.