Is it possible to have multiple Node-RED projects inside of one git repo?

I'm building a few freestanding interactive stations for an event. Each one will have a Raspberry Pi running Node-RED, using IO physically connected to the Pi, and controlling other some custom software (also running on the Pi) via MQTT. Due to physical constraints, networking between them will be unreliable, so they will run completely independently.

I would like the different stations to be in their own project in Node-RED as the logic for each station will be very different and sometimes complex, plus multiple people will be working on different stations at the same time. But I'd prefer to have a single repo for the whole event, containing all the Node-RED projects, along with the other software, assets, documentation, etc.

Is it possible to have multiple Node-RED projects inside of one git repo?

See if this feature is what you want

I am aware of Node-RED's Projects feature, as a way to integrate with git.

I'm fairly new to Node-RED but not at all new to software or git. AFAICT Node-RED wants each Project to be separate git repo, each cloned into .node_red/projects. I don't seem to be able to setup multiple projects as in folders of a single git repo.

Normally for a project like this I'd set up one repo with the logic, scripts, firmware, assets, etc and run different parts of it on different raspberry pi's to get different behavior. That just is a little easier for access management for the few developers working on this.

My question is: is there a good way to do this, or it just Node-RED is Opinionated about mono-repo vs multi-repo and I should suck it up and ignore my own opinions and make a bunch of repos?

You can have many folders, each being a project

I can have many folders, that are each their own git repos and a project, but I can't seem to have many folders that are all within the same git repo.

I've now spent several hours exploring various kinds of trickery that might make this work, and tinkering with Node-RED's config files and secret .config files and I'm pretty sure I'm not missing anything.

The closest I've gotten is to delete ~/.node-red/projects and replace that with a multi-folder repo. I can then select folders from inside that repo (as long as they're at the root level) and edit and run them, but the git integration doesn't work; I can't add or commit changes.

I think my dream is dead and the answer is just suck it up and do things the way Node-RED assumes everyone will want to, because even if I could get this working through some chicanery, I clearly would be outside the expectations of the software and developers and I don't need to be a weird edge case for this project.

Rats.

my-repo-root
├── .git
├── .gitignore
├── project-1
│   ├── flows.json
│   ├── node_modules
│   └── ...
└── project-2
    ├── flows.json
    ├── node_modules
    └── ...

Organize your project as shown above. Then run node-red within each project-n folder as the root. Version my-repo-root with git.

Another option, if you want each project-n folder to have its own independent history, is to version each project-n folder with git separately, then add those as submodules of my-repo-root.

We went with the following:

  • main repo root for node red system
    • each project folder as a separate submodule

Submodule is a hassle so a lot of cursing to set up. But now it works fairly ok-ish. Shared root system (docker / node red), then separate sub repos per project (mainly just flow.json) per project.