Skip to main content

Running

Running an Abyss application

** Note: Abyss App Starter-Kit Only **

Local development

To run an Abyss application locally, use the following command:

npm run dev

This command starts the local development server an run all three products in the starter app:

  • web runs on localhost:3000
  • api runs on localhost:4000
  • workshop (Parcels) runs on localhost:5000

To run each product separately, you can use the following commands:

  • For the web product:
    npm run web
  • For the api product:
    npm run api
  • For the workshop product:
    npm run workshop

Note: The npm run dev command should not be used to run the application in production. It is intended for local development only and includes features like hot module replacement, which are not suitable for production environments.

Web

Production build

To build the Abyss web application for production, use the following command in the products/web directory:

npm run build

This command compiles the application into an optimized build that can be deployed to a production environment. To learn more about the possible configuration options for the production build, see our Abyss configuration docs.

The build can be run locally using the following command in the products/web directory:

npm run preview

This runs the production build locally on the same port as listed above.

Please note that any of our web commands do not automatically accept Next CLI options. While we use Next for our build, the arguments that gets passed down (like --port, for example) are then specifically extracted for our own commands. Teams are welcome to create their own scripts that leverage Next CLI options if they wish to do so.

Running in production

How you run the Abyss application in production depends on the application's build type. By default, Abyss applications are built as Next.js applications ("buildType": "browser-node"), which can be run by executing the build/server.js file. For example:

node server.js

This command starts the Next.js server, which serves the application in production mode. Ensure that you have set the environment variables and configurations required for production before running this command.

When using "buildType": "browser-static", the application is built as a static site. In this case, there will be a version for each environment in the build/ directory. You can serve the index.html file however you'd like.

Running in different environments

To run the Abyss application in different environments, set the APP_ENV environment variable. For example: APP_ENV="test". This can be injected into your build process or set in your hosting environment and allows for the correct use of our config tool based on the current environment.

API

Production build

To build the Abyss API application for production, use the following command in the products/api directory:

npm run build

This command compiles the API application into an optimized build that can be deployed to a production environment.

Running in production

To run the Abyss API application in production, execute the build/server.js file. For example:

node server.js

Workshop (Parcels)

To learn more about Abyss Parcels, see our Parcels documentation.

Table of Contents