There are also other solutions, like using a language that compiles to JS. If on top of that you use a language that is strongly typed, you probably won't have many security problems and will probably be fine staying with whatever version you have. And if you ever update, the compiler can help you out.
There are downsides to that as well, it's not a silver bullet.
I'm actually very slowly writing an API for an imageboard. I'm using it to learn, mostly. If I do it right, I guess I'll publish it. To get feature parity is pretty hard. For example, post.php of lainchan is 1530 lines of code. It's a fucking mess and can probably be written in half of those lines, but that is just one of many many files.
To give an idea, this is lainchan:
That's 14k lines of code. A lot of these are not used at all or are config shit. The codebase has a huge issue of dead code.
Perhaps a more "fair" assessment might be this:
Say you can write this if you have experience and acumen in 4.5k lines of code. I've heard that people write 20 lines of code a day on shitty desk jobs (https://skeptics.stackexchange.com/questions/17224/do-professional-software-developers-write-an-average-of-10-lines-of-code-per-day
). If that's true, this would take a full year of work. Something more reasonable, since you already know what your building and this is more personal work is to write maybe 40 lines of code on average during the whole endeavor. That's around half a year of dev hours. These things are really hard to estimate, and they're only back of envelope estimations based on a billion assumptions. There's also so much dead code and now-unnecessary workarounds.
The front end has:
And around 6 shoddily done mod pages
It's rather simple for a front page. >>6626
I've searched for a lot of headless imageboards and I haven't found anything decent.