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.
Key features
Section titled “Key features”- 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
Page structure
Section titled “Page structure”| Route | Purpose |
|---|---|
/business/apps/certificates | Dashboard with stats, nav cards, and recent templates |
/business/apps/certificates/templates | Full template listing and management |
/business/apps/certificates/templates/[id] | Edit an individual template |
/business/apps/certificates/issued | View all issued certificates |
Data model overview
Section titled “Data model overview”The app uses types from $lib/apps/certificates/types/index.js backed by the ext_certificates database schema.
Core types
Section titled “Core types”| Type | Key fields |
|---|---|
CertificateTemplate | id, instructor_id, course_id, title, body_html, css, background_image, orientation, variables, status |
IssuedCertificate | id, template_id, user_id, instructor_id, course_id, certificate_code, data, variable_data, issued_at, status |
Composite types
Section titled “Composite types”IssuedCertificateWithTemplate— issued certificate joined with its templateIssuedCertificateWithUser— issued certificate joined with recipient profileTemplateWithCount— template with itsissued_count
Server load
Section titled “Server load”The load function calls two service functions from $lib/apps/certificates/services/index.js:
| Function | Description |
|---|---|
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.
Key components
Section titled “Key components”The dashboard has four sections:
- Stats grid — two
Cardcomponents 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
Status badges
Section titled “Status badges”Templates:
- active —
defaultvariant - inactive —
destructivevariant
Notable integrations
Section titled “Notable integrations”- 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_codefor public verification - HTML/CSS rendering — the
body_htmlandcssfields allow fully custom certificate designs, rendered as styled HTML