Skip to main content

forest projects:create:nosql

Create a new project on a MongoDB database. The CLI registers the project on Forest, tests the database connection, and generates a Node.js back-end in a new directory named after the project.

Usage

Arguments

Options

--databaseConnectionURL cannot be combined with --databaseHost, --databasePort, --databaseName, --databaseUser, --databasePassword or --mongoDBSRV.

Interactive prompts

The CLI prompts for every option you leave out. It first asks for a connection URL: paste one, or leave the answer blank to enter the connection settings one by one. The URL is masked while you type it. The URL prompt is skipped when you pass any individual connection option. Accepted URL schemes are mongodb:// and mongodb+srv://, in lowercase.

What it generates

  • A Node.js back-end connected to your database, with an embedded workflow executor that runs Forest workflows in the back-end process. It keeps workflow runs in memory, so they are lost when the back-end restarts.
  • A .env file with FOREST_ENV_SECRET, FOREST_AUTH_SECRET, APPLICATION_PORT and DATABASE_URL.
The .env file holds your database credentials and the project’s secrets. Keep it out of version control.
Then start the back-end:
On its first start, the back-end sends its schema to Forest and your development environment becomes active.

Examples