Live Service Templates
Live Service Templates provide a centralized way to create, maintain, and enforce standardized backend services through reusable templates that evolve with your organization's best practices.
Overview
Live Service Templates introduce several key components:
- Service Templates: Pre-configured templates that serve as a foundation for creating and maintaining new services that follow your organization standards and best practices.
- Template-based Services: New services created from existing templates, inheriting all settings, configurations and plugins.
- Template Management: Tools for creating, editing, and maintaining service templates, with the ability to propagate template updates automatically to the services as pull requests with the required changes.
Create a Service Template
Navigate to the Platform Console dashboard. Click on "Create Template".
The Service Template Creation Wizard will guide you through the process of setting up your template.
- Select Technologies: Choose the name and back-end framework for your template.
- Choose APIs: Select which APIs to include (REST API, GraphQL API, or both). Also, decide whether to generate an Admin UI for your templated service.
GraphQL API and Admin UI are currently not available with the .NET generator.
- Database Selection: Choose the database type for your template (e.g., PostgreSQL, MySQL, MongoDB, MS SQL Server).
After completing these steps, your new service template will be created and added to the Platform Console.
Manage Service Templates
Viewing Templates
To view and manage your templates:
- Go to the Platform Console dashboard.
- You'll see a list of all your service templates, including their name, description, code generator type, and more.
Managing Plugins
To manage plugins for your template:
- Go to the Plugins section of your service template.
- You can view all available plugins, installed plugins, or private plugins.
- To install a new plugin, select it from the available options and click "Install".
To learn more about Plugin Management and Private Plugins, visit the Plugins page and Private Plugins page.
Template Settings
The Settings tab for service templates provides various configuration options:
- General: Update the template name and description.
- APIs and Admin: Toggle different API types (REST, GraphQL) and Admin UI.
- Base Directories: Set the root directory for code placement when using the sync with Git feature. You can use
{{SERVICE_NAME}}
as a placeholder for the service name which will be generated from the template. - Code Generator Version: Select a specific version or use the latest.
While you can customize the Base Directories, we recommend keeping the {{SERVICE_NAME}}
placeholder for better organization and consistency.
Creating Services from Templates
To create a new service based on a template:
- Go to the Service Catalog of your project.
- Click "Add Resource".
- Select "Service from Template".
- Choose the desired template from the dropdown menu.
- Provide a name for your new service.
- Click "Create" to generate the new service based on the selected template.
The new service will inherit all settings and plugins from the template. You can view these inherited configurations in the Pending Changes tab.
Update Service Templates
When you update a service template:
- Make the desired changes (e.g., add new plugins, modify settings).
- Click "Publish New Version" to reach the Publish screen.
- Add a description for your changes and publish the version(s).
The template definitions will be updated, with no immediate effect on the services created from this template.
Propagate Template Changes to Services
After updating a template, the changes can be applied to existing services through the following process:
- You will receive in-product notifications and emails about available service updates.
- Access the tech debt screen and use the upgrade option for the required services.
- This will create pending changes that include all template updates, plugins, and definitions.
- Review and apply these changes by choosing to "Generate the code" to update your services.
This process will create a new commit with all the updated template configurations, plugins, and definitions.
Next Steps
Now that you've created an individual template, you can start building a comprehensive collection of templates and private plugins that reflect your organization's best practices and standards. This approach helps ensure consistency and maintainability across all your services.
For any questions or issues related to Live Service Templates, please contact our support team or join our Discord community for feedback and discussions.