If the internet is about the conversation between a Client and a Server, an application is about the structure that manages that conversation. Every complex application needs a system for organization and navigation. In Shipcode, this system is built on two core, complementary concepts: the Route and Application State.
Defining the Route
A Route is an internal, unique, and configurable address that directs the user to a specific screen, or Layout, within your running application. It is the instruction set your application uses to handle navigation.
Routes are essential because they give every screen a stable, addressable identity, allowing users to move fluidly between different parts of the application.
Routes for Dynamic Content
A Route is far more powerful than a simple path to a single screen. Routes can be configured to contain parameters, which are placeholders used to handle dynamic content. This is fundamental to building scalable applications.

For example, you do not build thousands of individual product pages. Instead, you build a single product page Layout and define a dynamic Route like /products/:productID. The :productID acts as a variable, instructing the application to:
- Request Specific Data: Use the ID provided in the route to request the data for that specific item from the Server.
- Render the Layout: Display the single Layout, but populate its elements with the unique data received in the Response.
The Fallback Route
A robust, well-engineered application must account for errors. When a user tries to access a Route that does not exist (due to a broken link or a mistyped address), the application needs a predictable failure point. This is managed by the Fallback Route (often referred to as a "404 Not Found" screen). This mandatory route serves as the default instruction, preventing a technical failure when no other Route instruction can be matched.
The Role of Application State
Application State is the dynamic condition or data of your application at any given moment. It is how your application remembers what a user is doing or has done, even as they move between screens.
Any time a screen changes its appearance, displays new data, or moves the user through a multi-step process, that change is managed by an adjustment in state.
State and Interaction
Flows in Shipcode are the primary tool used to configure how your application handles State. When a user performs an action—like adding an item to a cart or completing a form field—the application changes its state to reflect that new information. This change in state then often dictates a visual update, such as:
- The appearance of a successful notification.
- The number badge on the cart icon increasing.
- The application navigating to a new screen (a new Route).
A properly configured application uses Routes and Application State to create a smooth, logical user experience that always knows where the user is and what information they have provided.
