Frontastic CLI

Frontastic CLI is the central entry point for frontend development with Frontastic without the need for a Development Machine or a Virtual Machine. It's possible to run webpack, which prepares all frontend code, directly on the Developer machine and everything else in the Cloud (in the proof-of-concept that's a Docker container on the local machine).

Getting started

You'll have problems if you run Frontastic CLI in the same checkout as a container/VM. You need to do a clean Git checkout of your project. Also, Frontastic CLI requires that there's no container/VM with Frontastic running on your machine when using it.

To get Frontastic CLI running on your system, you'll need the latest version of Yarn as well as Homebrew for macOS or Linux

Then you can just run brew tap frontasticgmbh/tap && brew install frontastic-cli

Run  brew update to get any updates to Frontastic CLI.

Then you'll need to go through the following steps:

1
Create a base configuration using frontastic init in the root directory of your code repository checkout. This will generate a frontastic.toml file which looks like this:
hosts = ["<project>-<customer>.frontastic.io.local"]
remoteserveraddress = "<staging-host>"
remoteservertls = true
customerName =  "<customer>"
projectName = "<project>"

The init step will ask you these variables as questions. Your remoteserveraddress is usually your staging server (without https://), hosts, projectName, and customerName correspond to your daily work environment.

If you're using a Frontastic Machine along with Frontastic CLI, the .toml file will automatically be available to download in the Editor. See this article for more info.

2
Run yarn install in the root directory of your code repository checkout
3
Start the Frontastic CLI router as superuser using sudo frontastic start
4
Once this is done, start the local development service using frontastic run

When you're done for the day, you can stop the development service by hitting <Ctrl>-<C> and then stop the router as superuser doing sudo frontastic stop.

Since you're not running a local backend server, any changes to the PHP code or configuration files like project.yml won't have an immediate effect. These changes need to be deployed to Staging first.

File synchronization

To be able to change PHP code without deploying, you can enable file synchronization to the remote server. To do this:

1
Add a line in the config  frontastic.toml specifying your Frontastic Machine hostname:
frontasticMachineHostname = "your-awesome-machine.frontastic.dev"
2
Start Frontastic CLI as usual with sudo frontastic start and frontastic run to do frontend development and have changes synced to the remote machine or use frontastic filesync to only start the syncing to the remote machine and doing PHP development. See this article for the full steps.
If you want to use Frontastic CLI without filesync again, just remove the line in the configuration file before starting (or put a # before the line).

Known issues

Windows

Unfortunately, Frontastic CLI doesn't work on Windows. If you're using Windows, you can use a Frontastic Machine instead.

Troubleshooting

macOS refuses to start Frontastic CLI

If you get a message saying that the application can't be started because the developer can't be verified, you have to allow the application in the General tab of the Security & Privacy settings in your System Preferences. See here for more info.

Yarn has errors on installation

Are you sure you did a fresh checkout after using a container/VM? If not, please do so. Or you can remove all node_modules folders (even those in paas/...) and try again.

Frontastic CLI claims ports are in use

You might have a Frontastic container/VM running in another directory. Make sure this is shut down properly using vagrant halt in the directory in question. Another reason might be that you have a webserver running locally on port 80 please shut this down before starting the Frontastic CLI.


‹ Back to Article List

Next Article ›

Where to Put Your Code

Still need help? Contact Us Contact Us