Step 5: Create a solution

A tutorial on how to create a solution with the Packhunt Workbench.

Introduction

To create a solution, you need to create various configuration files and upload them to the Packhunt platform.

Prerequisites

1. Get your organisation slug

When deploying a solution, you will need to know the unique slug of the organisation that you want to deploy to.

  • In the Packhunt app, select “My Profile” in the top right-hand corner, and select My Organisations.
  • For each organisation, you will see the organisation “slug” on the right-hand side as shown in the image below.
  • You can also create a new organisation by clicking the “Create Organisation” button.

2. Set up your Packhunt folder

  • Create a folder anywhere on your local computer to store all your solutions. We will refer to this as your “Packhunt” folder.
    • For example C:\Users\John\Documents\packhunt\

3. Set up your solution folder

  • In your Packhunt folder, create a folder for your first solution. We refer to this as your “solution” folder.
    • For example, C:\Users\John\Documents\packhunt\xyz-solution\
  • The name of your solution folder will be used to generate the name of the solution and the name of your project on the Developer Platform.
  • The name will become part of the URL that is used to access your solution.
  • Make sure the solution name is globally unique.

❗ The name must start with a lowercase letter and may only contain lowercase alphanumerics and dashes (-).

4. Open your Packhunt folder in VSCode

To open your Packhunt folder containing your solution folder:

  • Open VSCode.
  • Go to File and select Open Folder.
  • When prompted, select your Packhunt folder.

The folder hierarchy should look like the image below.

5. Write your solution configuration file

Configuration files are written in the YAML markup language. To create a configuration file:

  • In VSCode file explorer, right click on your solution folder.
  • Click on “New File…”.
  • Name the new file solution.yaml
    • For example C:\Users\John\Documents\packhunt\xyz-solution\solution.yaml

The solution folder should contain the solution.yaml file as shown below.

❗ Your solution folder should contain all the files related to your solution including the configuration file, Rhino Grasshopper files, images and icons used in the solution.

6. Configure your solution

  • Write your solution configuration in your solution.yaml file:

    • If you want to get up and running quickly, just put the following line in your solution.yaml file: `
    kind: Solution
    version: v0
    

💡 See the schema tips on how to use auto-complete.

7. Deploy your solution

  • Open the terminal window in VSCode. Find out more about how to open a terminal window in your OS.

  • In the terminal window, make sure that you are in your Packhunt folder.

    • If not, navigate to the parent folder where you created your solution folder.

    • On Windows (Powershell), MacOS and Linux, use the cd command. For example:

      cd C:\Users\John\Documents\packhunt\
      
  • Type the command to deploy the solution:

    • First, note which Packhunt organisation you would like to upload the solution to.

    • Run the deploy command:

      ph deploy solution -o <org-slug> <solution-name>
      

      For example, let’s say your organisation is johnsmith and your solution’s name is xyz-solution

       C:\Users\John\Documents\packhunt> ph deploy solution -o johnsmith xyz-solution
      

      💡 Your solution’s name is the same as your solution folder’s name.

    • If deployment succeeded, you should see the following:

      Running deployment for solution 'xyz-solution' in organisation 'johnsmith'
      
      √ Running checks
      √ Deploying template
      √ Deploying project
      
      Successfully deployed solution 'xyz-solution'
      
      🚀 Your solution is available at: https://app.packhunt.io/xyz-solution
      

8. View your solution

  • If you want to see the deployed solution, copy-paste the solution URL that is shown in the terminal window.
    • In the example, the URL would be https://app.packhunt.io/xyz-solution.

9. View your project on the Developer Platform

  • If you go to your Projects list in the relevant organisation on the Developer Platform, you will see that a project with the same name as the workbench solution has been automatically created. This project is created by the CLI command and uses the solution configured with the Workbench.
  • If you view this project, you will be taken to the same URL as was shown in the CLI.
    • So in the example, that would again be https://app.packhunt.io/xyz-solution.

💡 Note that you can run models for up to 60 seconds on Packhunt.

Next Steps

💡 Tell us what you think about the Workbench by filling this feedback survey (~2 minutes), to help us improve it with new features and integrations.