node.js as service for mobile + adminisrtation panel with angular - javascript

Currently we have mobile app that calls some "APIs" (no backedn yet).
I wonder if it would be ok to use node.js (never used before, I am .net developer) as service (mobile app would call node.js APIs).
And for some dashboard for administrating application, I could try to use angular+node.js.
I have started to learn node.js and angular just a day ago and I wonder if this would work for purpose above.

Yes, you can! Nodejs RESTful API or web services can be used/called by mobile app.
I have developed web-Application & APIs for mobile app on Nodejs, Angularjs, Postgres...
which maintains & used by
Admin Panel
Dashboards
Generating reports (As BI Tools)
Handling thousands of users concurrently & lots more!
Performance is superb! Work like charm
Refer below link, to develop web services for mobile app using nodejs
Designing a RESTful API with Node and Postgres

Basically you want to use the MEAN Stack, check out this blog
https://rclayton.silvrback.com/means-great-but-then-you-grow-up ,
to get the pros and cons regarding the stack usage. You will get rapid development using the stack but need to tradeoff on some features that may be required in the long run.
I just want to say, research before you start your project, because changing the technology afterwards is a huge waste of time and money.

Related

How to implement a Node.js chat app into an existing website?

I've been getting into Node.js recently and I really like the example shown on Socket.io's website showing a real time chat application. However, in all of the examples I see the URL used is localhost:8080 or whatever ip and port is applicable. However, is there any way to implement this into an existing webpage so that it isn't a separate URL? If not, how are these real-time chat apps done in real life?
these sort of questions are usually not meant for stackoverflow, but everyone has been where you are! Stackoverflow is dedicated for code related questions, but this might help you get to your next steps:
NodeJS is a backend server language, you will have to deploy it to a production environment.
New developers typically learn by using services like heroku.com to quickly host backend apps, they take a lot of the complexity of learning Linux or Microrost Server out of the mix, but they are not typically used by more advanced developers.
More advanced (real world apps) run on AWS/Azure/Other hosts.
Implementing it in an existing website requires both frontend and backend languages. Nodejs gives you a leg up in that it's javascript, and can run in both frontend and backend situations.
There are many places online that provide tutorials for creating backend servers and frontend websites.
the list is endless, but some good places for new developers are
https://frontendmasters.com/
https://teamtreehouse.com/
https://egghead.io/
Here is a tutorial on heroku for setting up a nodejs app
Getting Started on Heroku with Node.js

Exposing Native Device APIs to Web Apps

There are a lot of ways to develop an app nowadays. You can create a full native app, hybrid app, pwa or website. There are probably some formats of apps I didn't mention however that's besides the point. The last two decades have proven that smartphones are the way most of the people(users) are interacting with apps and that's clearly also how they want to interact all the time literally all the time! Developers(wizards) have been working to meet those demands by creating solutions like .Net blazor, Xamarin, Vue, Angular, ect to meet the demand for apps and their development. Currently app stores from Google and Apple are the way apps are distributed only for use to pay them a cut of our app revenue so we look to the web. When we want to create a highly secure app (server-side) we look to the web. When we want to support most operating systems we look to the web. I assume you get the point. only there is one thing that stands in the way and that is excess to the users native device APIs. There are alot of native APIs that are already available in HTML5 only we know that those aren't the specific ones we need for the app we develop. So what are the ways we can expos native device APIs to web apps?
Look at Cordova Plugins: https://cordova.apache.org. If you want to expose API into web, you just should write some player application (web browser) witch will translates JS commands into native API callbacks. To achieve it, you can use WKScriptMessageHandler.
Here you can find an example.
It is not very complicated, but if you want to cover all API, it will very complicated code.
Also, you forget about one coin of a web application: long time of a response, especially with low internet connection. I do not think that is a good idea.

Creating a RESTful api for my Ionic app

