Code Monkey home page Code Monkey logo

memiarka's Introduction

Memiarka

AWS serverless API for generating meme(s) like this one below + some basic frontend to use it.

Sample meme image

There are some moments in life when Angry Pingu is my spirit animal. When those moments combine with the desire to learn Pillow library and some AWS - this happens.

How to use it?

I just want to run it

Deployed version should be available here. (Warning, some polish ahead, but you'll manage.)

I want to deploy it myself

Frontend is just static webpage, so anything which can serve some HTML with JS and some CSS would be ok.

Backend can be deployed to AWS using SAM CLI using:

sam build --use-container

sam deploy --guided

Hovewer, some manual tweaks are required. See Known issues and limitations section.

There's an option to run and test it locally. Please refer to SAM documentation.

How it works

  1. Frontend does GET call with two meme text lines, e.g.: https://API.URL/function?firstLine=Chmura?&secondLine=A na co to komu?

  2. Call goes to the API Gateway which forwards it to Lambda function

  3. Lambda function gets meme template and font from INPUT_BUCKET, uses Pillow to add meme text and then saves it to OUTPUT_BUCKET.

  4. Caller gets URL to the produced image in JSON response.

{"memeUrl": "https://OUTPUTBUCKET.s3.amazonaws.com/93869b4a-d57e-4c00-a06a-7ca471de721c.png"}

Requirements

Known issues and limitations

Because project is still in development, there are some loose bits and pieces:

  • only Angry Pingu memes are supported right now,
  • error handling in backend code improvement.

Things that needs to be done manually:

  • API_URL in frontend's app.js,
  • input and output bucket creation,
  • input bucket needs to be populated with backend/static directory contents,
  • output bucket objects need to be public,
  • setting object lifecycle rules for output buckets is recommended,
  • lambda execution role permissions to buckets mentioned above,
  • INPUT_BUCKET and OUTPUT_BUCKET environment variables for lambda function (bucket names, not ARNs),
  • update CORS allow origin in lambda code.

... and that's all. Sorry, still learning SAM and CloudFormation.

Trivia

Memiarka is made up polish word which can mean meme generator (person or machine, female). For example, there is kucharka - female cook, tokarka - lathe and kolarka - female cyclist or sometimes road bike (depending on the context). Learn polish, it's fun!

memiarka's People

Contributors

kutzowsky 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.