Test the application
Before you deploy the application to the remote console, you can test the application on a local server and check if everything works fine using the Catalyst CLI.
To serve the Catalyst project locally, execute the following command from your project directory (CATALYST_PROJECT_HOME):
$ catalyst serve
The Alien City application will now be served at default port 3000. The local endpoint URLs of the components are displayed.
You can now open the client component's local URL in a browser to access the Alien City application.
Let's test the application by entering a city's name and checking for the history of an alien encounter in the city. Since we have not reported an alien encounter in a city yet, the result should be negative.
Enter a city name in the text box and click Check.
Since a matching record for this city is not found in the Data Store, the client displays a negative response.
Let's now report an alien encounter. Click the Report Alien Encounter tab. Enter a city name and click Report. We have entered "Madrid" in our application.
The application will display a pop-up box confirming that the data is added to the Data Store.
You can verify this by opening your Catalyst console and navigating to Data Store under Develop. Click the Data View tab to view the record that was just inserted.
Let's now search for this city in the client and check if it fetches this record from the Data Store. Click Check My City in the client application and enter the name of the city that you just reported. Here, we enter "Madrid". Click Check.
The client displays a positive response.
You can also check if the client displays the duplication message by reporting the same city again.
If this setup is working correctly, we can deploy the application to production.