codereading / cuba

Rum based microframework for web development.
http://cuba.is
MIT License
6 stars 2 forks source link

Building a sample Cuba app #8

Open agis opened 12 years ago

agis commented 12 years ago

Hey @codereading/readers, just an idea:

How about we decide a sample app to build (using Cuba), everyone starts on their own and when a date comes we compare them and discuss about the approaches we've took?

I understand this may be time-consuming for some of us but I also believe it's a great way to experiment with the framework.

kathgironpe commented 12 years ago

@Agis- +1 It's a good idea. I haven't started anything with Cuba but I use Sinatra a lot. Would be good to share some notes too.

agis commented 12 years ago

Or we could even make a Google Hangout to do the discuss/compare part.

ericgj commented 12 years ago

It's a great idea. I've been doing a side project using cuba since we started looking at it, and there's a number of things I've come across it would be great to discuss.

What about taking a page from TodoMVC and everyone try implementing a todo list app with cuba?

theldoria commented 12 years ago

@ericgj +1 implementing a todo list app is great idea.

adamakhtar commented 12 years ago

I'm up for all of the above.

Adam Akhtar Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On 2012年8月4日Saturday at 23:02, theldoria wrote:

@ericgj +1


Reply to this email directly or view it on GitHub: https://github.com/codereading/cuba/issues/8#issuecomment-7501964

agis commented 12 years ago

Since I'm a beginner, how would you approach this? I mean, how would you define your routes, would you use SQL or NoSQL? Would you break this down into sub-apps?

Also, we should have a User model too, right?

theldoria commented 12 years ago

It would be greate to have a minimal spec to define the features of the app, possibly using cucumber, so everyone can test it's application against the spec.

agis commented 12 years ago

@Theldoria :thumbsup:

ericgj commented 12 years ago

@theldoria, not sure we need something so formal given the purpose of the exercise is exploratory (trying out cuba). I can see it if we wanted to do something like implement the same app in different frameworks. The main thing here I think is just to have some motivation for a 'real-ish' project, and since what makes a good todo app is highly dependent on your workflow and situations... I kind of hesitate to put down specs everyone must implement, for fear of squashing motivation.

That said, I think it's definitely worthwhile to think about what kind of functionality would give us some useful exercise. For instance, here's a start of a list:

I realize this list is a bit backwards from where you would start for a real project. Personally I would start with the front end before I think about any of this, but since we're talking about cuba, this is a very sketchy outline of what I'd want to try out on the server side -- not necessarily on the first iteration. Leaving all details undecided about what the backend should be, what the templating should be, how the client communicates with the server, etc.

Does this help?

agis commented 12 years ago

@ericgj That's exactly what I was asking for, a general direction for us newbies :)

I found all your points very reasonable, although I'm not sure on how to approach the last one. As for the authentication system, would you roll out your own or use an already existing plugin?

ericgj commented 12 years ago

@agis I generally reach for OmniAuth, given it makes it easy to add/change auth strategies down the line and you can just basically drop in the dummy 'developer' provider to begin with.

But, I do like the simplicity of cyx/shield, and it could definitely use some documentation, so that is kinda motivating me to try it.

The typical case for my job would involve authenticating vs ActiveDirectory via OpenSSO, for which I use a custom OmniAuth provider. So my idea is to use the shield interface, e.g. authenticated(User), but implement it via OmniAuth instead of shield. But I haven't looked at the feasibility of that too closely yet.

PS. regarding app environments, one place to start is with the convention that Rack uses (and Sinatra on top of Rack) - the environment variable RACK_ENV .

agis commented 12 years ago

OK guys I'm just starting, I'm using Mote (the template engine from the Cuba folks), Ohm (their hash-mapping library for Redis) and Bootstrap (twitter). I've implemented the basic Create & Read functionality (list all tasks, view a task, create a task) till now, it's pretty basic but I got an idea of how rendering, routing and redis works. Awesome: https://github.com/Agis-/cuba-todo