The MacMini will still be running in 5-7 years, reliably, and still have updates from Apple on the macOS side. It will still be running in 10+ years too should you keep it that long.
MinisForum makes disposable hardware. We used to use them for TV computers at work, and while they are cheap, they are fidgity with hardware and drivers, come with hacked-Windows Enterprise installed by default, and generally last for about 2 years before they hit the recycle pile.