https://github.com/tough-dev-school/diploma-generator
Generating student certificates out of SVG templates
https://github.com/tough-dev-school/diploma-generator
express nodejs puppeteer
Last synced: about 1 year ago
JSON representation
Generating student certificates out of SVG templates
- Host: GitHub
- URL: https://github.com/tough-dev-school/diploma-generator
- Owner: tough-dev-school
- Created: 2021-09-13T13:24:15.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-02-21T10:57:44.000Z (over 1 year ago)
- Last Synced: 2025-04-09T02:12:44.126Z (over 1 year ago)
- Topics: express, nodejs, puppeteer
- Language: JavaScript
- Homepage:
- Size: 48.8 MB
- Stars: 14
- Watchers: 0
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Diploma generator
Render bundled SVG templates to PNG images, return them by HTTP, using
GET query string as template context.
## Installation
```sh
$ npm ci
$ npm run dev
```
## Usage
```sh
$ http GET http:///homework-template.png?name=Константин Константинопольской&sex=m Authorzation:"Bearer:
```
## CI and Delivery
This services gets automatically deployed to heroku upon push to the master. The docker image is built on [heroku's premises](https://devcenter.heroku.com/articles/build-docker-images-heroku-yml)
## 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:

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](https://mozilla.github.io/nunjucks/templating.html#variables) and [condigitional tags](https://mozilla.github.io/nunjucks/templating.html#if). Place the resulting file to the templates/ folder and voila!