What Are Templates?
Templates define:- Custom Fields: Specific attributes for your assets (e.g., ISBN for books, vintage year for wine)
- Field Types: Text, numbers, dates, dropdowns, checkboxes, etc.
- Validation Rules: Required fields, min/max values, patterns
- Categories: Classification for organizing templates
- Metadata: Name, description, author information
Template Structure
Templates are represented by theAssetTemplate model (from lib/data/models/asset_template_model.dart:3):
Getting Started
Plan Your Template
Before creating a template, answer these questions:
- What type of items will this template describe?
- What information is essential to capture?
- What fields will help with searching and filtering?
- Are there any standard naming conventions (like ISBN, SKU, etc.)?
Understand Custom Fields
Custom fields are the building blocks of templates. Each field has:
- Name: Display label (e.g., “Publication Year”)
- Key: Internal identifier (e.g., “publication_year”)
- Type: Data type (text, number, date, boolean, dropdown)
- Required: Whether the field must be filled
- Validation: Rules for valid input
Creating Your First Template
Let’s create a template for a book collection.Step 1: Define Basic Information
Start with the template metadata:Step 2: Add Custom Fields
Define the fields for your book template:Step 3: Test Locally
In Invenicum:- Go to Settings > Templates > Create New
- Fill in the template information
- Add your custom fields one by one
- Save as a draft
- Test by creating an asset using this template
- Verify all fields work as expected
Step 4: Publish to Marketplace
Once tested, publish your template to share with the community.Field Types Reference
Text Field
Single-line text input.maxLength: Maximum character countminLength: Minimum character countpattern: Regular expression pattern
Textarea Field
Multi-line text input for longer content.Number Field
Numeric input with optional min/max validation.min: Minimum valuemax: Maximum valuestep: Increment step (e.g., 0.01 for decimals)
Date Field
Date picker input.Dropdown Field
Select from predefined options.Boolean Field
Checkbox for true/false values.URL Field
Validated URL input.Template Categories
Organize templates by category for easier discovery:| Category | Examples |
|---|---|
| Literature | Books, magazines, comics, manuscripts |
| Electronics | Phones, laptops, cameras, accessories |
| Collectibles | Trading cards, stamps, coins, memorabilia |
| Tools | Power tools, hand tools, equipment |
| Wine & Spirits | Wine bottles, whiskey, craft beer |
| Art & Antiques | Paintings, sculptures, vintage items |
| Sports | Equipment, jerseys, memorabilia |
| Music | Vinyl records, instruments, gear |
| Gaming | Video games, consoles, accessories |
| Automotive | Car parts, motorcycles, accessories |
Template Service API
TheTemplateService (from lib/data/services/template_service.dart:5) provides methods for template management:
Get Market Templates
Retrieve all publicly available templates:Publish Template
Publish a template to the marketplace:Get User Library
Get templates created by the current user:Track Downloads
Increment download counter when template is used:Advanced Template Examples
Wine Collection Template
Camera Collection Template
Trading Card Template
Quality Guidelines
When creating templates for the marketplace:Naming
- Use clear, descriptive names
- Avoid abbreviations unless widely recognized
- Be specific (“Vintage Cameras” vs “Cameras”)
Descriptions
- Explain what the template is for
- Mention key fields included
- Keep it under 200 characters
- No marketing language
Field Design
- Order fields logically (most important first)
- Use appropriate field types
- Add descriptions for non-obvious fields
- Set reasonable validation rules
- Mark truly required fields only
Categories & Tags
- Choose the most relevant category
- Add 3-5 descriptive tags
- Use consistent tag formatting (lowercase, hyphens)
Testing
- Test with real data before publishing
- Verify all validations work correctly
- Check field order makes sense
- Ensure dropdown options are comprehensive
Publishing Your Template
Finalize Your Template
- Review all fields and validation
- Test thoroughly with sample data
- Write a clear description
- Choose appropriate category and tags
Publish to Marketplace
In Invenicum:
- Go to Settings > Templates
- Select your template
- Click “Publish to Marketplace”
- Review the submission
- Confirm publication
Best Practices
Start Simple
Start Simple
Begin with essential fields. You can always add more in updates. Too many fields overwhelm users.
Use Dropdowns Wisely
Use Dropdowns Wisely
Dropdowns are great for standardization but limit flexibility. Use them for fields with a known, limited set of options.
Think About Searching
Think About Searching
Fields users will search/filter by should be consistent (dropdowns, standardized text).
Consider Market Standards
Consider Market Standards
If your collection type has industry standards (ISBN, UPC, model numbers), include those fields.
Plan for Growth
Plan for Growth
Design templates that can evolve. Avoid overly specific fields that might not apply to all items.
Troubleshooting
Template Won’t Save
- Verify all required fields are filled
- Check for duplicate field keys
- Ensure field keys use valid characters (letters, numbers, underscores)
Validation Not Working
- Verify validation syntax matches field type
- Test with edge cases
- Check for typos in validation rules
Published Template Not Appearing
- Wait a few minutes for sync
- Verify
isPublicis set totrue - Check that category is valid
- Ensure template has at least one field
Next Steps
Plugin Development
Extend Invenicum with custom plugins
Contributing Guide
Contribute to the Invenicum project
