gae-boilerplate documentation - google-app-engine

In my search for a good social login package for App Engine, I am giving gae-boilerplate a try. But I find there is no documentation except the readme file, which I think it is not enough at all.
I have many questions, among them:
Should the boilerplate be used as a library or download and modify as needed?
How should the boilerplate be updated?
What does each model do?
Where should my templates go?
Should I have a different routes file?
Should I derive my Handlers from BaseHandler?
In general, what things should I implement in my pages? For example, I found out that I have to include a csrf_token in all POST requests. It would have been nice to know this in advance, and the many other things that I'm having to find out along the way, and which I implement without being sure if I'm supposed to be doing that.
And some more...
My biggest problem is that Social login is not working, and I feel this boilerplate is a big monster with which I don't know where to start. To make things worse, it is hard to debug social auth from any machine that is not the production one. Thats why I'm desperately looking for some docs.
I have not found anything in SO, and I guess there must be more people in my situation. So, any pointers to documentation that could help to understand gae-boilerplate a little bit better would be very appreciated.
EDIT: I switched to gae-boilerplate in a site that I had previously working. Maybe most of my problems come from the way that I have tried to integrate gae-boilerplate and my existing site. As a result I have tried to treat gae-boilerplate as a library, and keep my own templates, handlers, static files and such.
Thank you guys!
EDIT 2: After trying other options, I have to say that I am very happy with gae-simpleauth. It works really well, and Alex's support is superb.

I will try to answer most of your questions below:
Should the boilerplate be used as a library or download and modify as needed?
You can modify it as needed based on your specific requirements.
How should the boilerplate be updated?
What do you mean?
What does each model do?
User and SocialUser are pretty self explanatory. LogVisit and LogEmail are used for auditing purposes.
Where should my templates go?
In the templates directory
Should I have a different routes file?
No, you can use the existing file for all your routes.
Should I derive my Handlers from BaseHandler?
It't not mandatory but I would recommend to do so. BaseHandler is very handy and provides a lot of good stuff.
In general, what things should I implement in my pages?
What exactly do you mean?
In general, you can use gae-boilerplate as a reference on top of which you will built your own project. Study the code step by step, try to figure out what is the purpose of each file and library used and how they work together. This way you will gain good knowledge of a lot of things like jinja templating, oauth2, etc.
Hope this helps.

Related

Blog on Google App Engine for Java

I am considering to add a Blog on my GAE/J application and wondered what is the best way to do so.
Are there any implementations I can use?
Should I write something on my own?
I read about Microblog but it is written in python, I am not sure it will co-exists with my Java app.
Appreciate your thoughts.
While I don't know any implementations that you can use, this question is very broad and there are a lot of different things that you could do, and writing your own is one of them.
Just to begin with you could use the Blogger API to read the posts and present them in your app. By doing that you're able to add/modify/delete posts using the Blogger's UI and in your own app you will only present the posts. The only problem with this solution is regarding the comments, where you could implement your own (just to start somewhere) or include maybe the Facebook's Comments Box.
I did exactly that for the kiebdoj.com/blog/ and it saved me a lot of time for not implementing my own WYSIWYG editor or a post manager. That was written in Python, so I can't provide any examples, but in either case it wasn't written to work on it's own.

How to implement Backbone boilerplate with views

I am trying to learn backbone, however truth be told, I'm feeling a little overwhelmed. Everywhere I look it is being done in a slightly different way, each with more frameworks and plugins to learn. So I have decided to put my faith in Addy Osmani and am reading his Backbone Fundamentals book. I have followed his recommendation and used the Backbone-Boilerplate. However for whatever reason, I have been unable to successfully install Grunt BBB so I cannot download the working examples.
What I am trying to do is follow this router section and use views. http://addyosmani.github.com/backbone-fundamentals/#router.js.
The problem is that I think these instructions are incomplete. For a start the collection.fetch() variable is in the wrong scope, and I really am not understanding where I need to place the views and how. I am pretty sure that if I could see a working example of this I could understand it, but as I said, everywhere I look its a different implementation.
Does anyone know how to use the backbone-boilerplate with routers and views? Are there any working examples anywhere?
Let me make a suggestion. A couple of months ago, I was where you are now: trying to learn backbone and trying to follow best practices while I did so. Like you, I came across Addy Osmani's book and like you I tried getting stated with backbone-boilerplate.
After much stumbling around, I eventually concluded that backbone-boilerplate was not something I needed to have while I was just learning backbone. It is now, only after having created a fully working, non-trivial CRUD application that I start to see how I might incorporate backbone-boilerplate. I think you probably need to be asking the questions that backbone-boilerplate answers (How can I break up my application into modules?, etc.) before you attempt to incorporate another framework or plugin. The same goes for Backbone.Marionette: great library, but you really need to have something to apply it to before using it.
Starting out, I would suggest having just a single file for all your backbone code.
One of the things that really helped me out was playing around with and extending various jsfiddle demos people had created using backbone. A simple google search will turn up quite a few. I found it a great way to learn as I was able to manipulate working code and get immediate feedback on what worked and what was allowed.
And although backbone is a client-side library, it's often simpler and faster just to ignore html and write stuff out to the console.
Finally, if you're willing to pay for it, I highly recommend Liam McLennan's set of backbone.js training videos on pluralsight.

