This backend written in Kotlin uses the Ktor-Framework for offering a REST-Like api to access a PostgreSQL Database for storing and managing consensus.
The system behind consensus is called Systematisches Konsensieren.
It is recommended to use Intellij for building the project. It uses the Ktor framework.
Look for the Application.kt
file to run the module()
method.
A default in memory database driver is used when deployed on the machine.
Note:: The project should not find the initial properties for the remote database as it has been removed to make this project a simple showcase only.
Main entry point is the Application.kt
file. This installs every feature needed and configures database access.
The further architecture consists of three layers:
- We use a layer to abstract from the database, called Repository. Access to tables, each suffixed with dao should always be made through these. All these classes belong into the
dao
package. - The next layer is the abstraction of api routes through different routing files, defined ultimately in
Route.kt
file, all residing in the `route package. - Api models are abstracted from database models exclusively in the
model
package.
We use integration tests for all routes and database repositories inside the `test package
Adding new api routes is as easy as adding new route() methods to the Route.kt
class. Please provide extension functions for the routes to keep the structure clean.
Use pull requests to merge into the develop branch and open issues of the GitLab project to help contributing:
- We use a Git-Flow approach, naming the develop branch stable. Please branch from this to work on new features.
- Please make sure to add Tests to all new features you want to be merged into the develop branch.