kitwork/engine — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a Go based logic engine that I can plug into a SaaS app to let each tenant run their own small JavaScript like routing and workflow scripts safely.

I want it to start from a simple config file, listen on a port, pick the right tenant by the request host, load that tenant’s app script from a folder, compile it into fast bytecode, and run it for each request. It should support hot reloading when scripts change, serving normal assets directly, rendering HTML fragments, and saving static cached responses so repeat requests are very fast.

Please include safety limits so bad tenant scripts can’t loop forever or crash the server. Add basic database connection support for Postgres and MySQL, with settings from the config and environment variables. I’d also like a clean public Go API, a small example app, sample tenant folders, and clear README instructions so I can run it locally and understand how to write a tenant script.

Want more depth? Deep Reverse