I am building an angular app and the next step is to put it on GAE and I was wondering what backend should I use. I have my html pages ready I just need now to set up a backend so I can store and retrieve data for my little project. An information on this would be great. I don't think I would need to use jinja for this.
Well, as you say, Angular will be used for UI. For the backend, GAE being PaaS, it gives you number of services. One of the services is persistence. It's done using either the Data Store Service (NoSQL) or Google Cloud SQL. You can also make REST API around your persistence and business logic in the backend using Google Cloud Endpoints that you can use in JavaScript client.
To develop the backend and make use of these services you have many options: PHP, Python, Java, Go, ... . You can pick the one you like and more familiar with.
If you decide to use Java, you may want to take a look at Objectify. It makes your persistence code simpler and clearer than using the Data Store API directly. Also Google Plugin for Eclipse will make it much easier for you.
Note that although I used links here for services in Java, there are similar pages for python and other languages too. So you can use the same services in your favorite language.
Related
The google app engine documentation uses JS to build the frontend functionality for their google cloud endpoints. https://cloud.google.com/appengine/docs/python/endpoints/getstarted/clients/js/client_ui
It seems overly complicated.
Could I use python and my jinja2 templates to collect user data and redirect it to the endpoints with the handlers, without using any JS?
i.e. my request.handler collects the required info, redirects it to a specific endpoint that creates the ndb compatible Model, sends it to the database and returns a success.
Is that a good way to implement my application logic?
If you don't want to write a JS app, there's no reason to use the cloud endpoints at all; just write an AppEngine app in Python and Jinja and use the standard ndb calls to write to the datastore.
Edit of course you can post to the endpoints using any language you like - they're just HTTP, after all - but I really can't see why you would want to. Most of the complexity in an app is in defining the models correctly in the first place; adding the endpoints on top of that is something you would do only when you actually need to extend the app to other platforms. Don't build things you might need later; build what you need now, and the rest when you do need it.
I have previously used
#app.route('/mypage/<int:myvariable>/')
to create rules for what should happen when users land on different urls on my website. I have done this on local machines that have been running on my own virtual servers.
Now I am learning to publish my first web app to Google App Engine. I have heard that I should be using Google Cloud Endpoints instead of the route decorator.
#endpoints...
I've read a few articles about endpoints and some of the benefits of endpoints that they list are:
Endpoints makes it easier to create a web backend for web clients and mobile clients
Endpoints free you from having to write wrappers to handle communication with App Engine
Even if I have read this I can't wrap my head around what this means. I don't understand it. Can you explain in non-technical terms with examples what the advantages of using #endpoints is compared to alternatives? The alternative that I am familiar with is #app.route.
Google Cloud Endpoints can be thought of as a subset of #app.route. They are intended to solve the API backend problem for mobile and javascript clients. They are not intended to serve web pages and other hypermedia. You can use the normal routing methods of your framework of choice to create a web service for your application but Google Cloud Endpoints takes care of a lot of boilerplate for you.
There are a lot of limitations with Google Cloud Endpointsso be sure to familiarize yourself with them before committing. For one, you cannot host Google Cloud Endpoints on a custom domain name. They are only accessible via <app_id>.appspot.com/_ah/api/*
Endpoints makes it easier to create a web backend for web clients and
mobile clients
What this means is that you can create one backend and then iOS, Android and Web-apps (via Javascript for example), can execute your API methods with specific client generated libraries.
This is convenient if you are building a backend that you want to be easily accessed via smartphones or through a web browser.
Endpoints free you from having to write wrappers to handle
communication with App Engine
With Endpoints you can generate client libraries (e.g. Android, iOS, Javascript) that you can then execute your API methods. You don't have to worry about writing a bunch of additional code to do that.
My Opinion:
I have never used Cloud Endpoints to make a web-app but it is very convenient if you are making a mobile app for iOS and Android because you can access your backend with both platforms.
One reason you might want to use Cloud Endpoints for a web-app instead of something else is because of Datastore. Datastore is the way Cloud Endpoints stores data. It is a NoSQL storage method which is kinda tricky to wrap your head around at first if you come from a relational database background, but once you get it, it makes a lot of sense.
I would like to set up Polymer in App Engine. I would prefer to be using Go to do this if it's even necessary? For data storage I would like to use MongoDB. Does this sounds like a feasible set up for a web-app that acts as a front facing information portal, taking product sales, as well as providing business admin functionality?
There is an experimental Go runtime for App Engine, although it has restrictions, like all App Engine runtimes. Make sure you're familiar with those restrictions before committing.
You can't run MongoDB on App Engine, but you can of course do so on Compute Engine; in fact it's available through Click to Deploy.
You may also like to look at Managed VMs for more flexibility.
As far as client-side frameworks are concerned, you can use what you like: Polymer, Angular, Bootstrap... it's up to you.
Im starting a new application with AppEngine and I need a REST Service.
I was looking at Endpoints and I think they are exactly what I need.
I also read Google don't recommend to use Endpoints in production but my app first version is not going out until April approximately.
How mature do you think App engine Endpoints are?
Do you recommend to use them or should I find another REST framework.
If so, Are there any other REST framework similar to App Engine Endpoints?
or
Which one do you recommend, Restlet? or use it with Spring MVC?
Thanks
I'm a bit biased (being a Googler and member of the App Engine team), but I think Endpoints is worth a try. With regards to the general disclaimer on using Endpoints in production, we have allowed some developers to launch in production as long as they have spoken to us first.
I provided another answer to a related question on RESTful development here. The developer tried Endpoints and decided to use it over other options.
I'm using GWT to create a simply app that allows teachers to create easily their own lessons.
The App is going to be on Google App Engine but I want to store lessons in user's Google Docs space .
Is it possible?
As far as I know gwt transforms java into javascript but google docs api is java, do i have to upload the java library to de app engine storage?
any place to start? any advice?
Thanks...
You need server side proxy for GWT client.
Your GWT client communicates with the servlet. The servlet is the actual agent using the google docs API.
Please read my explanation at http://h2g2java.blessedgeek.com/2010/05/accessing-google-userservice-from-gwt.html.
It explains how to get a GWT client could communicate with a Java based Google API. It explains that since GWT requires all Java source involved to be available to the GWT compiler, there are cases that you simply cannot get GWT client to do the task directly.
http://h2g2java.blessedgeek.com/2009/08/tablemgr-gae-gwt-gdata-with-rpc.html similarly explains how to combine gae + gwt + google docs, using the proxy approach. The posting is quite old and therefore the web site it points to does not work anymore because I have not updated the gae app with google mandated authentication measures. But it should work on your local machine.
The above subscribes to a webserver flow paradigm.
However, Google APIs are essentially REST APIs, which allows you to access them directly using your javascript or GWT client. So, instead of using the Java docs for Google APIs, you need to read the Google REST API docs.
http://code.google.com/more/, among other whatnots, provides a list of all the Google cloud APIs. To avoid using the webserver-proxy flow paradigm, choose the javascript or REST version of the API docs.
Here is the google docs/data API:
http://code.google.com/apis/gdata/docs/client-libraries.html.
Choose the javascript API:
http://code.google.com/p/gdata-javascript-client/
I advise you to first practice using these APIs by coding in javascript. Then you would get a good grasp of what you need to do in GWT.
You should use the GWT API for authentication prior to accessing the Google REST APIs.
http://code.google.com/p/gwt-oauth2/.
Essentially, you are obtaining an authenticated token which your client could use to access Google's data thro their REST APIs.
FYI, REST APIs are, in plain speak, URLs in a defined specification, where data transmission is by convention mostly in JSON or XML.