Initialize a Project
You can now begin working on your Catalyst project from the CLI. The first step is to initialize the project in an empty directory. This will be the home directory of your project and all of the project files will be saved in it.
For the Alien City application, we will initialize the client and the Advanced I/O function components. As mentioned earlier, you can code the Advanced I/O function in the Java or Node.js platform, based on your convenience.
Create a folder for the project on your local machine and navigate to it from the terminal.
Initialize a project by executing the following command from that directory: \
Select Client and Functions, then press the Enter key to initialize.
The CLI will now ask you to associate a Catalyst project with the directory. Associate it with the project that we created earlier from the console. Select AlienCity from the list and press Enter.
The CLI will initiate the function setup. Select AdvancedIO as the function type.
Select the latest runtimes of the Java or Node.js programming environment based on your preference.
If you select Java, enter “AlienCityAIO” as the folder name and press Enter. Enter the same name “AlienCityAIO” as the class name of the Java function as well and press Enter.
The CLI will install the catalyst-java-sdk on your local system and update the information in the configuration file.
The CLI will now initiate the client set up. Enter “ALcity” as the name for the client package and press Enter. You can enter any name you need.
The client directory will be created in the standard structure. Catalyst initialization is now complete.
Your project directory (CATALYST_PROJECT_HOME) is now set up with the client directory (CATALYST_CLIENT_HOME) and the functions directory (CATALYST_FUNCTIONS_HOME) along with configuration files and dependencies. The project directory also contains the catalyst.json configuration file and a hidden catalyst.rc file.
This is the structure of the AlienCity project’s directory, if the Advanced I/O function is of the Java platform.
This is the structure of the AlienCity project’s directory, if the Advanced I/O function is of the Node.js platform.