Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

broccoli1002/doraemon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Doraemon

Description

upload image & get image service.

The uploaded image shrinks like catching Small light.

Overview

Consits of The following four components

  • datastore
  • webserver
  • worker
  • workqueue
  • datastore

stack

[datastore]

  • redis

[webserver]

[worker]

[workqueue]

  • Rabbitmq

[datastore]

  • use docker volume

Usage

setup

  1. create network
    1. docker network create --driver bridge doranet
    2. docker network ls
  2. create volume
    1. docker volume create --name filestorage
    2. docker volume ls
  3. start service
    1. webserver
      1. cd /webserver
      2. docker-compose up
    2. workqueue
      1. cd /workqueue
      2. docker-compose up
      3. create queue
        1. Please enter in your browser http://localhost:15672/
          • ID/PASS guest/guest
        2. craete queue named task_queue
    3. worker
      1. cd /worker
      2. docker-compose up
    4. datastore
      1. cd /datastore
      2. docker-compose up

upload image

  • curl -X POST -F img=@[imagename] http://localhost:3000/image
    • e.g: curl -X POST -F img=@/tmp/doraemon/download.jpg http://localhost:3000/image

get image

GET http://localhost:3000/image/[imageID] e.g: Please enter in your browser http://localhost:3000/image/15647575116480.07167631302903654

test

  • npm test [fileName]
    • eg: npm test app.test.js

Various Issues

overall

  • way to create random_id
  • image name when save image
  • common use of components redis client
  • retry worker
  • add test mock
  • add asnapshot test

webserver

  • think of downning queue
  • think of downning redis
  • add test
    • multer test
    • get
      • target id image file is none
      • target id image file exist
  • redis transaction

worker

  • add test
    • Failure to receive id
    • when target id file is none
  • redis transaction
  • way to convert image

Memo

docker volume

failure

rappidMQ

jest

development manhour

  • 30 ~ 35h

Author

broccoli1002

About

doraemon

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors