It took me quite a while to understand the logic behind the image generation in this project. I honestly don't know why did the original maintainer took that approach.
The original approach
When an admin (GDSC Lead) creates a new certificate, certificate info is sent to the database
A request is sent to a cloudflare (cf) worker
The cf worker sends a request to the repository dispatch route
which triggers the build and deploy workflow.
The build process pulls all data from the Firebase database and generates the certificate images from them.
The website code alongside the certificate images are all pushed to the deployment server
This explains why it's instructed in the website to wait for 2 minutes as this approach roughly takes about 2 minutes to complete. But I really doubt it surviving for a long time under heavy usage.
It's also worth noting that the original maintainer might have adapted a slightly different approach since there hasn't been any signs of dispatch triggered actions on their repository.
I am currently thinking of another approach which moves the image generation to the client side. Here is how it should work.
The new approach
when an admin (GDSC Lead) creates a new certificate, certificate info is sent to the database.
when a user opens the certificate link, the data for this certificate is pulled from the server.
Then the image is generated on the client side and becomes available to download
I am not entirely sure if the new approach is applicable but if it's done then would wouldn't have to rely on cloudflare workers or GitHub actions. However, one downside of this approach is that URL preview won't work.
It took me quite a while to understand the logic behind the image generation in this project. I honestly don't know why did the original maintainer took that approach.
The original approach
build and deploy
workflow.This explains why it's instructed in the website to wait for 2 minutes as this approach roughly takes about 2 minutes to complete. But I really doubt it surviving for a long time under heavy usage.
I am currently thinking of another approach which moves the image generation to the client side. Here is how it should work.
The new approach
I am not entirely sure if the new approach is applicable but if it's done then would wouldn't have to rely on cloudflare workers or GitHub actions. However, one downside of this approach is that URL preview won't work.