Quickstart

To get started with building applications on Tailor Platform, you can log in to Tailor Console. There, you will find a step-by-step guide to create a workspace and an application. The console is your gateway to enhanced development capabilities. You can explore and analyze data models effortlessly, visualize pipelines seamlessly, and utilize our interactive playground to run queries with ease.

Here is a quick look at the console.

Tailor Console

In this quickstart tutorial, you'll create an inventory tracker app using one of our app 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. Note: currently only macOS is supported.

<span><span style="color: var(--shiki-token-function)">brew</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">install</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">tailor-platform/tap/tailorctl</span></span>
<span></span>

Install Cue

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

<span><span style="color: var(--shiki-token-function)">brew</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">install</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">cue-lang/tap/cue</span></span>
<span></span>

1. Log in to the Tailor Platform with SSO.

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

<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">auth</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">login</span></span>
<span></span>

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. Create a workspace in Tailor Platform

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

<span><span style="color: var(--shiki-token-comment)"># Replace `${your_workspace_name}` with the desired values.</span></span>
<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">workspace</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">create</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">--name</span><span style="color: var(--shiki-color-text)"> ${your_workspace_name} </span><span style="color: var(--shiki-token-string)">--region</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">us-west</span></span>
<span></span>

Note: Currently, we support two regions us-west and asia-northeast.

3. Clone our app templates

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

<span><span style="color: var(--shiki-token-function)">git</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">clone</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">git@github.com:tailor-platform/templates.git</span><span style="color: var(--shiki-color-text)"> </span></span>
<span><span style="color: var(--shiki-token-function)">cd</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">templates/inventory_tracker</span></span>
<span></span>

4. 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.

<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">manifest</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">tidy</span></span>
<span><span style="color: var(--shiki-token-function)">sed</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">-i</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">&quot;&quot;</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">&quot;s/{{UUID}}/$(</span><span style="color: var(--shiki-token-function)">uuidgen</span><span style="color: var(--shiki-token-string-expression)">)/g&quot;</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">environment/env.cue</span></span>
<span></span>

5. Deploy the app

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

<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">workspace</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">apply</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">-m</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">./workspace.cue</span></span>
<span></span>

6. Confirm the deployed app

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

<span><span style="color: var(--shiki-token-comment)"># The `-n` flag specifies the application name. In this quickstart, the default name is `inventory-tracker`.</span></span>
<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">workspace</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">app</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">open</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">-n</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">inventory-tracker</span></span>
<span></span>

7. 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.

<span><span style="color: var(--shiki-token-function)">tailorctl</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">workspace</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">machineuser</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">token</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">-a</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">inventory-tracker</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">-m</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string)">admin-machine-user</span></span>
<span></span>

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:

<span><span style="color: var(--shiki-color-text)">{</span></span>
<span><span style="color: var(--shiki-color-text)">  </span><span style="color: var(--shiki-token-keyword)">&quot;Authorization&quot;</span><span style="color: var(--shiki-token-punctuation)">:</span><span style="color: var(--shiki-color-text)"> </span><span style="color: var(--shiki-token-string-expression)">&quot;bearer ${your_access_token}&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>

For more detailed information about this template and to seed the initial data for your application, please refer to the README.

Further information

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