A chat based on akka remote (written in scala)
Author: Maximilian Bundscherer (https://bundscherer-online.de)
Test-Coverage: 84.96%
Do not use akka remote without akka cluster and do not use java serializer in production-mode
- Server and client software included
- Docker local publish included (for server)
- Create account with
create <USERNAME> <PASSWORD>
- Login with
login <USERNAME> <PASSWORD>
- Broadcast messages to all online clients with
<YOURMESSAGE>
- Write private messages with
-p <USERNAME> <YOURMESSAGE>
- Logout with
-logout
- Akka: server and client base
- Akka Remote: network communication
- Docker: Container
- Scala: programming language
- ScalaTest: testing project
- Slick: database connection
- JBCrypt: hashing user password
- sbt-scoverage: generate test coverage report(s)
- See requirements!
- Import SBT project
- (Opt) Add SBT task
"run-main com.mb.akkaremoteChat.MainServer"
(single instance) to your project. - (Opt) Add SBT task
"run-main com.mb.akkaremoteChat.MainClient"
to your project. - (Opt) Add SBT task
clean coverage test
to your project. - (Opt) Add SBT task
coverageReport
to your project. - (Opt) Change logger settings
src/scala/main/resources/application.conf
toINFO
orDEBUG
- (Opt) Change server address/port
src/scala/main/resources/application.conf
andsrc/scala/main/com/mb/akkaremotechat/actors/client/Supervisor
- (Opt) Change client address/port
src/scala/main/resources/application.conf
- Start server
- Start client(s)
- SBT
- Clean MySQL-Database for run (see config
src/scala/main/resources/application.conf
)- host:
localhost
- name:
akka-scala-chat
- username:
root
- password: ""
- host:
- Clean MySQL-Database for test (see config
src/scala/test/resources/application.conf
)- host:
localhost
- name:
akka-scala-chat-test
- username:
root
- password: ""
- host:
- Run server with
sbt run-main com.mb.akkaremoteChat.MainServer
- Run client(s) with
sbt run-main com.mb.akkaremoteChat.MainClient
- (Opt) Change ports in
build.sbt
- (Opt) Change main class in
build.sbt
- Run command
sbt docker:publishLocal
- Run image
docker run --name akka-remote-scala-chat -p 5150:5150 <IMAGE-ID>
- Setup clean test database (see requirements)
- Run command
sbt clean coverage test
- Run command
sbt coverageReport