Sermonis

Sermonis

Sermonis is an experimentation around Spring-Data, MongoDB, AngularJS and Websockets. Its goal is to provide a platform where users can create chat rooms (password protected or not), share a unique URL where friends can join and chat using only their browser.

To use Sermonis, build it using maven calling a init class that will prepare the secret tokens needed by the application, then install and run with jetty (or deploy in Tomcat 7):

mvn compile java:exec -Dexec.mainClass=me.grison.sermonis.crypto.SermonisInit install jetty:run

GitHub project

You can browse the project on my GitHub repository [@agrison/sermonis][1].

About the name

sermonis means (sort-of) discussion in Latin, since a corpus of chat messages is seen as a discussion, that name make sense :-).

License

[## Sermonis

Sermonis is an experimentation around Spring-Data, MongoDB, AngularJS and Websockets. Its goal is to provide a platform where users can create chat rooms (password protected or not), share a unique URL where friends can join and chat using only their browser.

To use Sermonis, build it using maven calling a init class that will prepare the secret tokens needed by the application, then install and run with jetty (or deploy in Tomcat 7):

mvn compile java:exec -Dexec.mainClass=me.grison.sermonis.crypto.SermonisInit install jetty:run

GitHub project

You can browse the project on my GitHub repository [@agrison/sermonis][1].

About the name

sermonis means (sort-of) discussion in Latin, since a corpus of chat messages is seen as a discussion, that name make sense :-).

License

]2 .

Technical

Technical Stack

Sermonis was started as an experimentation around multiple technologies, which are listed below:

  • Atmosphere
  • Spring with Spring-Data, Spring-Data-Mongo and Spring-Atmosphere
  • MongoDB
  • AngularJS
  • Websockets

Websockets

I‘m using Websockets to provide realtime-like chat within browser, using a library called [Atmosphere][3].

The RT stuff is bound to .../async/... URLs and is supported by recent web-browsers. You will note that not every Java application container supports them. If you‘re using Tomcat you will need Tomcat7. Jetty and Glassfish supports them too.

MongoDB

In Sermonis MongoDB is used only to save chat rooms configuration (password, administrator) and chat messages within them. Used with Spring-Data and it‘s binding specific to MongoDB it is really super-easy to use.

AngularJS & Bootstrap

I‘ve used AngularJS to render the messages in the chat rooms, with some jQuery touch where I‘m not enough skilled with Angular.

The skin is using the well-known-already-seen-everywhere Bootstrap CSS framework.

Cookies

Sermonis use cookies to save user preferences (name, color, markdown, password (encrypted)). Cookies are related to one and only one room. This means that a user can have different name, color and password for every room he has access.

Use cases

Let‘s say the url of your deployed version of Sermonis is http://localhost/sermonis/.

Creating a room

Just hit the index page of the application at http://localhost/sermonis/, you will be redirected to a newly created room.

Creating a password protected room

Just hit the index page of the application with a query parameter withPassword at http://localhost/sermonis/?withPassword, you will be redirected to a page asking you the password with which the room should be protected, along with a an administrator password. When you click on Create the room will be created and you will be redirected on it directly.

Joining a room

Just hit the URL someone shared you.

Joining a password protected room

Just hit the URL someone shared you. You will be asked for a password, providing it and clicking Join will redirect you to the chat room. Depending on the room configuration, you may be able to see the chat messages history.

Choosing your user color

Click on your username, and pick a color from the color picker. The color is stored in a cookie.

Messages

To send a message in the room just type it in the input at the bottom of the page and press Enter. Sermonis supports Markdown by relying on the PageDown Markdown JS Library.

The IRC /me command is supported, and a shortcut for posting images is available with img:url instead of the longer markdown syntax ![alt](url).

[1]: https://github.com/agrison/sermonis “”

[3]: https://github.com/Atmosphere/atmosphere “”

Alexandre Grison - //grison.me - @algrison