A unf. social network done poorly.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. # Ajax IM
  2. ## What is Ajax IM?
  3. Ajax IM ("Ajax Instant Messenger") is an instant messenger for the web. It is
  4. intended to be integrated with existing websites to provide a more interactive
  5. community experience.
  6. ## Features
  7. * Instant communication between connected users
  8. * Robust backend server built on [Node.js](http://nodejs.org)
  9. * Can be integrated with virtually any existing website
  10. * Seamless authentication
  11. * Works across an entire website, unobtrusively
  12. * Automatic state management between page reloads
  13. * User state and statuses
  14. * and _much_ more!
  15. ## Installation
  16. Install `Node.js`:
  17. wget http://nodejs.org/dist/v0.8.9/node-v0.8.9-linux-x86.tar.gz
  18. tar xzf node-v0.8.9-linux-x86.tar.gz
  19. cd node-v0.8.9
  20. ./configure
  21. make
  22. make install
  23. Install Node Package Manager (`npm`):
  24. See instructions at http://github.com/isaacs/npm.
  25. Install `Express.js`, `Connect` and `Cookie`:
  26. npm install express
  27. npm install connect
  28. npm install cookie
  29. Compile the daemon add-on if you plan on letting the server daemonize itself:
  30. cd server/libs/daemon
  31. node-waf configure build
  32. cp build/default/daemon.node .
  33. rm -rf build
  34. ## Installation for Development
  35. If you want to test Ajax IM as a standalone app for development, you will need
  36. to install [`Jade`](http://github.com/visionmedia/jade) as well.
  37. To install `Jade`:
  38. npm install jade
  39. ## Starting up the server
  40. Starting the server in _development_ mode is as simple as:
  41. node server/app.js
  42. To start the server in _production_ mode:
  43. EXPRESS_ENV=production node server/app.js
  44. To start the server as a _daemon_ in _production_ mode:
  45. node server/app.js start production
  46. ## Testing it out
  47. Once the server is up and running in _development_ mode, you can test it out
  48. through the included development testing app. The below instructions are
  49. assuming that you have left all default configuration options. If not, please
  50. replace the host/port values with the correct ones.
  51. To get started, first initialize a session cookie by going to:
  52. http://localhost:8000/dev/cookie
  53. Then head over to the development page that will initialize the client:
  54. http://localhost:8000/dev/
  55. That's it!
  56. ## More Information
  57. * Follow [endtwist](http://twitter.com/endtwist) on twitter for updates
  58. * [Google Group](http://groups.google.com/group/ajaxim) for discussion
  59. * [GitHub Wiki](https://github.com/endtwist/AjaxIM/wiki) for guidance
  60. ## Node Compatibility
  61. The `master` branch of Ajax IM is compatible with node --version:
  62. v0.8.9
  63. ## Contributing
  64. Pull requests are being accepted! If you would like to contribute, simply fork
  65. the project and make your changes.
  66. ### Style Guide
  67. If you intend on contributing, please follow this style guide when submitting
  68. patches or commits. Submissions that do not follow these guidelines will not
  69. be accepted.
  70. * Use 4 space indents (not tabs!)
  71. * No trailing whitespace
  72. * Blank line at the end of files
  73. * Semi-colons at the ends of lines, where appropriate
  74. * Keep lines to 80 characters or less
  75. * Never bump the version
  76. No whitespace between keys and values:
  77. {foo: 'bar'}
  78. // good
  79. {foo : 'bar'}
  80. // bad
  81. Hash formatting:
  82. {foo: 'bar', baz: 'taz'}
  83. // good
  84. {
  85. foo: 'bar',
  86. baz: 'taz',
  87. moo: 'cow'
  88. }
  89. // good
  90. { foo: 'bar', baz: 'taz' }
  91. // bad
  92. {foo: 'bar',
  93. baz: 'taz',
  94. moo: 'cow'}
  95. // bad
  96. Chained methods:
  97. str
  98. .strip
  99. .replace(...)
  100. .replace(...)
  101. // good
  102. str
  103. .strip
  104. .replace(...)
  105. .replace(...)
  106. // bad
  107. str.
  108. strip.
  109. replace(...).
  110. replace(...)
  111. // bad
  112. Single quotes over double quotes, unless double quotes make sense:
  113. 'hello'
  114. // good
  115. "what's up?"
  116. // good
  117. "hello"
  118. // bad
  119. Ternary expressions are fine, but cannot be nested and must be formatted as:
  120. foo = (a ? b : c);
  121. // good
  122. foo = (something.hasAPropertyLikeThis == 'some other value'
  123. ? 'result one'
  124. : 'result two'
  125. );
  126. // good
  127. foo = something.hasAPropertyLikeThis === 'some other value' ?
  128. 'result one' :
  129. 'result two'
  130. // bad
  131. Use braces for conditionals, unless conditionals are single statements:
  132. if(foo) {
  133. bar();
  134. baz();
  135. }
  136. // good
  137. if(foo) bar();
  138. else baz();
  139. // good
  140. if(foo)
  141. bar(),
  142. baz()
  143. // bad
  144. Closures:
  145. function() {
  146. }
  147. // good
  148. function () {
  149. }
  150. // bad
  151. function()
  152. {
  153. }
  154. // bad
  155. Methods:
  156. foo.bar = function() {
  157. }
  158. // good
  159. foo.bar = function (){
  160. }
  161. // bad
  162. foo.bar = function()
  163. {
  164. }
  165. // bad
  166. ## License
  167. (The MIT License)
  168. Copyright (c) 2012 [Daniel Howard] (http://www.svexpertise.com)
  169. Copyright (c) 2010 [Joshua Gross](http://www.unwieldy.net)
  170. Permission is hereby granted, free of charge, to any person obtaining a copy
  171. of this software and associated documentation files (the "Software"), to deal
  172. in the Software without restriction, including without limitation the rights
  173. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  174. copies of the Software, and to permit persons to whom the Software is
  175. furnished to do so, subject to the following conditions:
  176. The above copyright notice and this permission notice shall be included in
  177. all copies or substantial portions of the Software.
  178. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  179. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  180. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  181. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  182. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  183. FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  184. IN THE SOFTWARE.