We want a simple way for teams to save an existing document or task board as a reusable template, then spin up a fresh copy in any project with a custom name. From a user’s perspective: pick something you’ve already built, save it as a template, and later create a new doc/board from that template with one click. The new item should be independent of the original—content, lists/columns/tasks and nested structure are duplicated, not linked.

Requirements:
- Users can name templates and filter them by type (e.g., document, task_board).
- Instantiating a template creates a brand-new resource with new IDs while preserving relationships.
- All endpoints are protected with JWT.

Implementation notes (Express + PostgreSQL):
- Store templates with name, type, and a JSONB snapshot of the source structure.
- Provide endpoints:
  - POST /v1/templates to create a template from a source { name, sourceResourceId, sourceType }.
  - GET /v1/templates with optional ?type filter.
  - POST /v1/instantiate-template to create a new resource { templateId, name, destinationProjectId }.
- Return 400 for invalid input and 404 when the template doesn’t exist.