Initial Release
This is a an example of InterSystems spec first REST API Backend for Lovable.dev frontend.
zpm:USER>install rest-api-template
Create your repository from template.
Clone/git pull the repo into any local directory e.g. like it is shown below (here I show all the examples related to this repository, but I assume you have your own derived from the template):
$ git clone git@github.com:evshvarov/lovable-backend.git
Open the terminal in this directory and run:
$ docker-compose up -d --build
or open the folder in VSCode and do the following:
The app installs /crud2 web app with REST API built with the Spec First approach vs the following spec, which introduces
CRUD methods vs persistent class Person
The REST API could be found here.
Open http://localhost:52773/swagger-ui/index.html to test the REST API
And put http://localhost:52773/crud2/_spec in an Explore field
THe app initially starts with 10 random records.
You can add more with:
USER>do ##class(dc.Sample.Person).AddTestData(10)
This will create 10 random records in dc.Sample.Person class.
There is a frontend built with Lovable which could be found here.
It points to a deployed demo backend of this repo here.
Here is the source code
You can prompt-to-UI with Lovable your own UI vs the spec and point it to http://localhost:52733/crud2 or where you have the REST API deployed.