My first ratpack apps

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

My first ratpack apps

uris77
I've been learning ratpack for the past 4 or so months and in the process wrote two apps for an NGO. They are deployed on heroku at the moment. There is no test coverage yet, it is next on my list.

These are the apps
https://github.com/uris77/got-get-campaigns
https://github.com/uris77/zone_mappings

One is just a CRUD app and the other is visualizes the data in a map (and plans for using d3 in the future).
rus
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

rus
Super cool.  I have 2 questions though :)

1. How come you're using httpbuilder and not the Ratpack http client?  If you use httpbuilder you'll need to wrap it in blocking.

2. Are you using the allanbank mongo driver?  I saw an import.  I haven't used it but I thought it was async non blocking so you wouldn't need to wrap in blocking.
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

uris77
I couldn't figure out how to get the google oauth ids with ratpack's native http client. So fell back to httpbuilder. I intend to try again once I get a break with my actual work.

I started using allanbank's mongo driver but abandoned it and changed everything to 10gen's driver. It added an extra layer of complexity that didn't make it worthwhile. The api itself is more complicated than using the native api, and the documentation wasn't very helpful. The code was also more complicated (for example, try getting a instance of the object id). I'll remove the allanbank dependency after I add the tests.
rus
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

rus
Pitty the allanbank driver didn't work out.  Hopefully the official mongo one will be easier to use.  Looks like it will have an Rx client too https://github.com/mongodb/mongo-java-driver/tree/3.0.x
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

uris77
Yeah, I think they will keep the same api. If the allanbank driver had kept the same api for querying, saving, etc; I would have stuck with it. Mongo's strength is the simplicity of its api, imo.
rus
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

rus

Anyway, really cool to see some ratpack apps in the wild. Let me know if i can help with the http client when you circle back round to it.

On 28 Oct 2014 22:25, "uris77 [via Ratpack Forum]" <[hidden email]> wrote:
Yeah, I think they will keep the same api. If the allanbank driver had kept the same api for querying, saving, etc; I would have stuck with it. Mongo's strength is the simplicity of its api, imo.


If you reply to this email, your message will be added to the discussion below:
http://forum.ratpack.io/My-first-ratpack-apps-tp749p753.html
To start a new topic under Ratpack Forum, email [hidden email]
To unsubscribe from Ratpack Forum, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

Luke Daley
Administrator
Great stuff. Thanks for sharing.

Will they be public when they go up?
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

uris77
They are already up, but requires authentication. I haven't secured them properly yet. Currently it requires a gmail account, but in the future will have to add some admin interface to limit access.

I think I should explain what they do and who the app is for. There is an NGO here that works with populations that are most at risk of being exposed to HIV. They are currently trying to identify locations that they label as 'hotspots' where it is most likely that most at risk(MAR) populations can get involved in high risk activities. They also need to map locations nearby that provide condoms, educational material, etc. This can help them target their 'outreach' where it is most needed. One of the apps is just a plain CRUD app where they enter the information of all the locations that they visited. The second app just visualizes the data in a map. For the future, we plan to add some interactive visualizations, like d3 charts, a map that has a time-series element which would allow them to view how the localities change over time, etc.  Since they don't have any funds, I do this in my freetime, so development is a little slow. I hope this explains why I can't share the links. The only one I can share, for now, is the app that visualizes the locations , since no data can be modified there: http://outletmappings.pasmo.bz

The apps are hosted in Heroku. Initially I was going to use nodejs. We needed something that didn't use too many resources and would cost $0 or be as cheap as possible because any  funds needed for hosting would have to come out of my pocket. I started playing with ratpack and it became an immediate candidate when I saw how few resources an ratpack app requires. The apps are not doing anything complicated nor taking advantage of ratpack's async nature. So it isn't very sexy. But it made it possible to provide something useful at very little cost to an organization that appreciates it.
Reply | Threaded
Open this post in threaded view
|

Re: My first ratpack apps

Luke Daley
Administrator
Awesome. Thanks for sharing that context. Great to see something we spent so much time on being used for good.