Personal pet-project I am working on for self-education purposes.
The project is a simple real-time chat on websockets.
Technologies used:
- Cats - for writing abstract code and as a standardized interface between other libraries
- Cats Effect - for abstracting over concrete IO monad
- Monix - concrete implementation of IO monad
- Redis - storage and pub-sub mechanism
- ScalaJS, ScalaJS bindings for ReactJS, Bootstrap 4 and ScalaCSS - for web client
- OpenAPI - API documentation
- Testcontainers, ScalaTest and ScalaCheck - property-based integration tests
I've used the Tagless Final style of the functional programming, but unsure that everything is written in optimal and correct way and would be very grateful to hear any constructive critics!
Usage: pet-project-chat [options]
--help prints this help
--redis-host <value> (required) host of redis used as a storage
--log-level <value> (optional) log level, must be one of 'OFF','ERROR','WARN','INFO','DEBUG','TRACE','ALL', default is INFO
--smtp-host <value> (optional) SMTP host, if not provided then verification of emails be disabled
--smtp-port <value> (optional) SMTP port, if not provided then verification of emails be disabled
--smtp-tls (optional) Use TLS for SMTP
--smtp-from <value> (optional) 'from' field of verification emails, if not provided then verification of emails be disabled
--smtp-user <value> (optional) User for SMTP server
--smtp-password <value> (optional) Password for SMTP server
--verification-link-prefix <value>
(optional) Prefix of email verification link, i.e. 'http://localhost:8080', if not provided then verification of emails be disabled
--email-verification-timeout <value>
(optional) email verification timeout, examples are '1 second', '9 days', '3 hours', '1 hour', default is '1 day'
- Build the project Docker image
sbt appJVM/docker:publishLocal
- Run the project and Redis Docker images by
docker-compose -f docker-compose-without-email-verification.ym up
- Open http://localhost:8080 in your browser
- You'll need an SMTP server, find information with your mail provider, examples: GMail, MailRu
- Build the project Docker image
sbt appJVM/docker:publishLocal
- Edit the docker-compose-with-email-verification.ym replacing SMTP information you've got from the 1st step
- Run the project and Redis Docker images by
docker-compose -f docker-compose-with-email-verification.ym up
- Open http://localhost:8080 in your browser
Building native executable (is not supported at the moment)
You'll need the installed GraalVM and Scala Built Tool.
Execute the script in the root project dir:
./graal-build-native-executable.sh