• Stars
    star
    384
  • Rank 109,322 (Top 3 %)
  • Language
    Scala
  • License
    Other
  • Created about 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Chat example app using Server Sent Events plus REST calls. Scala, Play Framework 2.3, AngularJS or React (alternatively).

sse-chat

This is a simple chat application using Play Framework together with AngularJS. It makes use of a Concurrent.Broadcast object as an Enumerator, a filtering Enumeratee and EventSource as the Iteratee. Together these building blocks facilitate the chat message data flow within the application.

Check out the live demo.

Architecture

The application uses Server Sent Events to deliver messages to the client and REST calls to send messages to the server. The messages flow from the POST to the Server Sent Events (SSE) stream through Concurrent.broadcast as the central information hub into the chatFeed controller which attaches an Enumeratee / Iteratee chain to the Enumerator provided by Concurrent.broadcast. Filtering for the correct chat room is done with a filtering Enumeratee.

Architecture

The client is designed as a single page application using AngularJS. The file organization is inspired by the angular-seed project.

Alternatively, there is another client based on Facebook's React instead of AngularJS. This alternative version can be accessed under localhost:9000/react. Blog post about the React version will follow.

There are Romeo and Juliet hanging out in Room 1 in order to make looking at the app a little less boring. They are having their balcony scene conversation, but they are confused, uttering the lines at random.

How to run this:

  1. if Typesafe Activator is installed on your machine: activator run from inside the project folder
  2. if Activator is not installed, you can run: ./activator run in the project folder (or double click on activator script in OS X)

This application will work in Firefox, Safari, Chrome and Opera. It will not work in Internet Explorer, simply because Microsoft for whatever reason does not support Server Sent Events.

More information at matthiasnehlsen.com.

Edit January 2014: there also is a client version running Scala.js; please check the README in the scala-js folder for more information how to build this. The Closure Compiler optimized JavaScript of the application has been included in this project, whereas the other resulting files from the build process have been excluded for reasons of space.

Licence

This software is licensed under the Apache 2 license, quoted below.

Copyright Β© 2013 Matthias Nehlsen.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this project except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

talk-transcripts

Transcripts of Clojure-related talks
2,737
star
2

BirdWatch

Tweet stream analysis and visualization with real-time updates.
HTML
858
star
3

Clojure-Resources

Compilation of useful links and resources for learning Clojure and ClojureScript
522
star
4

lotti

Achieve your goals and keep your data private with Lotti. This life tracking app is designed to help you stay motivated and on track, all while keeping your personal information safe and secure. Now with on-device speech recognition.
Dart
482
star
5

systems-toolbox

Tools and building blocks for building Systems in Clojure and ClojureScript
Clojure
173
star
6

inspect

Inspect data structures flowing through your application
Clojure
93
star
7

clojure-system-book

64
star
8

sse-perf

Load testing for Server Sent Event streams (or other HTTP connections that deliver information in chunks) using Play Framework 2.1 -- this project needs an upgrade to the latest Play version. Anyone interested in submitting a PULL REQUEST?
Scala
56
star
9

systemd-watchdog

Frequently notify systemd's watchdog with a single line of code
Clojure
21
star
10

AngularUI-Code

Code samples for AngularJS UI Development Book
JavaScript
19
star
11

systems-toolbox-sente

Sente WebSockets components (client and server) for systems-toolbox
Clojure
9
star
12

WebComponents-Polymer-Resources

Compilation of useful links and resources for learning Web Components and Polymer
8
star
13

live-html5

HTML5 Starter Template with Live Page Reloading on any Device
CSS
7
star
14

scalar-conf

demo application for presentation at scalar conf
JavaScript
5
star
15

amzn-geo-lookup

Find user's local store for affiliate links by performing GeoIP lookup
Scala
5
star
16

ng-blog

Blog Engine based on AngularJS
CSS
5
star
17

systems-toolbox-kafka

Kafka producer and consumer components for systems-toolbox
Clojure
5
star
18

systems-toolbox-electron

Clojure
4
star
19

angular-grunt-protractor-starter

AngularJS sample project with a grunt-based build system using Protractor and Karma
JavaScript
4
star
20

systems-toolbox-ui

DEPRECATED: UI components for systems-toolbox
Clojure
4
star
21

systems-toolbox-redis

Redis Pub/Sub communication for systems-toolbox
Clojure
3
star
22

meins

Clojure
2
star
23

conf

systemd service declarations and install scripts for my live examples
Shell
2
star
24

potluck-recipes

1
star
25

emacs.d

Emacs Lisp
1
star
26

systems-toolbox-reagent

UI component building blocks for systems-toolbox
1
star
27

clj-el-migrate

Clojure
1
star
28

gatsby-blog

CSS
1
star
29

meetup-ionic-todo

JavaScript
1
star
30

systems-toolbox-metrics

JVM metrics component (with UI) for systems-toolbox
Clojure
1
star
31

octopress-blog

The octopress project that powers my blog.
HTML
1
star
32

meoSwift

Swift
1
star