The source code of MediaGrid consists of two parts: chat and media. The function of chat is to post in public or private rooms, and the function of media is to sharing files among users. The source code tree of chat is shown in the figure.
- app.js: Main router of a request, and returns desktop.html.
- build.js: A compressed math library, contains some crypto algorithm.
- chat.js: An outdated implementation of MediaGrid.
- controllers.js: Controllers of the dialogs and chatting desktop.
- directives.js: ???
- filters.js: ???
- jquery.couch.js: Jquery interface for couchdb.
- jquery-1.7.2.min.js: jQuery library.
- services.js: CouchDB database services.
- utils.js: cryptocat functions and random number generation.
Among these files, controller.js and services.js provides are most important. So here comes a more detailed introduction to these files.