title: MEAN-stack mongoose, where do functions go?
body: <p>So I'm fairly new to the mean-stack and I'm using mean.js as a framework.</p>
  
  <p>Using Yeoman I've made a new CRUD module called groups. In a group I want to be able to have an owner, the user who made the group, and a collection of members. According to the mongoose docs I gave the GroupSchema the following structure:</p>
  
  <pre><code>var GroupSchema = new Schema({
      name: {
          type: String,
          default: '',
          required: 'Please fill Group name',
          trim: true
      },
      created: {
          type: Date,
          default: Date.now
      },
      user: {
          type: Schema.ObjectId,
          ref: 'User'
      },
      members: [{type: Schema.ObjectId, ref: 'Member'}]
  });
  </code></pre>
  
  <p>Now, when a group is created the only member will be the owner. I've got the following app structure:</p>
  
  <pre><code>Project:
    - app (server side code)
      - controllers
      - models
      - routes
    - public (client side code)
      - modules
        - groups
          -controllers
  </code></pre>
  
  <p>Where do I put the method to add the current user to a certain group? My best guess is that the controller should take care of that, but is it the server or the client side controller?</p>