Skip to content

Accepts image and returns resized thumbnail through RESTful APIs

Notifications You must be signed in to change notification settings

shahleon/tegaki

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Accepts image and returns resized thumbnail through RESTful APIs

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published