This project aims to provide complete CQRS/Event Sourcing platform.
- 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.
-
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
val userRoutes: Route = (pathPrefix("users") & authorized) { implicit session =>
createUser ~ getUser ~ updateUser ~ deleteUser ~ listUsers
}
def listUsers(implicit session: Session): Route = (get & pagination) { page =>
...
}
/**
* = Authorization directive =
*
* Для проверки прав доступа нужно извлечь uri ресурса, http метод и сессию пользователя.
*/
val authorized: Directive1[Session] = {
(extractUri & extractMethod & authenticated) tflatMap {
case (uri, httpMethod, session) =>
authorizeAsync(authorizationCheck(uri, httpMethod, session)) & provide(session)
}
}
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.
Annette-Sphera is Open Source and available under the Apache License, Version 2.0