Ionic & MySQL - File Types: *.js vs *.ts for SQL operations

I use Docker for this purpose, and specifically docker-compose. When combined with docker-machine, this allows me to deploy entire stacks in identical fashion both locally for development and remotely for production. I typically have a four-container cluster: one holding data, one running a database (I prefer PostgreSQL, but the exact same system would work for MySQL or MongoDB), one running the application server, and one running nginx to serve any browser-based web apps and act as a frontend to the app server.

1 Like

To be honest: This hosting stuff is much easier with PHP. Just upload some files via FTP to somewhere and all is taken care of. Development can happen with a local server, where you also just have files in a folder.

1 Like

What kind of location would I need to create for hosting the database? Could I just make a free website, or are you thinking of cloud storage?

Depends. If you have a website, you probably also have a host with PHP support and MySQL. That can be enough.
For Node.js it can be different.

1 Like

I’m following along with a video about how to use Node.JS with WAMP Server. It seems to be a way to use PHP and MySQL with Node.JS somehow.

https://www.youtube.com/watch?v=P_tpOpXaUwI&index=2&list=PL1XCT-qCA0Vn7y3A7EefQOpERkQYmbWmn

Is this going to work?

This is probably going to come across more harshly than intended, but while videos may be your preferred method of consuming information, they are generally a very inefficient method of conveying it to others on a message board. It’s not reasonable to expect everybody who might be able and willing to say something on a topic to slog through video after video.

1 Like

Thank you for pointing this out. I appreciate your candor. I will be sure to explain what I gathered from the video rather than assuming people will watch it. I apologize for being inconsiderate. Thank you.

-Neal Robison

What I’ve gathered is that I can, (if the software actually cooperates after my recent attempts to get it running) use WAMP server to create and manage a server using php and then point my Ionic app to the node.js app, and the node.js app in turn communicates with the server. Docker seems to serve a similar function, but if I can get WAMP to work, it will allow me to create and manage a database with much greater ease, since it uses myphpadmin.

Of course I just thought right now, “why can’t I just use myphpadmin with my previously created mysql database?” to which I would answer myself, “I don’t see why it wouldn’t work.”

I’m doing more thinking than asking in this post, so I apologize for the rambling. I just need to process this, and expresing it where you might spot my logic and point out flaw in my reasoning is the best way I can think of figuring out a solution right now.

Is myphpadmin a separate piece of software that I can install on it’s own, and use with any backend I want? I suppose I’ll check myself by the time I get a reply, but I just wanted you experts to know where I was in my thought process.

I should probably take a break until tomorow, lol. I’m pretty confused and burned out at the moment.

phpmyadmin, not myphpadmin*

Not really. The point of Docker is to completely automate the process of bundling and deploying software. Everybody that has done web app development using any stack has encountered problems that are environment-related. Things work fine in your development environment, but when you try to deploy it to a production server, mysterious breakage occurs. Then you forget to edit a configuration file, or add a particular virtual system user, or give it ownership of a directory. All of this tedious drudgery that has to be done by hand and is hugely mistake-prone. Then you want to scale up extra resources or change hosting solutions and you have to go through all this again.

Docker can have a bit of a learning curve, but once you have a setup you like, it makes all of these problems go away. Your development environment is a virtual machine running the exact same software in the exact same configuration as production would, and deployment consists of two commands.

When I hear stack acronyms like WAMP, I only think of the component parts, not how they are put together. Docker doesn’t care what stack components you want to use; it only concerns itself with putting them together and moving them around.

You don’t need node.js if you have a php server that talks to mysql. Just let your Ionic app talk to the API of the php server. And yes, you cna use phpMyAdmin (or any other tool that works with a MySQL database like the windows client HeidiSQL) to work on the data in the database.