Kirby 3 as a Headless CMS

I want to use K3 as a headless CMS, but I have a couple of questions for those who have done it before.

What happens to templates and snippets, can you disabled them?
How to you prevent people from accessing the site like if it was a normal Kirby site?
How do you force Kirby to act as an API?
Do you install Kirby in a subfolder and your front-end / app in the root of your server?

Essentially, are there any best practices?


i can think of no reason to disable snippets. if you do not want any php template to return html just leave them empty. it might be sufficient to have a default.php template and just blueprints for everything else.

to remove access to all frontend html you could use a catch (:all) route or setup the retour plugin to do so.

the core kirby api is very powerful and protected by basic auth. for headless you might need parsing of kirbytags and srcsets and using the better rest plugin might get you started fast.

you could use the custom folder setup to make it very secure in moving all non public assets/content up one folder level. you might take inspiration from my custom public folder setup based on the plainkit.