Adapting my workflow to use the Projects feature

Hi everyone,
I've been trying out working with projects inside node-red, but I've been hitting the following roadblock ever time I tried.
Is it possible to use the Projects / history feature using the following workflow?


First setup

mkdir node-red-boilerplate && cd node-red-boilerplate
echo "node_modules/
.config.json*" > .gitignore
npm init
npm install --save node-red@latest
node node_modules/node-red/red.js -u . flow.json

Deploy a flow. This creates the file flows.json.

git init
git add -A
git commit

Joining

git clone <projectRepo> && cd <projectName>
npm install
npm start

The advantages of this workflow are:

  • 3 commands onboarding
  • node-red is installed locally at a version locked in package.json
    • Everything used is inside the node_modules/ folder
    • Better testing, CI / CD, etc.
    • Multiple versions of node-red can run side-by-side at the same time (useful when you maintain multiple projects)

It looks like the Projects feature wouldn't work this way for the following reasons:

  • The .git repo is created inside of the ./projects/<projectName> folder instead of the root.
  • Trying to delete ./projects/<projectName>/.git/ and running git init at root breaks the history tab in the editor.

TL;DR: how can I adapt my workflow to be able to use Projects?

2 Likes

Hello edorgeville,
did you find a solution? I want to achieve a similar thing, maintain several projects in one repository.
Thanks for the answer
Tomas