I have created an Ionic app which uses pouchdb to store items locally and then syncs them with remotely with couchdb
I am looking to create a REST api for this app which uses the items stored in my couchdb from the app. A web app will also show all of the items from the mobile ionic app.
I have experience with Node using Express. Would node/express be the best/easiest thing to use when building the api build? Or is there another much simpler more popular way?
You can use Firebase https://firebase.google.com/, it' a mobile platform that helps you quickly develop high-quality apps
If you're not completely set on using NoSQL on your API, you should really take a look at Django Rest Framework.
If you can map your data to objects, I'm sure you can go from zero knowledge to having an API up in hours. The quickstart tutorial is fully functional and you can set that up in just minutes! Plus, having more frameworks and languages under your belt can only be a good thing.
There's a Node client which you can use in your Expresss server for Couch DB called Nano , just like you would use mongoose for dealing with MongoDB . Since CouchDB already provides the ability to retrieve data using http, so you can even use an http wrapper like request but you can use Nano for a higher level abstraction.
You can then go ahead build an API that simply proxies those requests to your CouchDB instance.

NodeJS with Java RESTful backend?

I require some advice in terms of choice of language, I hope that I'm allowed to ask this question here.
To provide some framework information:
As from next week, I'll be following a Java course to get my graduate degree in programming.
For this graduate, they mention that we'll need to develop a webapp in Java.
At the same time, coincidence wants that we are currently developing a webapp that allows users to search popular activities (events) and follow hashtags to render a specific activity feed.
For the front end we currently use some client libraries (Marionette, Backbone, Underscore, Requirejs).
For the server front end (router, rendering server pages), we currently use nodejs.
The question is if it would be a good choice to use Java to build the REST service (to serve both the server and client front ends). The webapp includes a social network, organisers can create their own profile, users can bookmark all sorts of things, ... well, there will be pretty database intensive actions (we'll be using a relatively complex relational model with MySQL).
We might still be using Node to handle push notifications with web sockets but we haven't really discussed this yet.
Since we'll get time at school to work on our project in group, I'd have plenty of time to build the backend REST api with Java which seems like a huge opportunity for me in terms of time. I'm just wondering if there would be any real tradeoffs to do it with Java for this purpose.
Thanks.
I think this would be a huge opportunity to build a REST backend in Java.
Take a look at Spring for a fast and effective way to server HTML
Also you could look at Spring Boot for serving REST APIs. If you follow the tutorials you'll be up an running in minutes.
Good luck

Is it possible to develop a Google App Engine web app using Node.js or some other server side JavaScript approach?

I've been following the latest developments with server-side JavaScript - especially Node.js - and wondering if there is any possibility of using such an approach to develop a Google App Engine web application - either separately from or in combination with Python or Java?
node.js uses an event-loop model which is not really a good fit with the current App Engine design.
However, there are several projects that bring JavaScript to App Engine. Check out App Engine issue 35 to read about some of the solutions. The highlights are: Rhino, Rhino For Webapps, if you like Python check out AppengineJS. I have also heard that RingoJS might be worth looking into.
Also you might want to check out ApeJS. A little framework I wrote similar to AppengineJS but more minimalist.
http://lmatteis.github.com/apejs/
Tornado can run on app engine and is similar to node.js but using python, and has a nice yield approach too. But there are limitations with tornado's use on app engine that might defeat the object of using it for your project. See tornado on github for more info
I use both but node.js with connect middelware and express.js to make node easier to use for simple web apps.
Now the best option is to use Google Compute Engine and Datastore > link here
You can use Google Compute Engine to host your node.js app and use google-api-nodejs-client to connect to the datastore:
You need to create a project in Google API Console, and activate Compute Engine service for it
You have to enable Google Cloud Datastore API (see link above)
You need to set your dataset-id (same identifier as your Google Cloud Project ID).
You need to be connected to a Compute Engine instance with both the datastore and userinfo.email scopes (node.js support for certificate-based service accounts is not yet implemented).
You need a working node.js environment in your Compute Engine machine.
npm install google-api-nodejs-client in your administration command-line tool
And you should be ready to go
While not the same as pure app engine (eg. manual scaling and currently in alpha status), this is now possible using Appengine Managed
VMs.
See:
Appengine NodeJS Quickstart project
appengine-nodejs library
They also announced a Node.JS library for working with the google cloud
platform.
gcloud-node library

Categories