Skip to main content

Deploying your App to Twinit

A Twinit app is deployed in two parts. Each part goes to a different place, and you deploy each one in its own step.

  1. Twinit content. This is everything your app needs inside your Twinit project, like scripts, user configs, API configs, collections, and user groups. You deploy it with a template package.
  2. The web client. This is the set of pages people open in a browser. You deploy it with Client Deploy.

Your app needs both parts. The web client shows the pages, and the Twinit content gives those pages their data and logic.

Part 1: Deploy your Twinit content with a template package​

A template package is the best way to deploy your Twinit content. It holds your app's whole Twinit setup in one place, so you can deploy the same setup again and get the same result every time.

Why use a template package​

You could create each script, config, and collection by hand. That works for small tests, but it is easy to miss a step or set something up in a different way each time.

A template package fixes that:

  • Everything is together. All the pieces of your app live in one folder or one zip.
  • It is repeatable. Deploy the same package to a new project, and you get the same setup.
  • It is easy to share. Your teammates can deploy the same package without guessing the steps.
  • It is easy to change. Update the package, deploy it again, and your project matches.

What goes in a template package​

A template package is a folder, or a zip of that folder. A manifest file inside it lists what to create and in what order. It can hold things like:

  • Scripts
  • User configs
  • API configs
  • Collections and the items that go in them
  • User groups
  • Files to upload

To learn how to build a template package, see Templates and Template Packages on twinit.dev.

Deploy the template package​

  1. In the Twinit extension tree, right-click the project you want to deploy to.
  2. Choose Deploy Template to Project.
  3. Pick where your package is:
    • Existing ZIP — choose a template package zip you already made.
    • Template folder — choose the folder. The extension packs it into a zip for you, then deploys it.

The extension shows its progress in the status bar at the bottom of the editor. When it finishes, your project has the content from the package.

For more on this command, see Deploy Template to Project.

tip

Keep your template package in source control next to your app. Each time you change your Twinit content, update the package. That way the package is always the true copy of your app's setup.

Part 2: Deploy your web client with Client Deploy​

After your Twinit content is in place, deploy the web client. You do this from the Client Deploy view in the extension.

Developer support must approve client deployment for your application before you can use Client Deploy. If you are not approved yet, the view shows a link where you can ask for access.

Once you are approved:

  1. Run the build command for your client.
  2. Zip the files that the build creates.
  3. Open the Support Center panel and click Client Deploy.
  4. Click Upload zip and choose your zip.

The view shows when the site is updated, and it gives you the web address of your client.

To learn everything Client Deploy can do, see Client Deploy.