Initialize the Project from the CLI

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.

You can learn more about this from the Project Directory Structure help page. You can learn about initializing a project in detail from the CLI help documentation.

For the Alien City application, we will initialize the client and the Advanced I/O function. The Advanced I/O function will be initialized in the Python platform. However, as mentioned earlier, you can also initialize it in the Java or Node.js platforms.

  1. Create a folder for the project on your local machine and navigate to it from the terminal.

  2. Initialize a project by executing the following command from that directory:

copy
$
catalyst init
  1. Navigate using the arrow keys and select your preferred portal and press the Enter key. If you have no other organizations associated with the account, then the default one will be selected automatically. catalyst_alien_city_select_account_portal
    You can find out more about Catalyst’s multi-org portal feature from this help document.

  2. 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. catalyst_alien_city_select_catalyst_project

  3. Select Client and Functions using the space-bar, then press the Enter key to initialize. catalyst_alien_ctiy_func_client_setup

  4. The CLI will initiate the function setup. Select AdvancedIO as the function type. catalyst_alien_ctiy_func_advanced_io

  5. Select NodeJS 18 as the programming environment. catalyst_alien_city_select_functions_node

  6. Enter “alien_city_function” as the package name and “index.js” as the entry point, then press Enter. You can also just press Enter to use the default names generated by Catalyst, or enter any name of your preference. catalyst_alien_city_select_node_installed

  7. The CLI will now initiate the client set up. Select Basic web app as your client type. catalyst_alien_city_python_client_type_select

  8. Enter “ALcity” as the name for the client package and press Enter. You can also enter any name you prefer. catalyst_alien_city_client_setup_complete_python

The client directory will be created in the standard structure. Catalyst initialization is now complete.

Your project directory is now set up with the client directory and the functions directory along with configuration files and dependencies. The project directory also contains the catalyst.json configuration file and a hidden .catalystrc file.

This is the structure of the AlienCity project’s directory, if the Advanced I/O function is of the Python platform, and the client is set up as a Basic web app. catalyst_alien_city_folder_view_node


Last Updated 2024-06-12 17:41:34 +0530 +0530