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.

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 Event app, we will initialize an Event function and a client component.

  1. Create a folder for the project directory on your local machine and navigate to it from the CLI. Initialize a project by executing the following command:
copy
$
catalyst init
  1. The CLI will now ask you to associate a Catalyst project with the directory. Associate it with the project that we created earlier. Select EventApp from the list and press Enter.


  2. Select Functions and Client from the list by pressing the Space bar. Press Enter to confirm your choices.


  3. The CLI will initiate the function setup. Select Event as the function type.

  4. Select the latest runtime of Node.js as the function stack.

  5. Enter “event_app” as the package name, “index.js” as the entry point, and your email address as the author and press Enter. You can alternatively press Enter without entering inputs to fill in the default values.

    The CLI will prompt the initialization of the Node dependencies. Press Y to confirm the installation, and press Enter to confirm your choice. The Node modules will be installed.

    Your function setup process is now complete. The Node function’s directory is now set up with the main function file and the dependencies.



  6. The CLI will initiate the client set up next. Enter “EventAppClient” as the name for the client package and press Enter.


    Your client directory will be created in the standard structure. The project initialization process 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 catalyst.rc file.

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