Giter Site home page Giter Site logo

theveloped / man.api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nebo15/man.api

0.0 1.0 0.0 16.46 MB

Template Rendering Engine as a Service

Home Page: http://docs.man2.apiary.io

License: MIT License

Shell 10.39% Elixir 74.54% API Blueprint 14.89% HTML 0.18%

man.api's Introduction

Templates rendering engine microservice

Deps Status Build Status Coverage Status Ebert

Man Logo

Mán stores templates (in iex, mustache) or markdown documents, renders it over HTTP API with dispatch in PDF, JSON or HTML formats.

"Mán" translates from the Sindarin as "Spirit". Sindarin is one of the many languages spoken by the immortal Elves.

Docs

Full API and installation description available on dedicated page.

Introduction

Man consists of two main parts:

  • REST API back-end that allows to manage and render Templates;
  • Management UI that simplifies configuration and management.

Use Cases

  • Rendering reports;
  • Central control over Email or/and SMS templates;
  • PDF/HTML printout forms generation;
  • Rendering HTML pages over API.

UI

UI Demo

Performance

We encourage you to perform your own tests, because synthetic results are far from real life situation. We provide them only as starting point in understanding Man's performance.

Test environment

  • MacBook Pro (15-inch, 2016)
  • CPU 2,7 GHz Intel Core i7
  • RAM 16 ГБ 2133 MHz LPDDR3
  • Man v0.1.16 and PostgreSQL v9.6.2 running in Nebo15 Docker contianers (listed below);
  • ApacheBench v2.3;
  • wkhtmltopdf v0.12.4 (with patched qt).

Results

Metric/Template Syntax Mustache Markdown Mustache with PDF format Mustache with PDF format and PDF cache enabled
Concurrency Level 50 50 50 50
Time taken for tests 8.412 sec 8.142 sec 442.214 sec 11.255 sec
Complete requests 10000 10000 10000 10000
Failed requests 0 0 0 0
Requests per second [#/sec] (mean) 1188.84 1228.25 22.61 888.52
Time per request 42.058 [ms] 40.708 [ms] 2211.070 [ms] 56.274 [ms]
Time per request (mean, across all concurrent requests) 0.841 [ms] 0.814 [ms] 44.221 [ms] 1.125 [ms]

Full console output is available in pertest.md.

PDF Output Cache

Since generating PDF is slow, Man allows to cache wkhtmltopdf output.

This cache can be used when you have less than 1000 of different templates variations (eg. markdown templates, or mustache templates but all variables are continuous or enums). To enable it simply set CACHE_PDF_OUTPUT=true in your environment.

Enabling cache when output variety is high will hurt your performance (cache will always be cold, since it's based on HTML checksum) and may lead to node crashes (ETC table may overflow).

Build history

Build history

Setup Guide

Application is configured via environment variables. List of supported keys and their default values can be found in docs/ENVIRONMENT.md.

Docker

Easiest way to deploy Man is to use docker containers. We constantly are releasing pre-built versions that will reduce time to deploy:

Heroku

Template allows to deploy Man to Heroku just in minute (and use it for free within Heroku tiers):

Deploy

Binary dependencies

wkhtmltopdf is used for HTML to PDF conversion.

License

See LICENSE.md.

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.