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 about initializing a project in detail from the Project Directory Structure help page.

For this microservice, we will initialize function component.

  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. Select your preferred portal using the arrow-keys, and press Enter to select your preferred portal. catalyst_microservice_portal_select

  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 CounterBasedAlert from the list and press Enter. micorservice_project_select

  3. Select Functions using the space bar. Press the Enter key to initialize. microservice_project_init

  4. The CLI will initiate the functions set up. Select the BasicIO type from the list to set up and press Enter. You can learn about the function types from the Functions help page. microservice_func_type_select

  5. Select the latest runtime of Java as the stack and press Enter. micorservice_java_select


  1. Enter the name of the Java function and the folder as ‘countfunction’. This is also its reference name. Enter the name of the main class as ‘CountAlert and press Enter each time. microservice_function_setup_complete
Note: Ensure that you enter the main class name and the function's name exactly as instructed, because the application's code contains the same names.

The Catalyst Java SDK will now be downloaded to your system. Catalyst initialization is now complete. microservice_project_setup_complete


The functions directory will be created in your project directory with the configuration files and dependencies, along with the catalyst.json and a hidden catalyst.rc file.

microservice_java_directory

Last Updated 2023-12-15 18:54:08 +0530 +0530