eschouten / cleanarchitecture Goto Github PK
View Code? Open in Web Editor NEWKotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST & KGraphQL/GraphQL generated endpoints, Gradle.
License: MIT License
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST & KGraphQL/GraphQL generated endpoints, Gradle.
License: MIT License
With KGraphQL development being stale since august 2021 and the developer going AWOL, other graphql server libraries should be considered.
Update JUNE 2022: KGraphQL author seems to have returned, looking for maintainers
Possible candidates:
Kaguya
GraphQL Kotlin
Possible official KTOR Graphql support post 2.0 release
Hi,
I was browsing the kgraphql.io documentation and i was redirected to your repository. I am in the process of building a saas app using ktor and graphql. Browsing the web for tips and help i came across this old tutorial https://michaelstromer.nyc/books/kotlin-multiplatform-mobile/ktor-and-kgraphql which i followed and made it somehow work with ktor 2 since kgraphql doesnt for now.
I was looking for a better way to handle authentication (with access and refresh tokens) and stumbled upon your repo. If you have a course or tutorial about it please forward it to me so i can improve my current architecture which is mostly organized as shown in the link above. If no videos are available then ill try my best to understand and update where it makes sense.
Thank you for the great repo
Greeting,
I want to create a new module just like you did in this repo with the adapters, domain and use-cases modules but I don't know how to add the correct type of module with intellij.
I just change application.conf file
ktor {
deployment {
port = 9090
}
application {
modules = [ ktor.ServerKt.module ]
}
development = true
}
database {
type = "JDBC"
drop = false
jdbc {
driver = "org.sqlite.JDBC"
url = "jdbc:sqlite:file:test?mode=memory&cache=shared"
schema = ""
username = "root"
username = ${?MYSQL_USER}
password = "root"
username = ${?MYSQL_PASSWORD}
}
}
jwt {
domain = "http://localhost:8080"
domain = ${?DOMAIN}
secret = "490626fc-d735-4b85-a953-386f0b8cd2f5"
secret = ${?JWT_SECRET}
}
and add this dependency implementation("org.xerial:sqlite-jdbc:3.45.0.0")
that throw this error message:
Exception in thread "DefaultDispatcher-worker-1" java.lang.IllegalStateException: repositories.user.UserTable.id is not in record set
Can anyone help me to solve this problem?
I assume the repo is meant as an example, especially as it is linked here https://kgraphql.io/Examples/. However as long as there is no appropriate licence attached to it, nobody is actually allowed to use this as a starting point for their own project. See https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository#choosing-the-right-license for details.
If this isn't intentional, would you mind adding a licence file?
I noticed that with Ktor 2.0.3 when a query or a mutation trows an error the Graphql server shows the error like this
(example with login query)
{ "error": "Server response was missing for query 'Login'." }
in Ktor 2.0.1 errors are shown instead like this
{ "errors": [ { "message": "Invalid authentication", "locations": [ { "line": 2, "column": 3 } ], "path": [] } ] }
is this new behaviour correct or stills a parsing error with this new Ktor version?
ps: also tried with the new version of KGrapgql 0.17.15
Like GraphQL, Rest APIs with OpenAPI generated docs, can enable client-side code generation
Since we're only utilizing GraphQL as a typed API, using GraphQL is overkill and requires a lot of verbose queries on the client-side.
OpenAPI would provide a nice, less verbose alternative to the GraphQL API, while maintaining the ability to generate code on the client-side.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.