Skip to content

Micro service for generating student certificates out of SVG-templates

Notifications You must be signed in to change notification settings

tough-dev-school/diploma-generator

Repository files navigation

Diploma generator

Render bundled SVG templates to PNG images, return them by HTTP, using GET query string as template context.

Installation

$ npm ci
$ npm run dev

Usage

$ http GET http://<service.url>/homework-template.png?name=Константин Константинопольской&sex=m Authorzation:"Bearer: <YOUR-SECRET-TOKEN>

CI and Delivery

This services gets automatically deployed to heroku upon push to the master. The docker image is built on heroku's premises

How to create a new template

First, you have to create and svg image out of the mock-up. Here is an example using figma: Create an SVG using figma

Second, convert it tu utf-8. for text to become readable by a human. In MacOS or Linux: xmllint --format --encode utf-8 downloaded.svg > downloaded-readble.svg .

Third, create a text template out of the SVG, using nonjucks variable substitution and condigitional tags. Place the resulting file to the templates/ folder and voila!

About

Micro service for generating student certificates out of SVG-templates

Topics

Resources

Stars

Watchers

Forks