HEAD
Certificate Template Studio for Sri Lankan Embassies and Consulates. This tool streamlines printing of birth certificates that are often prepared manually (with Excel and eyeballing alignment). It provides a precise, millimeter-accurate template editor, CSV-driven data filling, and a WYSIWYG print preview so officers can produce consistent, professional certificates faster and with fewer errors.
Note: This is a community-built project intended to assist Sri Lankan government missions abroad. It is not an official government product. Always validate outputs against your mission’s standards and policies before issuance.
- Millimeter-precision canvas with rulers and grid for exact alignment
- Built-in pages for the full workflow: Client (Front/Back), Embassy (Front/Back), Sri Lanka (Front/Back)
- Multi-select, copy/paste, bulk drag, and Undo (Ctrl/Cmd+Z)
- Background image overlay for aligning to scanned/official templates (with opacity control)
- CSV import to create/update fields by page and title
- Print dialog with live WYSIWYG preview (A4/Letter/Legal)
- Local template manager with import/export to JSON
- 100% client-side (no backend); data persists locally
- Design certificate pages with boxes positioned and sized in millimeters.
- Optionally add a faint background image of your official form to align fields precisely.
- Import a CSV such as:
Page,Field Title,Field Contentto auto-create/update fields. - Use the Test Print dialog to preview and print a page at true scale.
- Save, export, and import templates to share across workstations.
- Vite + React + TypeScript
- Tailwind CSS + shadcn/ui components
- react-konva for millimeter-accurate canvas rendering
- Local storage for persistence, no server required
src/components/TemplateEditor.tsx– core millimeter canvas editor with rulers, grid, background image, drag/resize, undosrc/components/CSVImport.tsx– CSV parser to create/update fields per pagesrc/components/TemplateManager.tsxandTemplateImportExport.tsx– save/load templates, JSON import/exportsrc/pages/Index.tsx– main tabs UI
Prerequisites: Node.js 18+ (Node 20 recommended).
# 1) Install deps
npm install
# 2) Start dev server
npm run dev
# 3) Build for production
npm run build
# 4) Preview production build locally
npm run previewThe build output is a static site in dist/ and can be hosted on any static host (GitHub Pages, Cloudflare Pages, Netlify, Vercel, S3, etc.).
This repository includes a ready-to-use GitHub Actions workflow: .github/workflows/deploy.yml.
What it does:
- Builds the project with the proper base path for repository pages
- Adds a SPA fallback (
404.html) so deep links work - Publishes the
dist/folder to GitHub Pages automatically on pushes tomain
Steps:
- Push this repository to GitHub (public recommended)
- Go to Settings → Pages → Build and deployment → Source: “GitHub Actions”
- Ensure your default branch is
main(or update the workflow trigger) - Commit and push; the site will auto-deploy.
Base path configuration:
- The Vite config reads
BASE_PATHat build time. The workflow sets it to/<repo>/so assets resolve correctly underhttps://<user>.github.io/<repo>/. - If you are deploying to a user/org site (e.g.,
<user>.github.io), setBASE_PATHto/.
Manual build with a base path:
$env:BASE_PATH = "/<your-repo>/"
npm run build-
Vercel: Import the repo, set framework to Vite (auto-detected). No special config needed.
BASE_PATHcan be/. -
Netlify: Build command
npm run build, publish directorydist. Add a redirect for SPA:Create
public/_redirectswith:/* /index.html 200
- This app runs fully in the browser and stores templates locally.
- No form data is uploaded to a server by this app.
- Ensure that any CSVs or background images you use comply with your mission’s data policies.
This software is provided “as is”, without warranty of any kind. It is not an official product of the Government of Sri Lanka. Users are responsible for verifying correctness and compliance with consular/embassy standards before issuing documents.
- Data merge automation across pages
- Multi-language/localization
- Field-level validation and formatting presets
- Role-based access (if a backend is introduced)
Issues and pull requests are welcome. For larger changes, please open an issue first to discuss the approach.
MIT License. See LICENSE (or set one if absent).

