Wordpress Admin with express and node api - mysql

I'm planning to use Docker containers to create complex admin and API for listing web / mobile app, I am gonna use one WordPress container as application admin part due to WordPress has great custom post and media library capability, and create node microservices to query directly from MySQL and expose express API, finally I will create react front-end and mobile app that consumes this api.
The reason I use WordPress because WordPress admin UI and media-library are awesome.
The reason I chose express node microservice instead of WordPress because WordPress query is slow.
Please tell me is this architecture is a good solution. or their anything I can use instead of this.

Though this isn't the best architecture as per your requirement, you can use WordPress as a CMS for your application. However, I suggest using any CMS that is built on top of NodeJS and create complex admin

Related

Secure Database Connection in ElectronJS Production App?

I've recently begun developing with NodeJS and ElectronJS to create some pretty nifty cross platform software. I want to take it a step further and integrate some database functionality.
While I'm aware that there are mysql packages available to install, I cringe at the idea that anybody can just unpack my asar.app file and see all of the connection details, including username, password, database name, table name, and other sensitive content that you really don't want to expose to people clever enough to break into your app's source code.
I've tried searching extensively on solutions to this problem, which I was surprised to find very little about. How do WhatsApp and Slack secure connections to their database if they were also built with ElectronJS?
Any and all resources are greatly appreciated. I basically want to be able to connect to a production server SQL database in an ElectronJS app without leaving some security backdoor to anybody who cracks the ASAR file.
Thank you!!
For this scenario, I suggest you to use a RESTful web service architecture. Basically you need 3 component, RESTful web back end, client application(your electron) and the database service( see the following image ; source:phppot.com) .For this I suggest you to use nodeJS backend and create a webservice using expressJS . You can define Restful (GET, POST,UPDATE, DELETE) API for each services.
For ex: To get some data from your db, you can send a GET request to the following path <yourdomain>:<port>/api/v1/getyoursomthin using your electron app. Your express app process the request and get the relevant data from the data from the database (Tutorial). So your app can get the respond from the server and display to the user. I will add link to some tutorials. You can find and learn more by google :)
Web: Build a simple app using Node JS and MySQL.
Express.js Tutorial: Build RESTful APIs with Node and Express
( source:phppot.com)

How do I link a react app I am building using webpack to a phpmyadmin external database and query it without showing my database password in the code?

So I am currently learning react and webpack so that I can implement it into my current site. I already have an established phpmyadmin database that pumps out information that I want to appear on my site but I cant figure out how to hide my username and password to the database when programming it. I am used to using php to interact with my database bus since react is purely javascript I am not sure what to do.
You need to have a server running that talks to your database and to your react app. It sounds like you might have this in the form of a PHP application. Your PHP application will need to expose data over HTTP endpoints that you can then fetch from inside of your React application.
This tutorial: https://www.techiediaries.com/php-react-rest-api-crud-tutorial/ would be a great place for you to get started.
I agree that you need to "have a server running that talks to your database and to your react app" as the accepted answer states. On the other hand this does not mean that you have to code it from scratch.
If you don't want to program PHP for the back-end, then you may as well configure software from the list of 'automatic APIs'. An automatic API is "software that turns your database into a REST/GraphQL API".
I'm the author of PHP-CRUD-API, which is an 'automatic API' and I think it suits your needs, but you may as well use any other software from the above list.

Dual database possibilities (Firebase & Webhosting service)

Is it possible to use two databases, example, Firebase and an online webhosting server? I am developing an app that uses the webhosting server for the data and the firebase only for the chats.
Absolutely. Firebase is very flexible when it comes to picking and choosing parts which you want to use.
You don't need to migrate away from whatever backend you already have if you just need to add in something that is unrelated to your site data, such as a support chat or something.
Instead, see it as an opportunity to discover Firebase by trying out something isolated like a chat using Firebase Database. You'll find your best fit by trying out the strengths and limits of the platform.
Yes it is Possible but, you have to manage the back-end accordingly. I have created the app in which api is hosted in aws-EC2 and few part is in the Firebase. For example for some live changes I'm using the Firebase and for other things like getting feeds and all those thing i used aws EC2.

AngularJs real time app with mysql server

Is it possible to build a realtime app using AngularJs with a mysql database?
I've been reading thousands of tutorials, but they are all focused on express, nodejs, etc.. didn't found any documentation on wheter it's possible or not. I tried to take a look at the socket.io docs, but still didn't found anything relevant to this question.
I didn't tried anything yet because of this. I use a webApp based on AngularJs on a apache server (local).
Where should i start to be able to build a real time app using these tools i have?
Do i really need to use a node/express server?
What are the main consideration i need to do before taking this step?
Is there any documentation i should read?
I need to do this real time because it involves product orders, call center, ticket system, etc.. So everytime there is a new ticket is opened/changed, new order arrives, etc.. I need to make the user aware of this, without the need to refresh the page.
Or if someone could give me a further explanation of this concept and how to get started, it will be great.
You can run angular on top of any backend, although most examples push towards REST. If you want your app to feel like a real time application, using WebSockets is a likely improvement.
WebSockets play nice with Angular, look at https://github.com/wilk/ng-websocket for example. A back-end in Node will work, but many other backend techs will do equally well.
Here is a decent tutorial using MySQL, NodeJS, and Angular: https://codeforgeek.com/2015/03/real-time-app-socket-io/
I recommend that you keep using a webserver like Apache (my personal preference is Nginx). You can proxy API and socket requests to Node, and serve static resources for the app from a folder.
Check out https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html if you stay with Apache. Check out http://nginx.org/en/docs/http/websocket.html is you go for nginx.
Without a webserver, you'll have to either:
serve your static resources with Node (polluting your server project with client code), or
work with different ports, risking the app becomes unusable in client environments, or
work with different domains, giving you a CORS head-ache.
Although I don't have much experience with Node, MySQL with Node.js should help you out a bit.
You'll want to move away from Apache if you want to do websocket stuff with Socket.io
Yes, it is possible to create a software with AngularJS in the front end and any other server side language that speaks to MySQL. Few months back I worked on a software with Java Spring Framework in the backend with MySQL database and AngularJS with bootstrap in the front end. You could start by following the MVC pattern, where your views can be served as AngularJS and your Controller can be in any server side code, with MySQL database.

Kendo UI Mobile & MySQL database connectivity

I am currently building a mobile application with Kendo UI which I intend to run through phonegap and deploy to some App Stores in the near future.
I have set out the layout in HTML, CSS & JS using the Kendo framework and everything is looking good and in place.
My app will talk to an existing MySQL database which already has lots of data in it. I am wanting to pull data out of the database and display it in my application. Can anybody with any experience with Kendo UI, phonegap and app deployment help me get started as the Kendo documentation for this is not very clear.
Thanks in advance!
Your mysql database with lots of data is probably on a server somewhere.
Most servers that have mysql will probably have php installed.
So the easiest thing you can do is use some of the php mvc frameworks out there to get the data from the db, convert that into json and send that to your kendo-phonegap app.
You can read more about this approach here.
Hope this helps.
I think you need to use some wrappers. Kendo UI will not just take the data from your database.
For example setup the apache http server with php. The best way would be to get some lightweight framework which would handle the database for you. From client side with Kendo you will be querying your server.