JC
Back to all projects
Sticker Generation System Using AWS Lambda, Custom Docker Image, and Step Functions

Backend & Cloud · 2022

Sticker Generation System Using AWS Lambda, Custom Docker Image, and Step Functions

Developed a serverless sticker generation system for shipment companies using AWS Lambda with a custom Docker image to handle complex image processing tasks. The system generated shipment stickers in PDF format using SVG templates as the base for the layout, with additional detai

AWS Lambda

Developed a serverless sticker generation system for shipment companies using AWS Lambda with a custom Docker image to handle complex image processing tasks. The system generated shipment stickers in PDF format using SVG templates as the base for the layout, with additional details like barcodes, data matrix codes, and shipment-specific information**. AWS Step Functions were integrated to orchestrate the process, ensuring smooth workflows for generating and managing the stickers.

What I delivered:

  • Custom Docker Image for Lambda:
  • SVG Template for Sticker Layout:
  • Sticker Details:
  • PDF Output Generation:
  • Step Functions Integration:

Result: The system allowed shipment companies to dynamically generate PDF stickers based on SVG templates with detailed shipment information. The solution was highly scalable, leveraging AWS Lambda with a custom Docker image to process stickers efficiently, while AWS Step Functions handled complex workflows. The final PDF stickers were print-rea


Overview
Developed a serverless sticker generation system for shipment companies using AWS Lambda with a custom Docker image to handle complex image processing tasks. The system generated shipment stickers in PDF format using SVG templates as the base for the layout, with additional details like barcodes, data matrix codes, and shipment-specific information**. AWS Step Functions were integrated to orchestrate the process, ensuring smooth workflows for generating and managing the stickers.

Key Features & Responsibilities:

  • Custom Docker Image for Lambda:
    • Created a custom Docker image to include necessary packages such as Pillow, CairoSVG, and pyBarcode for processing sticker data and rendering the final output as PDF.
  • SVG Template for Sticker Layout:
    • Utilized SVG templates as the base for the sticker design, allowing flexibility in layout and ensuring that all elements like barcodes, text, and images were placed accurately.
    • Dynamically populated the SVG templates with real-time shipment data such as tracking numbers, destination addresses, and custom logos.
  • Sticker Details:
    • Barcodes: Integrated pyBarcode to generate barcodes and data matrix codes necessary for shipment tracking.
    • Map Location: Embedded a small map indicating the shipment destination using API integration to fetch map data.
    • Populated additional details like shipment codes, company logos, and addresses from the API response into the SVG template.
  • PDF Output Generation:
    • Converted the customized SVG template into a PDF file using CairoSVG to ensure that the final sticker output was suitable for printing.
    • Ensured that the PDF maintained the high-quality vector properties of the SVG, making it scalable and print-ready.
  • Step Functions Integration:
    • Leveraged AWS Step Functions to manage the overall workflow, orchestrating tasks such as retrieving shipment data, generating barcodes, and creating the final PDF sticker.
    • Set up robust error handling to ensure smooth execution and retries in case of failures during any step of the process.
  • End-to-End Workflow:
    • Input images and data were processed through the AWS API Gateway, and the system passed the information to Lambda functions for sticker generation.
    • Each sticker was processed and converted from SVG to PDF, which was then stored in AWS S3 for secure access and distribution.
    • Step Functions orchestrated the process, ensuring each stage—data processing, barcode generation, and PDF output—was completed correctly.

Technologies & Tools:

  • AWS Lambda with Custom Docker Image: Lambda executed image and PDF generation using custom Docker to include necessary libraries.
  • Pillow and CairoSVG: Managed the processing of the sticker's graphical components and conversion from SVG to PDF.
  • pyBarcode: Created barcodes and data matrix codes required for shipment tracking.
  • AWS Step Functions: Orchestrated the multi-step workflow for generating the stickers.
  • API Gateway: Exposed the sticker generation service as a REST API for external use.
  • AWS S3: Stored the generated PDF stickers for easy access and retrieval.

Skills Applied:

  • Docker Image Creation: Built and optimized Docker images for AWS Lambda to support the SVG to PDF conversion process.
  • SVG Template Manipulation: Designed and populated SVG templates with dynamic shipment data.
  • PDF Generation: Converted populated SVGs into high-quality PDF stickers ready for printing.
  • AWS Step Functions: Used Step Functions to orchestrate the entire workflow, ensuring each task in the sticker generation process was handled efficiently.
  • Barcode and Data Matrix Creation: Dynamically generated barcodes and data matrix codes to ensure accurate tracking for shipments.
  • Serverless Architecture: Utilized AWS Lambda and Step Functions to create a scalable, cost-effective solution for generating shipment stickers.

Outcome
The system allowed shipment companies to dynamically generate PDF stickers based on SVG templates with detailed shipment information. The solution was highly scalable, leveraging AWS Lambda with a custom Docker image to process stickers efficiently, while AWS Step Functions handled complex workflows. The final PDF stickers were print-ready, containing barcodes, shipment details, and map locations to streamline the shipping process.