My first ViUR Project

After completing the first steps in the Google Cloud Console you can start programming your first ViUR Application. To start, you will need to set up you ViUR system locally.

Warning

Before performing the following steps, please make sure to visit Awesome ViUR

and perform the ViUR setup steps for your operating system.

Start with ViUR

  1. Install the ViUR CLI Tool in your standard python environment:

pip install viur-cli
  1. Check your installation success

which viur
# The console output should look like this:
/home/user/.local/bin/viur
  1. Create a new local ViUR project for the App Engine project you have already created

Note

If you don’t know about this, please revisit “ViUR and the Google Cloud Console”

viur create projectname

This command will prompt you to enter a application name and a develop version name. We recommend naming the application name after your App Engine project. The develop version name should be the same, but with a “-dev” postfix.

application name: projectname
develop version name: projectname-dev

3.1. Choose if you want to use a prebuild version of ViUR Vi

3.2. Choose if you want to add ViUR Vi as a git submodule

3.3. Choose if you want to configure your project as a new gcloud project

  1. Install your development dependencies

Since we want to have the flexibility to work on different versions of our software, we use virtual environments. You can find more information about pipenv here.

pipenv install --dev
  1. Check your installation success.

$EDITOR Pipfile

Your output should look like this.

[[source]]
url = "https://pypi.org.sample"
verify_ssl = true
name = "pypi"

[packages]
viur-core = "*"

[dev-packages]
viur-cli = "*"
pycodestyle = "*"
watchdog = "*"

[requires]
python_version = "3.11"
  1. Start your pipenv

pipenv shell

This command will start a new virtual environment, installing packages in this environment will not install anything globally. So feel free to fool around and experiment with packages.

  1. Finish you GCloud setup

#This script enables API's and configures some more App Engine stuff
./viur-gcloud-setup.sh projectname
  1. Try out your installation by running your dev server

viur run

Warning

On the first start of your development server, the debug output will show you username and password credentials for an automatically generated admin user.
You can log into the Vi and change both the username and password by hand afterwards.
It will look similar to this:
#ViUR created a new admin-user for you!
#Username: admin@projectname-viur.com
#Password: ThisIsARandomStr1ng!
  1. Open http://localhost:8080 and http://localhost:8080/vi to check if the front and backend of your system is working.

  2. After your first deployment open https://appspot.com

  3. Visit the IAM & Admin and press the “+ GRANT ACCESS” Button

  4. Select the user: “projectname@appspot.gserviceaccount.com

  5. Assign following roles:

  1. Cloud Datastore User

  2. Storage Object Admin

Reset my admin user:

In case you have locked yourself out of your own system. There is a possible way back in, but you will need to sacrifice all your user data and log ins.

Warning

All your user data will be deleted in the App Engine and it will not be recoverable. We only recommend this, if you see no other option of logging into your administration system

Note

The ViUR-Developers recommend the usage of a Password Manager

  1. Open https://console.cloud.google.com and navigate to your project

  2. Navigate to the Datastore Entities Site of your project.

  3. Search and delete all entries of the kind user

  4. Search and delete all entries of the kind user_name_uniquePropertyIndex

  5. Start your dev server again

Optional:

  1. Recover from stress and anxiety