So, I finally started the project for my thesis. It will also be what Nekoweb will use for dynamic pages. I’ve decided to call it Koneko, and files to have .cat extension, which I’ve decided to stand for Computed Active Template. The file itself is going to be basically sort of a mixture of PHP and JS and EJS. You will basically have EJS except with a ton of functions and can create any kind of dynamic pages, and return anything.

The main problem is making it possible to implement it into existing servers and hosting while keeping it safe and sandboxed. I’ve decided to build off isolated-vm, which is practically the only good and safe library with nice low-level API.

I’ve been long thinking on how to implement dynamic pages into Nekoweb without making people feel like they’re locked into the specific vendor API, and making an open-source project like this seems like the perfect solution. If person wants to use Koneko easily, they can just do it on Nekoweb, and otherwise they could always selfhost it when they want to.

So today I’ve been basically just thinking about it’s architecture. Thinking of good internal API structure is always hard, but also fun part to me. I’m thinking of making Koneko be runnable with multiple different ways:

  • simply as JS library, in which you can just give it files and get render in return
  • as HTTP server that will accept normal request (with Host, all headers, body, etc) from reverse-proxy and render the file
  • as Express middleware you can just plug into your existing site and get support for cat files
  • as a CLI to which you can just give the folder to run in

Quite ambitious, although once the core engine is done, all methods should only take like a day to implement.