how to get a smartclient example on the web?

I'm pretty much totally lost.. I've posted twice on the smartclient forums and gotten no help so maybe the people here are more friendly than their own staff. (it really bothers me but they appear to have the best software for what I'm trying to do)
I'm trying to wrap my head around how I would get one of their examples (the demo showcase ones which I have downloaded etc) on my web host, just to see how it works/play with it, but I couldn't find any forum guides or videos etc on this (documentation is really abysmal for people that don't speak code yet).
Is there some special back-end I need on my web host? Where can I go to figure out how to link the stuff together? Do I have to compile something using java.. etc.
I'm used to just editing stuff in notepad++, uploading it, and hitting refresh, but I'm guessing smartclient isn't that simple, or is it? (I'm just going to use it to make tables from excel spreadsheets that I can filter through, that's it, no fancy application).
Sincerely,
Mr. Totally Lost.
Everything is covered by the guide (page 6) : http://www.smartclient.com/docs/8.2/docs/SmartClient_Quick_Start_Guide.pdf
SmartClient embed everything needed, you will only need a valid JDK installation and the zip provided in their website.

GWT multi-module application

I am a GWT beginner, thinking about developing a management software and deploy it on AppEngine.
In my mind there's a "tabbed" user interface.
Tab1= sales; Tab2= invoices; Tab3= stock ... and so on.
I just completed the Stockwatcher tutorial and it's very cool, but now I was wondering on how to organize my code.
I mean, is making a gwt module for each tab a nice idea? For example, I want to load the interface for the 'invoices' tab only when I select that tab. Even if my idea about multimodule is wrong, can you tell me how to avoid having all my code in a "Stockwatcher" class. E.g. i read about composite, but I can't understand.
Hoping you understand my doubts. Thank you all!
If you haven't done yet anything with GWT before or haven't had much experience do not bother yourself with questions how to organize the code. Just make it. Create the user interface and the backing code. Have your application running and then go back and think about the things that could be improved. Look for the code duplication, read few articles on refactoring and try to apply. First you need to create something, feel the joy of creation and form a foundation for further improvements.

Good facelets resources?

I've been working with JSF for some time, and been using the Apache-Trinidad tags. I like developing using this a lot but I keep hearing great things about facelets. Is anyone out there using it, and what exactly does it get you?
I've looked at the facelets site (https://facelets.dev.java.net/), but it doesn't do a very good job explaining the advantages or any tutorials about facelets. I looked on google, but everything seems to be from 2005 or 2006, surely there's been a lot of changes since then.
Anyone want to chime in with their opinion of facelets or point me to some good resources?
Facelets haven't really changed. It's a very simple templating engine that runs as a JSF view handler and replaces jsp.
The old resources are still valid.
Uses xml for templates.
You can use EL anywhere.
Very few tags.
Very simple
...
In my humble opinion, it is a much better approach to create the interface than JSPs.
It's really a great thing about facelets. They did it right the first time, so I guess theree has been no need to upgrade it. Also seems like something like facelets is making it's way into the JSF 2.0 spec. (http://jcp.org/en/jsr/detail?id=314)
At one of the places I work, I've just converted a project from JSF 1.1 to JSF 1.2 with facelets, and I really like it. What I got from it was:
Templating (no need for tiles)
Better debugging (debug views instead of just stack traces)
ui:repeat and c:if etc
Can use html intermixed with tags, allowing me to use a plain html table with colspans without no extra taglib if thats what I want.
syntax almost same as jsp, so it's easy to convert pages.
rolling your own components is now really simple.
As for resources, I guess the old ones are still valid.
I've just started working with facelets as well, and so far the best resource I've found is the book "The Definitive Guide to Apache MyFaces and Facelets" from Apress. While it's likely you won't need the other chapters, since you've worked with Trinadad tags already, I've found the examples they use to explain facelets give a good concrete foundation. I'm constantly refering to the text to pull out bits of code.
PS Here's the link from Google Books, it'll at least give you a taste of what's inside.

Resources