interel-group / core3   2.2.0

Apache License 2.0 GitHub

Scala framework for building web applications and services based on Play and Akka

Scala versions: 2.12 2.11

core3

Scala framework for building web applications and services based on Play and Akka.

Motivation

  • Minimizes effort required to secure web applications
  • Separates actions (as workflows) and data objects (as containers) into easily testable and maintainable units
  • Disconnects application logic from data layer and action management

Getting Started

libraryDependencies += "com.interelgroup" %% "core3" % "2.2.0"

Released for Scala 2.11 and 2.12

See Additional dependencies for other libraries you may need.

For more information, check the wiki and the example projects:

Supported data sources

Supported auth providers

  • Auth0 - JWT based authentication and authorization
  • Local - local credentials DB

Additional dependencies

Depending on your data layer setup, you may have to include one or more of the dependencies listed here.

CouchDB and Solr require no additional libraries

Testing

Running the supplied tests will require all supported services to be present and active on the test machine.

Test configuration

The default test configuration can be found here.

For security, the various usernames and passwords have not been included and will need to be supplied either in the test static.conf file or via -D JVM options (preferred).

For MariaDB, a test database needs to be created and it needs to use UTF8:

CREATE DATABASE core3_test CHARACTER SET utf8 COLLATE utf8_general_ci;

Unit tests

Main test suite for verifying core component functionality.

sbt "testOnly core3.test.specs.unit.*"

Required options:

-Dserver.static.database.mariadb.username=<some user>
-Dserver.static.database.mariadb.password=<some password>
-Dserver.static.database.solr.username=<some user>
-Dserver.static.database.solr.password=<some password>
-Dserver.static.database.redis.secret=<some password>
-Dserver.static.database.couchdb.username=<some user>
-Dserver.static.database.couchdb.password=<some password>

Property tests

Additional tests for data-centric components.

sbt "testOnly core3.test.specs.prop.*"

Required options:

-Dserver.static.database.mariadb.username=<some user>
-Dserver.static.database.mariadb.password=<some password>
-Dserver.static.database.solr.username=<some user>
-Dserver.static.database.solr.password=<some password>
-Dserver.static.database.redis.secret=<some password>
-Dserver.static.database.couchdb.username=<some user>
-Dserver.static.database.couchdb.password=<some password>

Performance tests

Additional tests for tracking performance changes over time.

It's best to avoid, as this test suite is not entirely stable and has issues dealing with async operations

sbt "testOnly core3.test.specs.perf.*"

Required options:

-Dserver.static.database.mariadb.username=<some user>
-Dserver.static.database.mariadb.password=<some password>
-Dserver.static.database.solr.username=<some user>
-Dserver.static.database.solr.password=<some password>
-Dserver.static.database.redis.secret=<some password>
-Dserver.static.database.couchdb.username=<some user>
-Dserver.static.database.couchdb.password=<some password>

Multi-JVM tests

Multi-JVM tests for the core3.database.dals.memory.DistributedCache data layer.

sbt "multi-jvm:test-only core3_multi_jvm.test.specs.DistributedCache  -- -Dserver.static.database.mariadb.username=<some user> -Dserver.static.database.mariadb.password=<some password>"

Scalameta tests

sbt "project meta" "testOnly core3.test.specs.unit.meta.*"

Built With

  • Scala 2.12.3
  • sbt 0.13.16
  • Play 2.6.x - Base framework
  • Akka 2.5.x - Core component actors and (optional) data layer clustering
  • Slick - SQL data layer support
  • Scalameta - Macro annotations support
  • rediscala - (optional) Redis data layer support
  • elastic4s - (optional) Elasticsearch data layer support
  • courier - (optional) E-mail support

Versioning

We use SemVer for versioning.

Future Goals

  • Play 2.6 and Scala 2.12 support
  • Improve test coverage
  • Improve performance testing
  • Generate container boilerplate and data conversions with macros (and/or scala.meta)
  • Make slick dependency optional
  • Add / verify support for additional (No)SQL DBs (now supports all Slick databases)

License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details

Copyright 2017 Interel

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 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.