4.8 KiB
id, title, description
| id | title | description |
|---|---|---|
| create-an-app | Create an App | Documentation on Creating an App |
To get set up quickly with your own Backstage project you can create a Backstage App.
A Backstage App is a monorepo setup with lerna that includes everything you
need to run Backstage in your own environment.
Create an app
To create a Backstage app, you will need to have Node.js Active LTS Release installed (currently v12).
Backstage provides a utility for creating new apps. It guides you through the initial setup of selecting the name of the app and a database for the backend. The database options are either SQLite or PostgreSQL, where the latter requires you to set up a separate database instance. If in doubt, choose SQLite, but don't worry about the choice, it's easy to change later!
The easiest way to run the create app package is with npx:
npx @backstage/create-app
This will create a new Backstage App inside the current folder. The name of the app-folder is the name that was provided when prompted.
Inside that directory, it will generate all the files and folder structure needed for you to run your app.
Troubleshooting
The create app command doesn't always work as expected, this is a collection of some of the commonly encountered issues and solutions.
Couldn't find any versions for "file-saver"
You may encounter the following error message:
Couldn't find any versions for "file-saver" that matches "eligrey-FileSaver.js-1.3.8.tar.gz-art-external"
This is likely because you have a globally configured NPM proxy, which breaks
the installation of the material-table dependency. This is a known issue and
being worked on in material-table, but for now you can work around it using
the following:
NPM_CONFIG_REGISTRY=https://registry.npmjs.org npx @backstage/create-app
Can't find Python executable "python"
The install process may also fail if no Python installation is available. Python is commonly available in most systems already, but if it isn't you can head for example here to install it.
General folder structure
Below is a simplified layout of the files and folders generated when creating an app.
app
├── app-config.yaml
├── catalog-info.yaml
├── lerna.json
├── package.json
└── packages
├── app
└── backend
- app-config.yaml: Main configuration file for the app. See Configuration for more information.
- catalog-info.yaml: Catalog Entities descriptors. See Descriptor Format of Catalog Entities to get started.
- lerna.json: Contains information about workspaces and other lerna configuration needed for the monorepo setup.
- package.json: Root package.json for the project. Note: Be sure that you don't add any npm dependencies here as they probably should be installed in the intended workspace rather than in the root.
- packages/: Lerna leaf packages or "workspaces". Everything here is going to be a separate package, managed by lerna.
- packages/app/: An fully functioning Backstage frontend app, that acts as a good starting point for you to get to know Backstage.
- packages/backend/: We include a backend that helps power features such as Authentication, Software Catalog, Software Templates and TechDocs amongst other things.
Run the app
When the installation is complete you can open the app folder and start the app.
cd my-backstage-app
yarn start
When yarn start is ready it should open up a browser window displaying your
app, if not you can navigate to http://localhost:3000.
In most cases you will want to start the backend as well, as it is required for the catalog to work, along with many other plugins.
To start the backend, open a separate terminal session and run the following in the root directory:
yarn workspace backend start
Troubleshooting
Cannot find module
You may encounter an error similar to below:
internal/modules/cjs/loader.js:968
throw err;
^
Error: Cannot find module '../build/Debug/nodegit.node'
This can occur if an npm dependency is not completely installed. Because some
dependencies run a post-install script, ensure that both your npm and yarn
configs have the ignore-scripts flag set to false.
