Skip to content

Sample client-server chat application using Akka Persistence/Cassandra, Akka Cluster, Akka Streams, Akka I/O, and ScalaFX.

License

Notifications You must be signed in to change notification settings

ezoerner/scalable-chat

Repository files navigation

Scalable Chat

  • A demo multiuser application with a scalable architecture.
  • A chat room application
  • Demonstrates akka-persistence by storing chat history
  • Demonstrates akka-http for client/server communications with WebSockets (not yet implemented, currently uses Akka TCP sockets)

UPDATE

This project is no longer active. If I were to work further on it, the first thing I would do is remove activator and Cassandra, and probably use DynamoDB instead of Cassandra. Also, I would prefer ScalaTest over Specs2 for testing.

In fact, if I were to start from scratch, I would write this in Haskell instead of Scala.

Technology Stack

  • ScalaFX front end
  • Akka in both client and server
  • Akka Streams and Akka I/O used for client server communications
    • Currently there is an akka-streams branch in progress for introducing akka-http and akka-streams to replace direct use of akka-io.
  • Akka Cluster with cluster-aware routing
  • Event-sourcing using Akka Persistence with Cassandra
  • Akka Testkit and Specs2 testing

Future Plans and Possibilities

Work on packaging as chat room libraries to enable embedding in other applications.

Instead of using cluster-aware routing for users and chatrooms, use Akka Cluster Sharding in combination with akka-persistence.

Also, instead of using Akka TCP sockets, use Akka HTTP with websockets for communication between client and server.

Build chatroom functionality into libraries that can be embedded in other applications.

Build an additional browser-based JavaScript front end, perhaps using Scala.js.

Make logins more secure.

See the Issues for other planned improvements.

Running

  • Requires Java 8 (though the project is written entirely in Scala)
  • Configuration files are in server/src/main/resources/application.conf and client/src/main/resources/application.conf for server and client respectively. This is where the IP address and/or port can be changed for the server socket.
  • To run the server: ./activator server/run (or use your own activator installation)
  • To run a ScalaFX client: ./activator client/run
    • Note that there currently is no separate registration step. If this is the first time logging in for a user, just type in a new password at the login prompt.
  • Dependencies: akka , cassandra, scalafx, scalafxml
  • Database Configuration: TBD
  • How to run tests: ./activator test
  • Deployment instructions: TBD

About

Sample client-server chat application using Akka Persistence/Cassandra, Akka Cluster, Akka Streams, Akka I/O, and ScalaFX.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published