Skip to main content

Remote development

If your local machine does not meet all requirements for development with the VIKTOR platform you can choose to use a remote development environment. A remote development environment is a development environment that is hosted in the cloud and can often be used together with an IDE in the browser. Examples of remote development environments are Replit, Github Codespaces and Gitpod. With Gitpod you can connect both public and private repositories, and it has a free tier that includes 50 hours of development time per month. We therefore recommend to use Gitpod if development on your local machine is not possible.

Gitpod

Follow the steps below to set up a Gitpod workspace and get started with developing on the VIKTOR platform:

  1. Create a repository on GitHub, GitLab or Bitbucket for your VIKTOR app (if you don't have one already).
  2. Add a Gitpod configuration file called .gitpod.yml to your project's root directory with the content shown below. Do not forget to commit the changes. This configuration file instructs Gitpod to download the VIKTOR CLI upon initialization of the workspace. More information on the Gitpod configuration file can be found here.
tasks:
- name: VIKTOR
init: |
curl -Lo viktor-cli 'https://sys.viktor.ai/api/v1/get-cli/?platform=linux&format=binary'
chmod +x viktor-cli
mv viktor-cli /workspace/viktor-cli
command: |
echo "export PATH=\$PATH:/workspace" >> ~/.bashrc
source ~/.bashrc
  1. Log in to Gitpod with your Gitlab, GitHub or Bitbucket account.
  2. Click on Settings > Variables to configure several environment variables required to authenticate with the VIKTOR platform. Click the New Variable button to add a new environment variable. The following variables should be added:
    • Insert a variable with name VIKTOR_ENV with the following value:
      • Free users: cloud.viktor.ai
      • Paid users: {company}.viktor.ai (substitute {company} with the name of your company)
    • Insert a variable with the name VIKTOR_DEV with the email address that your VIKTOR account is registered on.
    • Insert a variable with the name VIKTOR_TOKEN with your personal token. You can generate a token by logging in to your development environment. If you are logging in for the first time, use the link from the activation mail to generate a password to log in to the development environment. Alternatively, you can click "Forgot Password" to receive a mail to (re)set your password.Go to the settings page by clicking the three dots next to your name in the top-right corner and after that clicking 'Settings'. Select the 'Developer Account' tab and click the 'Generate new token' button.
Scope

You can scope these variables to only be available for the repository you created in step 1 by inserting the owner of the repository (i.e. your Gitlab, GitHub or Bitbucket username) and the name of the repository separated by a /.

  1. Click the button 'New Workspace' to initialize your Gitpod workspace. You will be asked to select a repository. Select the repository created in step 1 from the list. You will now land in a browser-based version of Visual Studio Code, a popular Python IDE.
  2. Congratulations, you are now ready to start coding your first VIKTOR app! 🚀

If you are already familiar with building apps in VIKTOR you can use the command viktor-cli create-app . in the command-line shell to generate all necessary boilerplate to start developing yourself. Alternatively, you can follow the rest of the 'Getting started' section by clicking the 'Next' button below.