Skip to content

easytopic-project/easytopic-dashboard-api

Repository files navigation

EasyTopic Dashboard API

Dashboard for EasyTopic project as Rest API

This dashboard will handle all service workers and the pipelines communication, trough RabbitMQ

About

The project uses the following libraries and tools:

  • Node AMQP Library for AMQP connection.
  • Express for routing

Usage

This server can be used with Docker and Docker compose (see docker-compose file for example). In Linux:

npm run docker # Runs docker-compose with all dependencies and configurations

Anternatively, you can run run the project in standalone mode:

npm install
npm run build
npm start

For development mode, run npm run dev.

Settings

Settings need to be passed as enviroment variables:

  • PORT: The port the application will run. Default: 3000
  • QUEUE_SERVER: RabbitMQ queue server. Default: 'localhost:5672'
  • FILES_SERVER: Node Files Server URL. Default: 'localhost:3000'
  • OCR_INPUT_QUEUE: RabbitMQ input queue name. Default: 'ocr-in'
  • OCR_OUTPUT_QUEUE: RabbitMQ input queue name. Default: 'ocr-out'
  • FILES_PATH: Folder for temporally files. Default: '/temp'

Routes

Arguments need to be send as JSON (content-type: application/json).

  • GET /pipeline/options: returns all pipeline options
  • POST /pipeline/:type: Register an new pipeline job. type is the pipeline ID, and you need to pass the input arguments.
  • GET: /pipelineObtain a list of previous pipeline jobs
  • GET /pipeline/:id: Gets the status of an pipeline job. The response is in the following format (changing the status):
{
    "type": "ocr",
    "status": "done",
    "id": 0,
    "data": {
        "file": "https://site.com/file.png",
        "id": 0
    },
    "response": {
        "file": "https://site.com/file.png",
        "id": 0,
        "ocr": "This is the first line of\nthis text example.\n\nThis is the second line\nof the same text.\n\f"
    }
}

About

Dashboard for new EasyTopic Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published