Looking for some insight/advice.
I'm creating an app where I want to expose an API that will be used by 3rd parties as well as my own web and mobile apps. Looking at the MEAN stack to do this. My thinking is that I should create 2 apps:
Express-based API app that talks to the MongoDB. No UI, just RESTful endpoints.
Angular-based web app with the UI. Does this app require Express? This app will hit the API endpoints to get/put data to the backend. Can Angular run on its own or does it need Express/Node. My thoughts were for Angular to handle the UI page routing and Express to handle the API routes.
Also, in the mix, is an iOS mobile app and Android app. These will also hit the API for data.
My background is heavy Java/Spring/Hibernate/Spring Boot and .Net. So, explaining MEAN stack as it relates to Java technology/frameworks would help!
Related
I'm fairly new to developing with multiple tech stacks so I was wondering if it was possible to combine the two together?
For example, with an express backend that already maps requests like /about and /contact I want to have a spring application that maps a request for /service in its MainController and use other classes like MainService.java.
I currently have a social-media type of application built on Node and an AWS image upload app built with Spring so I was curious if it was possible to connect these two apps so that users can upload images using the Spring app.
If this is possible, what other benefits can it provide? or is it bad practice?
If the two applications are restful u can turn in micro-services Architecture to use a service discovery which can recognize the two applications and another application to be the Api gateway that can play the role of proxy to redirect requests.
multiple languages micro-services
service discovery
api gateway.
Otherwise if u are apps are not restful u can simply make a http requests to link them.
I have a GraphQL server using graphql-yoga based on an Node JS express server running on Google App Engine.
Basically, the server exposes an HTTP endpoint with a single route accepting POST requests returning a JSON result, which is consumed by a mobile application.
It doesn't handle user authentication.
From what I understand, it is possible to use Google Cloud Endpoints to deploy an ESP (Extensible Service Proxy) in front of my server in App Engine.
It exposes an API with a secure endpoint that handles user authentication via Firebase Auth, Auth0 or Google Sign In.
Are my assumptions correct? I've deployed both with an open API specification that contains the right secure parameters but, without any bearer token, all requests are accepted.
Reference documentation: https://cloud.google.com/endpoints/docs/openapi/authenticating-users
ESP cannot run in front of your application on App Engine Standard the same way it can on App Engine Flex. That mostly has to do with the difference in architectures of those runtimes --- App Engine Flex is based on deploying containers (including multiple at a time), whereas App Engine Standard does not currently support multi-container deployments.
Because of this, we have the Endpoints Frameworks that add similar functionality as a library for applications based on App Engine Standard --- but this is only supported for the Python and Java runtimes.
Unfortunately, this means that if you're sticking with the combination of Node + App Engine Standard, there isn't currently a way to use Cloud Endpoints.
When I have an ASP.NET web app with some API controllers that has a route /api for example, I can publish the app to Azure Web App and use the api by accessing someproject.azurewebsites.net/api/controller.
However, when I separate a web API part from the web app project, I have to publish the web API project to new domain like someapiproject.azurewebsites.net. I want to integrate the web API project to the web app just as I did with one combined project.
Is this possible?
If you want to combine multiple APIs, you should take a look at Azure API Management.
I doubt that you can publish multiple APIs into a single Web API since both requires a startup where you configure the host.
What you can do to cleanup your code is to outsource the controller into different assemblies and configure them in the middleware. Here is an example.
Martin Brandl's answer is spot on. But if you want to go the poor man's route, you can create a reverse proxy from your ASP.NET Web App and map app traffic from someproject.azurewebsites.net/apiV2 to someapiproject.azurewebsites.net. This is not a HTTP 30x redirect - the URL will not change for users hitting your /apiV2. I've personally used this approach because the Azure API Management service can get a little pricey. If you don't need the sexy features like throttling, this can be a good way to go.
I'm currently in the planning process for a mobile app I'd like to build, with a companion web app. The Mobile app and the Web app will share common data (for example, users can take a questionnaire in the mobile app or take the same questionnaire on the web app).
I've used Azure a couple of years ago to create and host a web app, but this is my first venture in mobile development. I'm trying to wrap my head around the architecture in Azure for hosting the API.
I've searched high and low, but either can't find a definitive answer to my question, or am not quite understanding what I am reading on the subject.
Basically: Where would my API live in Azure? Would I create a Mobile App in my App Service, which hosts the shared web API? Then create a Web App in the app service, and use something like RESTSharp to access the API from the web app?
AFAIK, Web Apps and Mobile Apps are just different types of Azure App Service Apps which use to host the relevant applications (e.g. WebApps host website,webapi and MobileApps serve as the mobile backend service). Basically, they are the same and the difference between them is the app type and the Quickstart tutorial for them.
For mobile development, you could leverage the relevant SDKs (server-side and client-side) provided by Mobile Apps. You could also deploy your mobile backend application to Azure Web Apps to get the Mobile Functionality.
For Web Apps, you could follow here to build your web application and deploy to web app. For Mobile Apps, you could follow here to build your mobile backend and the tutorials for building your mobile client project.
Basically: Where would my API live in Azure? Would I create a Mobile App in my App Service, which hosts the shared web API? Then create a Web App in the app service, and use something like RESTSharp to access the API from the web app?
AFAIK, for Azure Mobile Apps backend, you could choose Node.js or C#. The relevant server SDKs provide out-of-the-box CRUD operations against the table. I would use the Mobile Apps SDKs to build my backend project and provide the ability to do operations on the specific table and the custom Web API to handle other operations. For your web app, you could use RESTSharp or just leverage the client SDKs provided by Azure Mobile Apps to communicate with your mobile backend endpoint (hosting on a web app or a mobile app).
For C# mobile app backend and mobile client side tutorials, you could follow adrian hall's book here.
For Node.js related mobile backend development, you could follow 30 DAYS OF AZURE MOBILE APPS.
I am completely new to the concept of servers, web APIs and web applications. I have a project where I need to design a Web API that allows clients to modify a database (hidden from the clients through the API).
And there is also a web application which has some functionalities. The web application also has to interact with the database.
So my question is, should I develop the Web API (Server) and the web application in the same project or two different projects?
I chose to implement the system using Mean stack for learning purposes. Mean stands for MongoDB, ExpressJS, Angular and NodeJS. As the Mean stack contains technologies to develop both the API and the Web app, am I supposed to develop all the code within one project and deploy it in my server or separate the Web API and the web application into two projects?
If it depends on the scenario, then to which kind of scenarios should I choose each and what are their pros and cons?
If shortly, Web API, it's backend, it's service, which you use in web application, and, web application, it's frontend, it's web site, which you see in your browser.
You can create one repo at github but server-side and client-side projects are separated.
You can choose the structure of your server-side and client-side projects depending on the purpose of your project. If you are going to create web application and then to develop mobile application (with ionic, for example) you should create web API separately. If you are going to create only the web application and to deploy your web application and web API to the same service (like heroku) you can make the same structure as in the heroku example (https://devcenter.heroku.com/articles/mean-apps-restful-api , also check the repo of this example https://github.com/chrisckchang/mean-contactlist-angular2 ).