Skip to content

rweir4/TheCollective

Repository files navigation

README

The Collective

The Collective is inspired by Pinterest, using the idea of collecting images so that you can save and share them with those you follow or that follow you.




Getting Started

Run bundle exec rails db:setup, bundle exec rails db:seed, and npm install.

There is a demo login for a seeded account.

Code Samples

Implementing the upload of images for items took the use of the Paperclip gem. You can upload via file or url. The information is stored using the formData class which is sent off in an AJAX post request.

There is also a search for users. Not yet predictive, but that will be added in the future. Users that are seeded are:

  • rweir11 - DEMO
  • rweir12
  • rweir13
const formData = new FormData();

formData.append("item[description]", this.state.description);
formData.append("item[image]", this.state.imageFile);
formData.append("item[collection_id]", this.state.collection_id);
if (this.props.formType !== 'create') {
  formData.append("item[itemId]", this.props.item.id);
}

if (this.props.loaded) {
  this.props.submitAction(formData).then(() => {
     this.props.closeModal();
  });
}

Accounting for automatic refresh, aka upon change state was another difficulty that was solved by sending formatting my json with adequate user information to which my reducers could add the appropriate information. This methodology was used for collections and items.

Follows has been implemented so that only the items saved by a followed person will appear in the home feed.

case RECEIVE_FOLLOW:
  return merge({}, state,
    {[action.follower_id.follows]:
     state[action.follower_id].follows.push(action.followee_id)
    },
    {[action.followee_id.followers]:
      state[action.followee_id].followers.push(action.follower_id)
    });
  ```

The feed is populated by using jbuilder to format the json for the follows' and current user's items, as well as all other backend data.

<h2>Future Features</h2>

<ul>
<li>Predictive Search</li>
<li>Explore</li>
<li>Notifications</li>
<li>Messaging</li>
</ul>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published