Recommendation for best practice

I have a small data visualization portfolio, which I am planning to convert into GRAV cms.
I have some static pages, which I have already converted. However, there are some dynamic/ interactive pages which requires pulling data from database and manipulation using charting libraries like d3.js and/or mapping libraries like openlayers. For these, I would like to have some recommendations:
1. I am planning to create a db.ini file containing database parameters and put it in user/config folder, so that I can include it wherever I require.
Or should I create separate plugin for database connection?

2. I have two separate folders (taxonomy->category: static and interactive). For page specific php, js and css code of interactive pages, I am planning to put them in separate page folders.
interactive->interactive-item1->.php, .js, .css. I will include them in twig file at my theme folder.
Is this approach ok or do I need to these files in my theme folder?

I would recommend writing a plugin to handle this. Also i would recommend using a YAML config for any database info. You could put it in site.yaml, or create another user/config/db.yaml or something. Then your plugin can use those options and retrieve the data you wish and set the data (array or json) as a twig variable. Then in your template, you can render the data with your JS library and just output the data via the twig variable. Pretty standard stuff.

Regarding the CSS/JS, you can put them in the page if you plan on using the same page. if you find yourself needing to copy those assets to multiple pages, then you probably should move them to a single location and access them there.