The code you are doing looks pretty accurate. (FYI you can use the js) for color highlights
I’m not sure I understand your question about field and DB ?
in the plugin when you export a content-type Strapi will read it and generate the DB structure for it automatically.