Skip to content

ericsmitt/sphera

Repository files navigation

CQRS/Event Sourcing platform Annette-Sphera

This project aims to provide complete CQRS/Event Sourcing platform.

Feature list:

  • Authentication.
  • Authorization.
  • Verification (sms, email).
  • User registration with email verification.
  • Push notifications (sms, email, websocket).
  • Data pagination.
  • Form Builder. Build forms, just the way you do it in Google forms.

Installation:

  • Install sbt, postgresql, protoc-3.2.0, nodejs, @angular/cli: /scripts/install-project-tools.sh

  • Create database annette_sphera

sudo -u postgres psql postgres
create database annette_sphera;
\q
  • Generate postgresql schema. In conf/application.conf set this: core.initDb.createSchema = true

  • Build frontend:

cd annette-frontend-sphera/ng/
npm install
npm run build
  • Start sbt task:
cd ../../
sbt ~annette-sphera-server/reStart

Users page with pagination:

users page

  val userRoutes: Route = (pathPrefix("users") & authorized) { implicit session =>
    createUser ~ getUser ~ updateUser ~ deleteUser ~ listUsers
  }
  
  def listUsers(implicit session: Session): Route = (get & pagination) { page =>
       ...
  }

Users edit dialog:

users edit

Tenants page with pagination:

tenants page

Signin page:

signin page

Authorization directive akka-http:

 /**
   * = Authorization directive =
   *
   * Для проверки прав доступа нужно извлечь uri ресурса, http метод и сессию пользователя.
   */
  val authorized: Directive1[Session] = {
    (extractUri & extractMethod & authenticated) tflatMap {
      case (uri, httpMethod, session) =>
        authorizeAsync(authorizationCheck(uri, httpMethod, session)) & provide(session)
    }
  }

Signup confirmation (example email template):

signup page

Contributing

Contributions are very welcome!

If you see an issue that you'd like to see fixed, the best way to make it happen is to help out by submitting a pull request implementing it.

Refer to the CONTRIBUTING.md and CODE_OF_CONDUCT.md file for more details about the workflow, and general hints on how to prepare your pull request. You can also ask for clarifications or guidance in GitHub issues.

License

Annette-Sphera is Open Source and available under the Apache License, Version 2.0

About

CQRS/Event Sourcing platform Sphera

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published