Skip to content

Certificates

The Certificates app allows instructors to design certificate templates and issue verifiable certificates to students. Templates support custom HTML/CSS, background images, dynamic variables, and landscape or portrait orientation.

  • Template designer with HTML body, custom CSS, background image, and variable support
  • Certificate issuance with unique verification codes
  • Status management for both templates (active/inactive) and issued certificates (active/revoked/expired)
  • Orientation options — landscape or portrait layout
RoutePurpose
/business/apps/certificatesDashboard with stats, nav cards, and recent templates
/business/apps/certificates/templatesFull template listing and management
/business/apps/certificates/templates/[id]Edit an individual template
/business/apps/certificates/issuedView all issued certificates

The app uses types from $lib/apps/certificates/types/index.js backed by the ext_certificates database schema.

TypeKey fields
CertificateTemplateid, instructor_id, course_id, title, body_html, css, background_image, orientation, variables, status
IssuedCertificateid, template_id, user_id, instructor_id, course_id, certificate_code, data, variable_data, issued_at, status
  • IssuedCertificateWithTemplate — issued certificate joined with its template
  • IssuedCertificateWithUser — issued certificate joined with recipient profile
  • TemplateWithCount — template with its issued_count

The load function calls two service functions from $lib/apps/certificates/services/index.js:

FunctionDescription
listTemplates(userId)Returns all certificate templates for the instructor
listAllIssuedByInstructor(userId)Returns all certificates issued by the instructor

Stats are derived from the returned arrays: templateCount = templates.length and issuedCount = issued.length.

The dashboard has four sections:

  • Stats grid — two Card components showing template count and issued count
  • Navigation cards — two cards linking to Templates and Issued Certificates sub-pages
  • Recent templates list — shows up to 5 templates with title, description, and status badge
  • Empty state — prompt to create the first template

Templates:

  • activedefault variant
  • inactivedestructive variant
  • Courses app link — templates can be associated with a specific course_id, enabling automatic certificate issuance on course completion
  • Verification codes — each issued certificate gets a unique certificate_code for public verification
  • HTML/CSS rendering — the body_html and css fields allow fully custom certificate designs, rendered as styled HTML