Simple Social Networking with Ruby on Rails

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

Notes on slide 1

* application manager (bb, univ. vermont) * developer (php, etc, rails in the past year)

1 Favorite

Simple Social Networking with Ruby on Rails - Presentation Transcript

  1. Simple Social Networking With Ruby on Rails
    • Justin Henry
    • [email_address]
    • http://greengaloshes.cc
  2. Look, Ma! I’m on the Internets!
    • delicious/kapowee
    • vimeo.com/bootstraps
    • flickr.com/zappowbang
    • twitter.com/jhenry
    • upcoming.org/jhenry
    • goodreads.com
    • yelp.com
    • linkedin.com
    • brightkite.com
    • friendfeed.com/puddlestomping
  3. Simple Social Networking With Rails
    • What is a social network?
    • Why build a social network?
    • How might one build a social network?
    • Hey, look, an example!
  4. What is a social network?
    • Context of web applications
      • Wikipedia has more on the broader, sociological concepts:
      • http://en.wikipedia.org/wiki/Social_network
  5. What is a social network?
      • Provides a Utility/Function (Content)
        • Content is still king
        • Content tends to be user-generated, controlled, and owned *
        • Content interaction patterns (generating new content, sharing/republishing, modifying/remixing)
  6. What is a social network? http://www.flickr.com/photos/vj_pdx/144902289/
  7. What is a social network?
        • It's People!
          • user relationships are many-to-many
          • a blog is one-to-many
          • User interaction patterns (friendships, fans, friends-of-friends)
  8. Why build a social network?
    • What are you selling?
      • Idea, product, theology, movement, etc.
    • Why will your users come here?
  9. Why build a social network?
    • What channels do you currently reach with your customers?
      • How are you interacting with your customers?
      • How do your customers interact with each other?
      • How do your customers interact with their customers and others around them?
  10. Why build a social network?
    • The evolution of the newsletter
      • newsletters -> email lists -> blogs -> social networks?
  11. Why build a social network?
      • It's fun!
      • Crowdsourcing
      • Think small - it doesn't have to be the next Facebook.
      • Put The Service and The Community back in community service
      • Scratch that itch
  12. How do you build a social network?
    • Join as many as you can!
      • Get a feel for what others are doing
      • Consider this an education in UX/UI
      • Reading blogs or books will help you become a better writer, so...
      • Using these applications will inform your development process
  13. How do you build a social network?
      • What will our data look like?
        • Users
        • Relationships (friends/fans)
        • Content
  14. Pre-Fab vs. Home Cookin'
        • Building from Scratch
          • It's not too far off from the build-a-blog in 5 minutes example
          • Just need a few more models, right?
          • Add in a few plugins....
  15. Home Cookin' - Example Relationship Text create_table :connections do | t | t.integer :person_id t.integer :contact_id t.integer :status t.timestamp :accepted_at t.timestamps end Insoshi's connections migrations:
  16. Home Cookin' - Example Relationship create_table :friendships do | t | t.integer "user_id" , :null => false t.integer "friend_id" , :null => false t.datetime "created_at" t.datetime "updated_at" t.timestamps end Daniel Fischer’s “Fischy friends” example:
  17. Home Cookin'
    • A few plugins and tools for consideration:
      • Paperclip
      • acts_as_commentable
      • acts_as_taggable_on
  18. Pre-Fabricated
    • Refactoring other people's code is a great way to learn
    • Leaves you with the time to focus on implementing features, etc
  19. Pre-Fabricated
    • Community Engine "plugin"
    • Insoshi platform
    • Ning (furniture included!)
    • Bort, etc (just the walls, please)
  20. Enter Insoshi
    • Advantage: a lot of pieces are pre-biult
      • galleries, forums, blogs, messaging, activity feeds, events
    • Disadvantage: a lot of pieces are pre-built
      • may be lots to change or retrofit
  21. Inshtalling Insoshi
    • To sphinx or not to sphinx?
      • installing sphinx on OSX is a pain - need to add symlink, i.e.:
      • $ sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
    • To install without sphinx, just skip that part of the install process.
  22. Building on top of Insoshi
    • Yaay, I've got tests, yaaay!
    • Users and relationships already exist
    • Choose a model(s) to repurpose as needed (i.e. for custom content)
    • Build new model(s) for custom content and interactions
  23. Example App - MyEventCarbon
    • App for attendees/promoters of local events:
      • See the carbon footprint of their events
      • Organize carpools
      • Suggest bus routes and other alternatives
  24. Example App - MyEventCarbon
      • Repurpose Insoshi's nascent event model
      • Use Gmaps api for geocoding
      • AMEE for carbon calculations (amee.com)
  25. Example App - MyEventCarbon
      • Plugins
        • ym4r for embedding google maps
        • rspec_response_enhancer - add more descriptive output to rspec
        • Floppy-amee - for interacting with AMEE data
  26. Example App - MyEventCarbon
  27. Example App - MyEventCarbon
  28. Example App - MyEventCarbon
  29. Example App - MyEventCarbon
  30. Example App - MyEventCarbon create_table "event_attendees" , :force => true do | t | t.integer "person_id" t.integer "event_id" t.string "origin" t.string "distance" t.string "carbon" end schema.rb
  31. Example App - MyEventCarbon belongs_to :person has_many :event_attendees has_many :attendees , :through => :event_attendees , :source => :person , :select => "event_attendees.origin, event_attendees.distance, event_attendees.carbon, people.*" app/models/event.rb
  32. Example App - MyEventCarbon
    • Carpooling?
    • How to build a carpooling feature in?
    • What would schema look like?
  33. Example App - MyEventCarbon create_table "communications" , :force => true do | t | t.string "subject" t.text "content" t.integer "parent_id" t.integer "sender_id" t.integer "recipient_id" t.datetime "sender_deleted_at" t.datetime "sender_read_at" t.datetime "recipient_deleted_at" t.datetime "recipient_read_at" t.datetime "replied_at" t.string "type" t.datetime "created_at" t.datetime "updated_at" t.integer "conversation_id" end You could modify an existing model: ... but that could impact other parts of the system.
  34. Example App - MyEventCarbon class CreateCarpools < ActiveRecord::Migration def self.up create_table :carpools do | t | t.integer :person_id t.integer :contact_id t.integer :event_id t.integer :status t.timestamp :accepted_at t.timestamps end A new table might be more appropriate: Duplicate the connections table, add an event_id and whatever other fields as needed.
  35. Example App - MyEventCarbon
    • Next steps
      • Carpooling offering/accepting/tracking
      • “Live” carbon calculations
      • Pull events from other services (upcoming, eventful)
      • Import ical files, RSS, microformats (hcal)
      • Adding to activity feed
      • backchannel integration
  36. Moving forward
    • Your homework: Join some more social networks and start using them.
      • They work best when people you know (that's us) are using them with you
    • Join me! Some of my networks are listed at http://friendfeed.com/puddlestomping
  37. Sourced/Resourced
    • Wikipedia article on &quot;Social Network&quot; http://en.wikipedia.org/wiki/Social_network
    • Jim Neath > Building a Social Network Site in Rails: http://jimneath.org/2008/04/25/building-a-social-network-site-in-rails/
    • MissingMethod > How To Build a Social Network with Ruby on Rails: http://www.missingmethod.com/2007/01/08/how-to-build-a-social-network-with-ruby-on-rails/
    • Friendship model examples & self referential models:
      • Dan Fischer > Fischyfriends: http://github.com/dfischer/fischyfriends/tree/master
      • Josh Susser > Self-referential has_many :through associations: http://blog.hasmanythrough.com/2007/10/30/self-referential-has-many-through
    • Installing sphinx on OSX: http://www.sparkboxx.com/sparkboxx/2008/10/installing-ultr.html
  38. Thanks [email_address] http://greengalosh es.cc
SlideShare Zeitgeist 2009

+ jhenryjhenry Nominate

custom

1082 views, 1 favs, 0 embeds more stats

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 1082
    • 1082 on SlideShare
    • 0 from embeds
  • Comments 1
  • Favorites 1
  • Downloads 12
Most viewed embeds

more

All embeds

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories