#+Title: Meeting of the Minds #+Subtitle: A Replacement for the Slack Chat System #+AUTHOR: Samuel W. Flint #+EMAIL: swflint@flintfam.org #+DATE: \today #+INFOJS_OPT: view:info toc:nil path:http://flintfam.org/org-info.js #+OPTIONS: toc:nil H:5 ':t *:t todo:nil stat:nil d:nil #+PROPERTY: noweb no-export #+PROPERTY: comments noweb #+LATEX_HEADER: \usepackage[margins=0.75in]{geometry} #+LATEX_HEADER: \parskip=1em #+LATEX_HEADER: \parindent=0pt #+LATEX_HEADER: \lstset{texcl=true,breaklines=true,columns=fullflexible,basicstyle=\ttfamily,frame=lines,literate={<=}{$\leq$}1 {>=}{$\geq$}1} #+LATEX_CLASS_OPTIONS: [10pt,twoside] #+LATEX_HEADER: \pagestyle{headings} * COMMENT Export #+Caption: Export Document #+Name: export-document #+BEGIN_SRC emacs-lisp :exports none :results none (save-buffer) (let ((org-confirm-babel-evaluate (lambda (lang body) (declare (ignorable lang body)) nil))) (org-latex-export-to-pdf)) #+END_SRC * COMMENT Tangle #+Caption: Tangle Document #+Name: tangle-document #+BEGIN_SRC emacs-lisp :exports none :results none (save-buffer) (let ((python-indent-offset 4)) (org-babel-tangle)) #+END_SRC * DONE Introduction :nonum: CLOSED: [2016-04-02 Sat 21:24] :PROPERTIES: :CREATED: <2016-04-02 Sat 16:26> :END: As time has gone on, I've started seeing the "Slack" chat platform become more and more popular. I see this as both a good thing, in that it promotes communication within teams, and a bad thing, in that it's not controlled by the company that actually subscribes to it, and it isn't free software. Because of the benefit, and as a response to the issues, I've decided to build this application, "Meeting of the Minds", built on standards and free software so it's likely to stay around for a long time. Thus, the goal is to produce an application that gives the following features: - Archival - Group Messaging - Easily Defined Groups - User-to-user Messaging - Simple Management - Freedom To accomplish this task, I've decided to build using the following tools and suites: - IRC :: The Internet Relay Chat protocol. I've chosen this as the transport protocol as it's been around for quite some time, and is well supported. - PostgreSQL :: An SQL storage backend. This will be a way to store metadata about conversations, topics, users and projects, allowing for data archival. I've chosen PostgreSQL as it has many advanced features and is very space efficient. - Common Lisp :: The server implementation language. I've chosen to use Common Lisp to implement Meeting of the Minds for the following reasons: - Familiarity - Flexibility - Library availability * TOC :ignore: :PROPERTIES: :CREATED: <2016-04-02 Sat 16:27> :END: #+LATEX: \cleardoublepage #+LATEX: \parskip=0em #+TOC: headlines 3 #+TOC: listings #+LATEX: \cleardoublepage #+LATEX: \parskip=1em * WORKING Architecture [0/3] :PROPERTIES: :CREATED: <2016-04-02 Sat 21:25> :END: To accurately emulate Slack, this system must be fairly complex. This can be accomplished by designing the system as it is built, or by laying the ground work first, developing a plan and specifying the design. In the first, which has become popular, while the system can be built quickly, it is often an error-prone and bug ridden process. The second, my choice, can take a bit more time, but because things are thought out before hand, can produce a better, less buggy final product. The goal of this is to define both the architecture of the system, and the protocols upon which it runs. ** WORKING Protocol Design [0/4] :PROPERTIES: :CREATED: <2016-04-02 Sat 21:27> :ID: 9e91d88a-6180-4620-8683-7554e2e15835 :END: Slack has been designed as a team chat software. While it once was implemented on top of IRC, it appears to not be anymore. However, for the specific area that the app targets, IRC seems like a logical choice as a base for a communications protocol. As such, I'll have to leverage various parts of IRC, including the following: - Channels - Direct messaging - Authentication In addition to these things, I'll have to ensure that logging, user look-up and user management is supported and available. *** TODO Use of Channels :PROPERTIES: :CREATED: <2016-04-12 Tue 16:01> :END: Foo *** TODO The Back and Forth :PROPERTIES: :CREATED: <2016-04-12 Tue 16:02> :END: Foo *** TODO Authentication Mechanism :PROPERTIES: :CREATED: <2016-04-12 Tue 16:03> :END: Foo *** TODO Logging Control :PROPERTIES: :CREATED: <2016-04-12 Tue 16:04> :END: Foo ** TODO Data Storage Requirements :PROPERTIES: :CREATED: <2016-04-02 Sat 21:27> :END: Foo ** TODO Management System :PROPERTIES: :CREATED: <2016-04-02 Sat 21:27> :END: Foo * WORKING Database Design [0/5] :PROPERTIES: :CREATED: <2016-04-02 Sat 21:25> :END: Foo ** TODO Users Table :PROPERTIES: :CREATED: <2016-04-02 Sat 21:27> :END: Foo ** TODO Conversations Table :PROPERTIES: :CREATED: <2016-04-02 Sat 21:28> :END: Foo ** TODO Topics Table :PROPERTIES: :CREATED: <2016-04-02 Sat 21:28> :END: Foo ** TODO Archives Table :PROPERTIES: :CREATED: <2016-04-02 Sat 21:28> :END: Foo ** TODO Decisions Table :PROPERTIES: :CREATED: <2016-04-02 Sat 21:28> :END: Foo * TODO Management Interface :PROPERTIES: :CREATED: <2016-04-02 Sat 21:25> :END: Foo * WORKING Protocol Implementation [0/2] :PROPERTIES: :CREATED: <2016-04-02 Sat 21:25> :END: Foo ** TODO Server Side :PROPERTIES: :CREATED: <2016-04-12 Tue 15:43> :END: Foo ** TODO Client Side :PROPERTIES: :CREATED: <2016-04-12 Tue 15:44> :END: Foo * WORKING Packaging [0/2] :PROPERTIES: :CREATED: <2016-04-02 Sat 16:27> :END: ** WORKING The ~packages~ file :PROPERTIES: :CREATED: <2016-04-02 Sat 16:32> :ID: b0c08843-2ca4-4b6d-b570-8f54d9b0104e :END: This file describes and defines that packages, or namespaces used in the application. These include the following: - ~meeting-minds.db~ :: The database interaction layer. - ~meeting-minds.protocol~ :: The server-side implementation of the protocol. This handles authentication, channel management and the like. - ~meeting-minds.protocol-client~ :: The client side implementation of the protocol. This will handle authentication with the server and provide an interface for both the GUI client and programmable bots. - ~meeting-minds.log~ :: This provides the logging portion of the server system, and will be used to create logs of group channels. - ~meeting-minds.web-interface~ :: This provides a management interface and log access system. - ~meeting-minds.ui~ :: This provides a user interface for chat, log retrieval and management. - ~meeting-minds~ :: The main package, this is used to tie all of the other packages together, and can be used to produce a callable daemon. #+Caption: Packages #+Name: packages #+BEGIN_SRC lisp :tangle "package.lisp" (defpackage #:meeting-minds.db (:use #:cl #:clsql)) (defpackage #:meeting-minds.protocol (:use #:cl #:birch #:meeting-minds.db)) (defpackage #:meeting-minds.protocol-client (:use #:cl #:birch)) (defpackage #:meeting-minds.log (:use #:cl #:cl-who #:meeting-minds.db)) (defpackage #:meeting-minds.web-interface (:use #:cl #:ningle #:clack-errors #:cl-mustache #:meeting-minds.db #:meeting-minds.log)) (defpackage #:meeting-minds.ui (:use #:cl #:meeting-minds.protocol-client #:commonqt #:qtools #:qtools-ui)) (defpackage #:meeting-minds (:use #:cl #:meeting-minds.protocol #:meeting-minds.log #:meeting-minds.web-interface)) #+END_SRC ** WORKING The *ASDF* System Definition :PROPERTIES: :CREATED: <2016-04-02 Sat 16:45> :ID: 9d79d691-5ac0-43f9-a0ae-a4f1823cbcb6 :END: The definition of a system, or in Lisp terms, a set of connected and related software, either libraries or applications is what allows this to be put together and built. This is done using *ASDF*, or the "Another System Definition Facility". #+Caption: ASDF System #+Name: asdf-system #+BEGIN_SRC lisp :tangle "meeting-minds.asd" (asdf:defsystem #:meeting-minds :description "Describe meeting-minds here" :author "Samuel W. Flint " :license "GNU GPLv3 or Later" :depends-on (#:ningle #:clack-errors #:clsql #:stefil #:ironclad #:cl-who #:commonqt #:qtools #:qtools-ui #:daemon #:babel #:uiop #:cl-mustache #:birch #:irc-logger) :serial t :components ((:file "package") (:file "meeting-minds"))) #+END_SRC * Clear to odd and appendix :ignore: :PROPERTIES: :CREATED: <2016-04-12 Tue 15:45> :END: #+LATEX: \cleardoublepage #+LATEX: \appendix * TODO Terminology :PROPERTIES: :CREATED: <2016-04-27 Wed 20:34> :END: * WORKING Packages Used :PROPERTIES: :CREATED: <2016-04-27 Wed 20:36> :END: - ~ningle~ :: A smart, simple web framework for the management/browsing interface. - ~clack-errors~ :: An error handling library for the clack/ningle framework. - ~clsql~ :: An SQL interface library that works extremely well with PostgreSQL. - ~stefil~ :: A testing framework - ~ironclad~ :: Encryption and hashing. - ~cl-who~ :: HTML Generation. - ~commonqt~, ~qtools~, & ~qtools-ui~ :: A GUI library for the user interface. - ~daemon~ :: A daemonization system for the server. - ~babel~ :: Byte string manipulation. - ~uiop~ :: A utilities collection. - ~cl-mustache~ :: A templating framework based on the popular "Mustache" system. - ~birch~ :: An IRC bot framework. - ~irc-logger~ :: To provide IRC logging functionality. * TODO Sources and Documentation Links :PROPERTIES: :CREATED: <2016-04-27 Wed 20:40> :END: * Clear to bottom :ignore: :PROPERTIES: :CREATED: <2016-04-12 Tue 16:10> :END: #+LATEX: \vfill * TODO Version Information :nonum: :PROPERTIES: :CREATED: <2016-04-12 Tue 15:47> :END: This document is version src_sh{git describe --always --long --dirty --abbrev=10 --tags}.