Git Product home page Git Product logo

ascii-less-gallery's Introduction

What

Ascii-less-gallery is a sample project combining AWS Lambda functions, Serverless framework and Kotlin language. It was inspired by serverless-photo-recognition github project. Intention was to try to setup project that use AWS Lambda functions with minimal effort - everything thanks to Serverless framework

Build codecov

Features

  • custom authorization leveraging redis for caching user access tokens - this reduce numbers of request (cost) to AWS DynamoDB
  • user login and registration
  • image upload and conversion to ascii
  • storing labeled images in ElasticSearch - labeling is done using AWS Rekognition service

Architecture

Architecture

Prerequisite

  1. Create ElasticSearch domain es-gallery
  2. Create Redis - due to not being able to call Redis from Lambda I decided to use redislabs free plan.
  3. One manual tweek is required to make it all work. Login to AWS Management Console and navigate to API Gateway service then on the left side select dev-ascii-less-gallery-service next Binary support and add files you want to be supporting like image/png

Installation

  1. Install and configure serverless framework (Instruction)
  2. Build project ./gradlew build
  3. Run sls deploy (I'm using dedicated account for serverless called sless and it is set in serverless.yml file). When deploy finish successfully all functions URLs will be printed in the console window.

Usage

  1. Register new user:
curl -X POST \
  https://xxxx/dev/register \
  -H 'content-type: application/json' \
  -d '{"email":"[email protected]", "password":"admin"}'
  1. Obtain user access token:
curl -X POST \
  https://xxxx/dev/login \
  -H 'authorization: Basic dGVzdEB0ZXN0LnBsOmFkbWlu'
  1. Upload image for recognition and conversion to ascii
curl -X POST \
  https://xxxx/dev/gallery \
  -H 'content-type: image/png' \
  -H 'token: eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0OTQ5NTA0NDgsImlzcyI6InRlc3RAdGVzdC5wbCJ9.Dj0itEWPE2PQ6WbeLgIWgHwslaVLWAgRlj-2scJ8Uk4'
  1. List all images
curl -X GET \
  https://xxxx/dev/gallery 
  1. User can delete his documents:
curl -X DELETE \
  https://xxxx/dev/gallery/def2c0d8-5d13-4603-83ef-79bf9e07944d \
  -H 'token: eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE0OTQ5NTA0NDgsImlzcyI6InRlc3RAdGVzdC5wbCJ9.Dj0itEWPE2PQ6WbeLgIWgHwslaVLWAgRlj-2scJ8Uk4'

ascii-less-gallery's People

Contributors

ajurasz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ascii-less-gallery's Issues

Mocking framework

Hi,

hope find you well with this cold call.

I am an author of mocking framework for Kotlin

I see you are using mockito-kotlin.

I just want you to be aware that there is solution that fully supports Kotlin and ask to try it in your new/current projects.

I can help you if you answer to this issue.

Thanks and please star it

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.