Chingucertmaker create both Voyage Completion Certificates and for the various events Chingu sponsors, Certificates of Achievement.
Process Overview - Installation - Usage - Release History - License
For Voyage Completion Certificates it uses the completion summary data for Voyage teams that is maintained in Airtable. For Certificates of Achievement it uses data maintained in a configuration file in a configuration file in this repo.
To install this app:
git clone https://github.com/chingu-x/certmaker.git
npm i
To run the app check out the information in the 'Usage' section below.
certmaker must be defined in the Discord server and granted administrator permissions.
certmaker is a command line application (CLI). The basic command to run it is:
npm run start
- or -
node src/index.js Vnn
If you choose to run it as an npm
script be sure to first update the 'startscript to be
node src/index.js Vnn, replacing
Vnn` to match the Voyage number
for the Voyage you wish to generate certificates for.
Before running it you'll first need to update option values
in the .env
file.
.env Parm |
Description |
---|---|
Shared configuration parameters: | |
AIRTABLE_API_KEY | Airtable API key needed to access Airtable |
AIRTABLE_BASE | Airtable base id containing the table(s) to be accessed |
MAILJET_API_KEY | MailJet API key |
MAILJET_SECRET_KEY | MailJet API Secret key |
MAILJET_TEMPLATE_ID | Template identifier of the message template in Mailjet |
TYPE | The type of certificate to create - AGILE , AGILECONTENT , DISTINCTION , HACKATHON or VOYAGE |
MODE | Mode of operation. EMAIL will generate & email certificates. NOEMAIL or omitted will generate certificates, but not email them. |
COMPLETION_DATE | Date to be added to certificates (e.g. 'April 23, 2023') |
CERTIFICATE_PATH | Path for where certificates will be stored on the local computer (e.g. /Users/jim/Downloads/Chingu_V42_Certificates/) |
TEMPLATE_PATH | Path to the PDF file that's the template to be customized for each Voyager |
For Voyage Certificates: | |
VOYAGE | The Voyage name (e.g. 'V99') certificates are to be produced for. |
TEAMS | Teams certs are to be produced for. Use 'ALL' for all teams or a comma separated list of team numbers. |
For all other Certificates: | |
RECIPIENTS | Path to the JSON file containing the email & name of each recipient |
env.sample
in the root of the project contains a sample of how to set up a .env
file.
Update the .env
file as follows:
# Airtable
AIRTABLE_API_KEY=key4nOhM9fKbs94Ba
AIRTABLE_BASE=appgoC1weqBUY5EX
# Mailjet API
MAILJET_API_KEY=01e7ab43fsg6fsgh45fs3478ffh5809
MAILJET_SECRET_KEY=84fs55gsfg66hh533gfr309kkk53f2f
MAILJET_TEMPLATE_ID=123456789
TYPE=VOYAGE
# Certificate info
MODE=NOEMAIL
COMPLETION_DATE=April 23, 2023
CERTIFICATE_PATH=/Users/jim/Downloads/Chingu_V42_Certificates/
TEMPLATE_PATH=./assets/Chingu Voyage Completion Certificate (V5.0) - Template.pdf
# Voyage Filters
VOYAGE=V42
TEAMS=ALL
Next, run certmaker:
npm run start
All certificates will be added to the directory specified by the CERTIFICATE_PATH
environment variable.
Update the .env
file as follows:
# Airtable
AIRTABLE_API_KEY=key4nOhM9fKbs94Ba
AIRTABLE_BASE=appgoC1weqBUY5EX
# Mailjet API
MAILJET_API_KEY=01e7ab43fsg6fsgh45fs3478ffh5809
MAILJET_SECRET_KEY=84fs55gsfg66hh533gfr309kkk53f2f
MAILJET_TEMPLATE_ID=123456789
TYPE=VOYAGE
# Certificate info
MODE=EMAIL
COMPLETION_DATE=April 23, 2023
CERTIFICATE_PATH=/Users/jim/Downloads/Chingu_V42_Certificates/
TEMPLATE_PATH=./assets/Chingu Voyage Completion Certificate (V5.0) - Template.pdf
# Voyage Filters
VOYAGE=V42
TEAMS=01,34
Next, run certmaker:
npm run start
Certificates for Voyagers in V43 teams 01 and 34 will be added to the directory specified by the CERTIFICATE_PATH
environment variable and also emailed to them.
Update the .env
file as follows:
# Airtable
AIRTABLE_API_KEY=key4nOhM9fKbs94Ba
AIRTABLE_BASE=appgoC1weqBUY5EX
# Mailjet API
MAILJET_API_KEY=01e7ab43fsg6fsgh45fs3478ffh5809
MAILJET_SECRET_KEY=84fs55gsfg66hh533gfr309kkk53f2f
MAILJET_TEMPLATE_ID=123456789
TYPE=HACKATHON
# Certificate info
MODE=NOEMAIL
COMPLETION_DATE=December 27, 2023
RECIPIENTS=./config/2023_holiday_hackathon_recipients.json
CERTIFICATE_PATH=/Users/jim/Downloads/Holiday_Hackathon_Certificates/
TEMPLATE_PATH=./assets/Chingu Holiday Hackathon 2023 Certificate (v1.0) - Template .pdf
Next, run certmaker:
npm run start
All certificates will be added to the directory specified by the CERTIFICATE_PATH
environment variable.
You can find what changed, when in the release history
Copyright 2023 © Chingu, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.