A template to use ktor with GraphQL and MongoDB using mangaka, kaguya and openperm-kt
Ktor GraphQL Template
A template to use ktor with GraphQL and MongoDB
using mangaka
, kaguya
and openperm-kt
Setup
To configure the library to the desired shape. It is better to configure it in these steps.
Configure Environment
Change the available environment variables
at the Environment
file.
Configure Plugins
Configure the plugins at the plugins
package.
You might skip routing configuration until you configure your routes later on the process.
You might skip session configuration until you configure your session models, user models, role classes and privilege factories.
Configure Models
Configure Runtime/GraphQL/MongoDB models at model
package
You might flag permission checks until you configure your permissions.
Configure Enumerations
Configured project enums and data classes at enumeration
package
In this step you configure available roles, permissions, permits and privilege factories and other project-wide constants.
Configure Routing
Finally, you might define your REST routes and your GraphQL query, mutation and subscription fields.
Technologies Used
Server
- Ktor: The server/client framework
MongoDB
-
Mongo Java Driver: The core mongodb driver
-
KMongo: A mongodb library optimized for kotlin
-
Mangaka: A mongodb library for schema validation.
GraphQL
-
GraphQL-Java: The core graphql driver
-
Kaguya: A graphql library optimized for kotlin
Crypto
-
Tink: Main encryption library
-
BCrypt: Hashing library
-
BCrypt-Kt: A bcrypt library optimized for kotlin
Etc
-
Dotenv: Environment variables parser
-
Openperm: Permission calculator
-
Cufy Ktor Commons: Common utilities for
mangaka
,kaguya
andopenperm-kt
withktor
-
Logback Classic: Core logging framework