Giter Club home page Giter Club logo

tegaki's Introduction

Tegaki Service

About

This service accepts image and returns resized thumbnail through RESTful APIs. It consists of two separate applications:

  • image_resize_api : the RESTful API server, responsible for accepting new image and returning resized thumbnail
  • image_resize_worker : the worker app, responsible for getting new job from Kue work queue and resize using imagemagick

The image_resize_api RESTful API server uses the following:

  • Docker as the container service.
  • Node.js as the run-time environment to run JavaScript.
  • Express.js as the server framework.
  • Redis as the datastore for image as well as work queue.
  • Kue as the work queue.
  • Mocha as the test framework.
  • Chai as the assertion library.
  • Sinon as the stubbing library for test targets dependency stubbing.
  • chai-as-promised for asserting promise.
  • Multer for uploading image.

The image_resize_worker worker uses the following:

  • Docker as the container service.
  • Node.js as the run-time environment to run JavaScript.
  • Redis as the datastore for image as well as work queue.
  • Kue as the work queue.
  • gm as nodejs wrapper library for imagemagick
  • Mocha as the test framework.
  • Chai as the assertion library.
  • Sinon as the stubbing library for test targets dependency stubbing.
  • Proxyquire to proxy nodejs's require (Kue)

How to Install & Run

First download and install Docker Desktop or Linux equivalent.

  1. Run docker-compose up to start three containers:
    • the Node.js API server app container
    • the redis datastore container
    • the worker app container
  2. Server is accessible at http://localhost:3000 from host machine.

How to Run Tests

Tests are run outside of docker container. You should be able to run npm install followed by npm test to run everything (assuming you Node installed on your machine), commands must be run from inside root directory of respective apps

Image file storage

Uploaded images are stored in /uploads directory, Resized images are stored in /thumbs directory

tegaki's People

Contributors

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