you mentioned you’ve used joplin. All my notes are in markdown and I’ve been using Obsidian instead. Obsidian includes support for mermaid and can render (relatively simple) flowcharts.
https://obsidian.md/ https://mermaid.js.org/syntax/flowchart.html
For the server I’ve used gogs for many years. It was easy to set up and has a web interface. What client you use is really up to you with git.
https://gogs.io/