title: Chat Script with PHP/MySQL like Facebook
body: <p>I am currently developing a PUBLIC and OPEN SOURCE ecommerce software and want to embed a chat plugin into it using PHP/MySQL (similar to Facebook). But much simpler. You can see the draft preview below.</p>
  
  <p><img src="https://i.stack.imgur.com/80hTT.gif" alt="Preview of chat script"></p>
  
  <p><strong>Functions:</strong></p>
  
  <ul>
  <li>Send and recieve messages (only friends)</li>
  <li>Add / Search / Remove / Block Friends</li>
  </ul>
  
  <p>Security is important issue, because this chat plugin would be embedded into software and that software will be published as OPEN SOURCE.</p>
  
  <p>My question is that where should I <strong>get down</strong> to writing it and how to get <strong>good security</strong>?</p>