Giter Site home page Giter Site logo

eschouten / cleanarchitecture Goto Github PK

View Code? Open in Web Editor NEW
304.0 5.0 26.0 502 KB

Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST & KGraphQL/GraphQL generated endpoints, Gradle.

License: MIT License

Kotlin 100.00%
kotlin ktor exposed flyway jwt graphql gradle clean-architecture hexagonal-architecture backend

cleanarchitecture's Introduction

eschouten

eschouten

eschouten

eschouten

cleanarchitecture's People

Contributors

eschouten avatar francynox avatar sugasaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cleanarchitecture's Issues

[QUESTION] Do you have an online course / tutorial for this repo

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

How do you create a new module?

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 can't configure it to sqlite DB.

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

CleanArchitecture.zip

Can anyone help me to solve this problem?

No licence

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?

Ktor 2.0.3 - KGraphql not parse errors

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

Provide a REST API with OpenAPI generated docs alongside GraphQL

Like GraphQL, Rest APIs with OpenAPI generated docs, can enable client-side code generation

Third-party alternative

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.

Ktor official OpenAPI support

Planned on the latest roadmap

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.