3 // Launching the Application
With the CRUD types, projections, and permissions defined, we're ready to launch the example application.
To run the demo application, you need a running instance of the Freym services and the corresponding configuration data. Don't have them yet? Get in touch with us.
The Command
Navigate to the root directory of the demo
application and execute the following command:
make deploy
What just happened? The make deploy
command processed all schema files located in the schema
directory and applied them to your Freym instance.
This action enabled Freym's Projections and CRUD services to generate the corresponding APIs for the defined CRUD types and projections.
Why is a deployment necessary? Deployments update the system's schema and ensure that the required projections for the CRUD types are created and ready to use.
The make deploy
command is part of the demo
application. It is a shorthand definition for
some commands within the @fraym/deployments
package. You can also run the commands manually.
The output of the command line should look similar to this:
Deploying blue
Deployment ID: 3
waiting for deployment to be ready...
deployment is ready
activating deployment ...
activated deployment
confirming deployment ...
confirmed deployment
Deploying green
Deployment ID: 4
waiting for deployment to be ready...
deployment is ready
activating deployment ...
activated deployment
confirming deployment ...
confirmed deployment
You can find more information about what happens during a deployment in the Deployments documentation.
The UI
The APIs for projections and CRUD types are now available and ready to use. The demo application already implemented the UI to interact with the APIs for you.
You can access the frontend of the demo
application after running the following command:
npm run dev
The command will run the web application on http://localhost:3000
.
Congratulations! You've successfully launched the demo
application.
Time to explore the application and see how the CRUD types, projections and events work together:
- Navigate to
http://localhost:3000/ingredients
and create some ingredients. - Navigate to
http://localhost:3000/order
and place a new order (see how the ingredient amount is decreased and how that is automatically updated in the UI). - Navigate to
http://localhost:3000/orders
and take a look at the order list.