{"id":13605554,"url":"https://github.com/ESchouten/CleanArchitecture","last_synced_at":"2025-04-12T05:33:38.501Z","repository":{"id":37089551,"uuid":"361840995","full_name":"ESchouten/CleanArchitecture","owner":"ESchouten","description":"Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST \u0026 KGraphQL/GraphQL generated endpoints, Gradle.","archived":false,"fork":false,"pushed_at":"2023-04-21T12:23:01.000Z","size":502,"stargazers_count":314,"open_issues_count":3,"forks_count":27,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-02T19:37:56.004Z","etag":null,"topics":["backend","clean-architecture","exposed","flyway","gradle","graphql","hexagonal-architecture","jwt","kotlin","ktor","openapi","swagger"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ESchouten.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-04-26T17:44:10.000Z","updated_at":"2024-07-31T04:02:19.000Z","dependencies_parsed_at":"2024-01-16T23:30:19.431Z","dependency_job_id":"a91d90e9-ed6d-4540-ad5a-bde12ed1e2f6","html_url":"https://github.com/ESchouten/CleanArchitecture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESchouten%2FCleanArchitecture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESchouten%2FCleanArchitecture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESchouten%2FCleanArchitecture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ESchouten%2FCleanArchitecture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ESchouten","download_url":"https://codeload.github.com/ESchouten/CleanArchitecture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223497935,"owners_count":17155222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","clean-architecture","exposed","flyway","gradle","graphql","hexagonal-architecture","jwt","kotlin","ktor","openapi","swagger"],"created_at":"2024-08-01T19:01:00.182Z","updated_at":"2024-11-07T10:30:50.829Z","avatar_url":"https://github.com/ESchouten.png","language":"Kotlin","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"readme":"# Kotlin Clean Architecture Backend\n\nKotlin backend based on the Clean Architecture principles.\n\nThe application is separated into three modules: Domain, Usecases and Adapters\n\n- Domain module contains all entities, it's validation and repository interfaces\n- Usecases module performs actions on the domain entities and repositories and does authorization\n\nThe domain and usecases modules do not have any external dependencies.\n\n- Adapter layer: each adapter is implemented as a standalone module, lowering dependence on specific frameworks and\n  libraries and making them interchangable. The infrastructure module consumes all adapters (e.g. databases, (graphql)\n  endpoints, authentication logic)\n\nGraphQL endpoints are auto-generated from the Usecases\n\n##### Technologies:\n\nKtor, JWT, Exposed, Flyway, OpenAPI/REST \u0026 KGraphQL/GraphQL generated endpoints, Gradle.\n\n![image](https://miro.medium.com/max/800/1*0R0r00uF1RyRFxkxo3HVDg.png)\n\n## OpenAPI REST\n\nDocs URL: http://localhost:8080/docs\n\nAPI definitions: http://localhost:8080/openapi.json\n\n## GraphQL\n\nPlayground URL: http://localhost:8080/graphql\n\n### Login\n\n```\nquery Login {\n  LoginUser(a0: { email: \"erik@erikschouten.com\", password: \"P@ssw0rd!\" })\n}\n```\n\n### Retrieve current user\n\n```\nquery CurrentUser {\n  AuthenticatedUser {\n    id\n    email\n    authorities\n  }\n}\n```\n\n##### HTTP Headers\n\n```\n{\n  \"Authorization\": \"Bearer [TOKEN FROM LOGIN]\"\n}\n```\n\n### Create new user\n\n```\nmutation CreateUser {\n  CreateUser(\n    a0: {\n      email: \"calvin@erikschouten.com\"\n      password: \"Penait1!\"\n      authorities: [USER]\n    }\n  ) {\n    id\n    email\n    authorities\n  }\n}\n```\n\n##### HTTP Headers\n\n```\n{\n  \"Authorization\": \"Bearer [TOKEN FROM LOGIN]\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FESchouten%2FCleanArchitecture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FESchouten%2FCleanArchitecture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FESchouten%2FCleanArchitecture/lists"}