{"id":18550255,"url":"https://github.com/xorum-io/ktor-template","last_synced_at":"2025-04-09T22:31:14.639Z","repository":{"id":48080381,"uuid":"366010525","full_name":"xorum-io/ktor-template","owner":"xorum-io","description":"Template for the development of Ktor backend applications powered by Exposed/Hikari/PostgreSQL for database management, Firebase for authentication, and KotlinX Serialization for JSON parsing. Ready to be hosted on Heroku with GitHub Actions CI integration.","archived":false,"fork":false,"pushed_at":"2021-08-08T08:40:16.000Z","size":70,"stargazers_count":24,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T12:39:42.701Z","etag":null,"topics":["exposed","firebase","firebase-auth","heroku","hikari","json","kotlin","ktor","postgresql","serialization"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xorum-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-10T10:54:07.000Z","updated_at":"2024-10-23T21:15:29.000Z","dependencies_parsed_at":"2022-07-22T19:33:45.531Z","dependency_job_id":null,"html_url":"https://github.com/xorum-io/ktor-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xorum-io%2Fktor-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xorum-io%2Fktor-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xorum-io%2Fktor-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xorum-io%2Fktor-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xorum-io","download_url":"https://codeload.github.com/xorum-io/ktor-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248123463,"owners_count":21051478,"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":["exposed","firebase","firebase-auth","heroku","hikari","json","kotlin","ktor","postgresql","serialization"],"created_at":"2024-11-06T21:04:00.882Z","updated_at":"2025-04-09T22:31:14.164Z","avatar_url":"https://github.com/xorum-io.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Ktor template\n\nThis is a template for the development of backend applications using [Ktor framework](https://ktor.io/) powered by [Kotlin programming language](https://kotlinlang.org/).\n\n[Exposed ORM framework](https://github.com/JetBrains/Exposed) is used to wrap the [PostgreSQL](https://www.postgresql.org/) database connected by [HikariCP JDBC pool](https://github.com/brettwooldridge/HikariCP).\n\n[Firebase Auth](https://firebase.google.com/products/auth) helps to authenticate users for each request by passing the bearer token generated on the client side by one of Firebase client SDKs.\n\n[Sentry](https://sentry.io/welcome/) is used for logging crashes.\n\nFind more details on this template in [our Medium blog](https://medium.com/xorum-io/battle-tested-template-project-for-backend-with-kotlin-and-ktor-c655a2e276c2?sk=004c7d55091c004a314686b48d606df6).\n\n## To do\n\nOnce cloned do the following to adapt template to your needs.\n\n1. Change project name in `settings.gradle`.\n2. Change `group` in `build.gradle`\n3. Change `name` and `description` in `app.json`.\n4. Generate `testToken` (http://jwtbuilder.jamiekurtz.com/) and `testUserId` (https://www.uuidgenerator.net/) and set them in `FirebaseAuth.kt`. These variables are needed to simplify testing endpoints using Postman or similar tools.\n5. Create new Firebase project. Put firebase admin key file to resources and name it `firebase-adminsdk.json`. Set `ADMIN_KEY` environment variable at your server.\n6. Set `defaultJdbcUrl` in `DatabaseFactory.kt`. Here is an example used with PostgreSQL `jdbc:postgresql://localhost:5432/\u003cdbName\u003e?user=\u003cuserName\u003e\u0026password=\u003cpassword\u003e\u0026reWriteBatchedInserts=true`\n7. When ready to deploy to Heroku, set GitHub secrets which are used in `github/workflows` YAML files (CI): `HEROKU_APP_NAME_PROD`, `HEROKU_APP_NAME_STAGING`, `HEROKU_EMAIL`, and `HEROKU_API_KEY`. Set `GRADLE_TASK` environment variable to `shadowJar` at your server.\n8. Set `SENTRY_DSN` environment variable at your server to send crashes to Sentry.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxorum-io%2Fktor-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxorum-io%2Fktor-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxorum-io%2Fktor-template/lists"}