Quickstart

In this quickstart tutorial, you'll create an Inventory Management System app using one of our templates. Follow the steps below to get started.

Prerequisite

You'll need a Tailor account to start using the Tailor Platform. Contact us here to get started.

Install Tailor CLI

tailorctl is a command-line utility that enables you to interact with the Tailor Platform, from creating your workspace to deploying applications. To install tailorctl, run the following command.

brew install tailor-platform/tap/tailorctl

Option 1: Download .exe file

Visit the Tailorctl release page.
Download the latest version of tailorctl for the Windows operating system.

Option 2: Install with Aqua

Aqua is a declarative CLI version manager. First install Aqua, then install tailorctl:

# Install tailorctl with Aqua
aqua install tailor-platform/tailorctl

Install Terraform

Terraform is an infrastructure-as-code tool designed to help you create, modify, and manage infrastructure securely and effectively. You can see the Tailor Platform Provider documentation here.

brew install hashicorp/tap/terraform

Visit the Install Terraform page.
Download the latest version of Terraform for the Windows operating system that matches your CPU architecture.

Install Tailor CLI

CUE is a powerful configuration language that allows you to evaluate and validate your application's configuration.

brew install tailor-platform/tap/tailorctl

Option 1: Download .exe file

Visit the Tailorctl release page.
Download the latest version of tailorctl for the Windows operating system.

Option 2: Install with Aqua

Aqua is a declarative CLI version manager. First install Aqua, then install tailorctl:

# Install tailorctl with Aqua
aqua install tailor-platform/tailorctl

Install Cue

CUE is a powerful configuration language that allows you to evaluate and validate your application's configuration.

brew install cue-lang/tap/cue

Visit the Cue release page.
Download the latest version of Cue for the Windows operating system that matches your CPU architecture.

1. Log in to the Tailor Platform with SSO.

Run the following command to log in to the Tailor Platform using your account information:

tailorctl auth login
tailorctl.exe auth login

Once you run this command, your browser will open and you'll be prompted to log in to the Tailor Platform with your SSO account. Please sign in with your email address and password. Your initial password has been sent to you upon account creation. If you haven't received it, please check your spam folder or contact us for assistance.

2. Clone our app templates

Tailor provides a template of the application. Clone the templates repo.

git clone git@github.com:tailor-platform/templates.git
cd templates/sample-inventory-management

If you don't have Git, please visit official Git website. Click on "Download" and select the Windows version.

git clone https://github.com/tailor-platform/templates.git
cd templates/sample-inventory-management

Tailor provides a template of the application. Clone the templates repo and navigate to the application directory.

git clone git@github.com:tailor-platform/templates.git
cd templates/ims

If you don't have Git, please visit official Git website. Click on "Download" and select the Windows version.

git clone https://github.com/tailor-platform/templates.git
cd templates/ims

3. Set up app configuration

Update region

Navigate to the workspace.tf file and update the region attribute to match the region suitable for your location. Currently, we support two regions: us-west and asia-northeast.

resource "tailor_workspace" "ims" {
  name   = "ims"
  region = "us-west" # Replace "us-west" with your preferred region
}

output "workspace" {
  value = tailor_workspace.ims.id
}

Initialize app configuration

Run the following command to prepare your Terraform working directory by configuring the backend and installing providers.

terraform init
terraform init

Create a workspace in Tailor Platform

To build your app with Tailor Platform, start by creating a workspace on the platform.

# Replace `${your_workspace_name}` with the desired values.
tailorctl workspace create --name ${your_workspace_name} --region us-west
# Replace ${your_workspace_name} with the desired values.
tailorctl.exe workspace create --name ${your_workspace_name} --region us-west

Generate app configuration

To generate configuration files, let's first synchronize the local cue.mod files with tailorctl. Then, generate a UUID and inject it into environment/env.cue. This UUID will be used to seed data into the application.

tailorctl manifest tidy
sed -i "" "s/{{UUID}}/$(uuidgen)/g" environment/env.cue
tailorctl.exe manifest tidy
(Get-Content -Path "environment\env.cue") -replace "\{\{UUID\}\}", [guid]::NewGuid().ToString() | Set-Content -Path "environment\env.cue"

4. Deploy the app

Apply the configuration to create a workspace and deploy the app.

terraform apply 
terraform apply 

The workspace.cue file contains application configurations. You can apply them to complete the setup.

tailorctl workspace apply -m ./workspace.cue
tailorctl.exe workspace apply -m ./workspace.cue

5. Confirm the deployed app

Use the following command to interactively configure the workspace, and select the one created for the application to open it.

tailorctl config set -i
tailorctl.exe config set -i

Open the GraphQL Playground for the application using the following command. The GraphQL Playground allows you to run GraphQL queries to Tailor Platform services.

# The `-n` flag specifies the application name. In this quickstart, the default name is `ims`.
tailorctl workspace app open -n ims
# The `-n` flag specifies the application name. In this quickstart, the default name is `ims`.
tailorctl.exe workspace app open -n ims

6. Get the access token to use the GraphQL API in the playground

To get an access token to use the GraphQL API in the playground, run the following command.

tailorctl workspace machineuser token -a ims -m admin-machine-user
tailorctl.exe workspace machineuser token -a ims -m admin-machine-user

In this case, we use the admin-machine-user machine user which is predefined in this template to get the access token. Once you get an access token, you can use it in the playground to run queries.
Please set the token in the Headers section of the playground as follows:

{
  "Authorization": "bearer ${your_access_token}"
}

For apps created using CUE: Please refer to the README for detailed information about this template and instructions on seeding initial data for your application.

Further information

Congratulations on creating your first app in the Tailor Platform! Here are some next steps to help you continue learning: