Coder Social home page Coder Social logo

prog-image's Introduction

Pencil Policy Server Build Status

App Structure

/src
  /controllers
  /db # db anddata models
  /enums
  /tmp # to store files locally
  /utils # helper functions
/test
  /unit # unit tests
app.js # express app
index.js # server entry point

Migrations

  • sequelize-cli is used to manage db schema migrations
  • Apply migrations env-cmd -f ./.env npx sequelize db:migrate
  • Rollback env-cmd -f ./.env npx sequelize db:migrate:undo
  • Creating migration env-cmd -f ./.env npx sequelize migration:generate --name xxxxx

Development

  • Install dependencies yarn
  • Duplicate .env.example as .env
  • run npm install -g env-cmd
  • Update env vars in .env
  • Start services env-cmd -f ./.env yarn dev

Testing

  • Start services env-cmd -f ./.env yarn test

API Diagram

sequenceDiagram
participant FE as Frontend
participant BE as Backend
participant CL as Cloud Provider

Note left of FE: Upload images
Note left of FE: POST /api/image/uplaod
Note left of FE: params:<br>{images: [{"data": "...", "type": "url"/"base64", "format_type": "png"}]}
FE->>BE: POST /api/image/upload
BE->>BE: create media
BE->>FE: 200: success: {"images": [{"id": 289}]}
BE->>CL: upload
BE->>BE: generate other formats 
BE->>BE: mark media as ready


Note left of FE: Get image
Note left of FE: Get /api/image/1?ext=png
FE->>BE: /api/image/1?ext=png
BE->>BE: Get media based on id
alt no ext query
    BE->>FE: 200: return media
else
BE->>BE: Get media media set
BE->>BE: Get media in media set with correct extention
BE->>FE: 200: return media
end

Loading

prog-image's People

Contributors

pierrekarpov avatar

Watchers

James Cloos avatar  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.