coopdevs / katuma

ABANDONED - Old Katuma's backend API
http://www.katuma.org
21 stars 9 forks source link

Add Upload powers to katuma #65

Open andresgutgon opened 8 years ago

andresgutgon commented 8 years ago

WAT

I think it's something nice to have be able to upload images in an application.

Some uses could be:

  1. Users upload avatar.
  2. Products with photo.
  3. Group home photo ala Facebook page.

    Tech

I'm talking about use something like paperclip or carrierwave or another one that you consider is better for our needs.

Voluntaries?

@enricostano , @edulan @sauloperez ? :)

Motivation

A part from real utility of being able to upload image in the app, for me is the psychological factor. It's very sad being developing the front end without see avatars. Come on :)

edulan commented 8 years ago

@andresgutgon I can take care of that as I already did for the photobooth.

From my experience, using gems like paperclip is the easiest way possible, at least for backend. We can also use workers for image processing. For frontend it requires a bit more work, as you'd have to adapt your XHR request to support multipart uploads.

We can talk about that offline if you want :+1:

enricostano commented 8 years ago

I'm in of course with this, just let's talk about planning the implementation bearing in mind future use cases that we already are aware of.

andresgutgon commented 8 years ago

For frontend it requires a bit more work, as you'd have to adapt your XHR request to support multipart uploads.

That's another story :) Let's add this feature to the backend and then we make the changes in the front end

enricostano commented 8 years ago

This is another option https://rubygems.org/gems/dragonfly

Let's try to pick the most lightweight solution, if possible of course.

andresgutgon commented 8 years ago

Here the winner is Paperclip https://www.ruby-toolbox.com/categories/rails_file_uploads

enricostano commented 8 years ago

That's not the right criteria IMO, please let's try to apply critical thinking.

andresgutgon commented 8 years ago

What's the right criteria?

rewritten commented 8 years ago

Consider refile (new library from the ones behind Carrierwave, it's supposed to be better.) https://github.com/refile/refile

Se also: https://ruby5.codeschool.com/episodes/626-episode-583-september-15th-2015/stories/4952-best-rails-image-uploader

rewritten commented 8 years ago

Also for avatars there is a neat and free option at avatars.io (supports getting avatars from social networks, gravatar and even almost transparent uploads)

enricostano commented 8 years ago

thanks @rewritten nice inputs!

on criterias @andresgutgon , the first one should be: what we actually need, knowing the use cases and choosing the right tool. Community adoption is of course something to take in account but should not lead us to blindly adopt stuff.

andresgutgon commented 8 years ago

Thanks @rewritten nice!

@enricostano agree on put our needs before other criteria. But I think all those options are good for us. Aren't they?

enricostano commented 8 years ago

If all those options are good for us (still not sure though) we should choose the one that requires less dependencies. And after that we can talk about community adoption.

andresgutgon commented 8 years ago

If all those options are good for us (still not sure though) we should choose the one that requires less dependencies. And after that we can talk about community adoption.

Sounds good to me :+1:

enricostano commented 8 years ago

:heart_eyes:

andresgutgon commented 8 years ago

BTW just saying that experiment with webtorrent for managing our assets would super cool https://torrentfreak.com/webtorrent-brings-bittorrent-to-the-web-impresses-netflix-151213/ :trollface:

enricostano commented 8 years ago

LOL

edulan commented 8 years ago

After taking a quick view into 3 candidates (refile, carrierwave and paperclip), I'd go with either paperclip or carrierwave, as they both have been around for a long time and heaily tested by the community.

Refile is pretty similar to paperclip, but also has sinatra as a dependency :scream:. IMHO seems too new for production (~ 1 year old) Carrierwave is more decoupled from AR and has only necessary dependencies, but if you want to use with Rails, it'll hack your models via AR::Model callbacks. I like the separated uploader class approach though. Paperclip is the classical choice, but maybe has more options than we really need. In the other side it's almost plug and play (very similar to carrierwave) and has interesting plugins like delayed_paperclip

Some metrics:

Open bugs count

Active since

andresgutgon commented 8 years ago

@edulan you are the man :clap: +1 for Paperclip

enricostano commented 8 years ago

Again we didn't analyzed our actual needs first :sob:

andresgutgon commented 8 years ago

Again we didn't analyzed our actual needs first

What are our needs? Are they special? or we just want being able to upload images to our models?

I think the second is a good start

enricostano commented 8 years ago

I think that Paperclip is too old actually

andresgutgon commented 8 years ago

I think that Paperclip is too old actually

Lol @enricostano that's a valid argument? How it's that related with "our actual needs"

enricostano commented 8 years ago

I was just playing the same game :trollface:

andresgutgon commented 8 years ago

Soooooooo, can we use Paperclip?

enricostano commented 8 years ago

Since all the available options have pretty nasty drawbacks and there is no neat and clean solution we can pick Paperclip. Democracy FTW :hand:

andresgutgon commented 8 years ago

Since all the available options have pretty nasty drawbacks

Well, it's sofware and it's Open Source. You know? ;)

enricostano commented 8 years ago

Can we prioritize this? I would add avatars (and uploads in general) after a first draft of the app.

I would like to see the basic workflow working even if not perfect from the UI point of view.

In the backend I would concentrate now on the following things:

what do you think?

andresgutgon commented 8 years ago

I think having uploads is not a priority but a really nice to have. If @edulan want to do it would be great. And integrating in the front end should not be too difficult.

enricostano commented 8 years ago

It's not a #5min task IMHO, and we have more basic stuff missing.

Of course if @edulan doesn't like any other missing part and want to implement uploads he's more than welcome!

sauloperez commented 8 years ago

I agree with @enricostano , we have too many basic things still to do. But in any case, I would go for CarrierWave. It's seems to be the more robust solution: https://infinum.co/the-capsized-eight/articles/best-rails-image-uploader-paperclip-carrierwave-refile