Create certificates in PDF with the PDF Generator API.
- OpenAPI Schema (open in Swagger Editor)
- Local Server docs
For running locally, make a copy of .env.local.example to .env.local
cp .env.local.example .env.localAssign the following variables:
- CERTIFICATES_PORT: Port for the server to listen on
- MAX_IMAGE_FILE_SIZE_MB: Maximum size of uploaded files for memory storage in MB
- PDF_GENERATOR_WORKSPACE_ID: PDF Generator API - workspace identifier
- PDF_GENERATOR_API_KEY: PDF Generator API - API Key
- PDF_GENERATOR_API_SECRET: PDF Generator API - API Secret
- PDF_GENERATOR_CERTIFICATE_TEMPLATE_ID: ID of the template to use as the certificate template
- provided template must support the fields
- date: string (YYYY-MM-DD)
- subject: string
- signature_name: string
- student_name: string
- image: string (an image URL)
- provided template must support the fields
- node: >= v22.10.0
- npm: >= v11.0.0
- Docker Engine: >= 26.1.5
Clone the repository
git clone https://github.com/abilondias/certificates.git
cd certificatesInstall dependencies
npm iCreate the database
npm run db:createStart development server
npm run devAccess at: http://localhost:3000
Before running the start up command, assign the environment variables in .env.local
Start up with docker-compose
docker-compose --file docker-compose.dev.yaml up --watch --buildFlags:
- --watch: for development, to synchronize file updates using the watch config in docker-compose.dev.yaml
- --build: ensure images are built
Access at: http://localhost:3000
Requires the server to be running at localhost:3000 with either the local setup, or Docker.
To run using a production build of the front-end code with Docker compose
docker-compose --file docker-compose.e2e.yaml up --builddocker-compose.e2e.yaml uses the main Dockerfile to generate the image, and loads the environment variables from
.env.local
Run Playwright tests
npm run test:e2eRun Playwright tests with trace enabled
npm run test:e2e:traceCheck stored certificate information
npm run db:check
# If running on docker
docker exec -it CONTAINER_ID npm run db:checkGenerate API server docs
npm run docs:server:generateServe the generated docs
npm run docs:server:serveAccess at: http://localhost:8888
