Trying to understand ionic - and how to go on database

I have looked at previous topics and read through them but I am still cloudy on how all this works. Ionic is a middleware correct ? that gives access to functionalities such as camera - swipe - pull down to refresh using apache’s cordova and some css features etc … If that is correct, where does nodejs fit in all this ?

The first requirement to install ionic is to install node however the ionic project directory does not contain node modules directory. Is packages.json is file for node modules ? I was hoping to install express and have it connect to a remote mongo server for data. Should I just use firebase ? The previous posts I have looked through I saw a huge positive feedback for firebase. It seems a bit expensive though… I’d appreciate some feedback on that as well. Going back to the topic… Let’s say I want to install a node module ( ex: express ) where do I put that dependency?

I am a beginner so I hope I am clear with my questions and they are not far off. I really appreciate all the help. Thank you!

No Ionic is not the the middleware. Ionic is a front end framework. Cordova actually gives device access through js wrappers.

You need node because you want npm and you need npm to install ionic cli. That’s about it. You can use any database you want. No restrictions on that (and yes firebase is expensive).

Any modules you want can be fetched through bower. That is why you have the bower.json. And Ionic uses gulp as the build tool.