Working with App Logic

Working with App Logic



As discussed in this help guide, you can set up and work with your project components that you did not initialize during project initialization from the Catalyst CLI. You can set up the client, functions, and app logic directories from the CLI at any time while working with the project.

You can use this command if you did not initialize the app logic package during the project initialization or if you initialized an empty project and you now need it to be added to your application. You will not be able to create an app logic package manually, since it requires node modules and package dependencies to be installed in your project directory in the standard project directory structure

You can perform the setup activity from the CLI and the CLI will ensure that all the right dependencies and configuration files are initialized in their boilerplate structures. Additionally, the updated information about the app logic component is added to the catalyst.json file automatically when you set it up. You can also delete the app logic from the CLI. 


Setup App Logic

You can setup the app logic component from the CLI by navigating to your project directory and executing the following command:

$ catalyst applogic:setup

The procedure is the same as initializing the app logic directory during the project initialization. 

The CLI will prompt you to enter a package name for the app logic. Enter a package name and press Enter. You can press Enter to fill in the queries with default values.

Enter the name of the entry point file and press Enter.

Enter a name for the app logic's author and press Enter

The CLI will then prompt you to allow installing node dependencies. Press Y to confirm the installation, and press Enter to confirm your choice. If you don't install all the required dependencies, it could cause errors during the app logic's execution.

Once the dependencies are installed, your app logic setup process will be completed. The values will be updated in the catalyst.json configuration file. 

You can now upload the package to the Catalyst console and work on the app logic using the online editor in the console. You can also use any editor of your choice to work on it. If you use a different editor, you can deploy the final code of the app logic from the CLI. This will make the code available in the production as well. 


Delete App Logic

You can delete the app logic permanently from the CLI. Catalyst will reflect this remote delete operation in the console as well. You can also delete the app logic directly from the console.

To delete your app logic from the CLI, execute the following command from the project directory structure:

$ catalyst applogic:delete

The CLI will prompt you with a confirmation message. Press Y and press Enter. The app logic will be permanently deleted from your project.


Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: