{"id":17623690,"url":"https://github.com/zachgrayio/nest-kotlin","last_synced_at":"2026-02-24T17:34:01.151Z","repository":{"id":44993322,"uuid":"113113636","full_name":"zachgrayio/nest-kotlin","owner":"zachgrayio","description":"A proof-of-concept project exploring interop between NestJS, TypeScript and KotlinJS.","archived":false,"fork":false,"pushed_at":"2022-12-07T10:20:22.000Z","size":172,"stargazers_count":7,"open_issues_count":5,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T20:42:56.600Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/zachgrayio.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":"2017-12-05T01:04:21.000Z","updated_at":"2022-07-28T06:34:51.000Z","dependencies_parsed_at":"2023-01-24T16:45:32.237Z","dependency_job_id":null,"html_url":"https://github.com/zachgrayio/nest-kotlin","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/zachgrayio%2Fnest-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachgrayio%2Fnest-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachgrayio%2Fnest-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachgrayio%2Fnest-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachgrayio","download_url":"https://codeload.github.com/zachgrayio/nest-kotlin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251795387,"owners_count":21645019,"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":[],"created_at":"2024-10-22T21:23:31.400Z","updated_at":"2026-02-24T17:34:01.108Z","avatar_url":"https://github.com/zachgrayio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## nest-kotlin\n\nA proof-of-concept project exploring interop between NestJS, TypeScript and KotlinJS.\n\n## Overview\n\n### What It Does\n\nDemonstrates a Kotlin-first code sharing mechanism, where data models and business logic can be defined in Kotlin and utilized in Nest.\n\n### What it Doesn't Do\n\nInteraction with TypeScript files from Kotlin is not currently supported and as a result, neither is definition of Nest modules \u0026 controllers in Kotlin.\n\n## Example\n\n##### foo.kt\n```kotlin\npackage foo\n\nfun getFoo():String {\n    return \"Foo!\"\n}\n```\n\n##### foo.controller.ts\n```typescript\nimport * as interop from \"interop\"\n\n@Controller()\nexport class FooController {\n    constructor() {}\n\n    @Get('foo')\n    async get(@Request() req, @Response() res, next) {\n        res.status(HttpStatus.OK).send(interop.foo.getFoo());\n    }\n}\n```\n\n## How It Works\n\n- Interoperation is achieved by targeting JS when compiling Kotlin, and then generating TypeScript definitions for the JS output. \n- The project can be built and run with `npm start` and `npm run start:prod` similar to the other starter repos. \n- Kotlin is compiled to JS via Gradle and the included Gradle wrapper. KotlinJS configuration can be seen in `build.gradle`. \n- The NPM scripts which define the build process can be viewed in `package.json`.\n\n#### Build Process\n\n1. Compiles Kotlin to JS by calling `./gradlew assemble`, outputting a CommonJS module that's ready to use with Node\n2. Calls `dtsmake` to generate typings from the JS output, complete with realistic types thanks to type inference\n3. Uses `shx` to copy the JS output to `npm_modules` so it can be imported by Node - this could use a second look.\n4. Calls `tsc`\n5. Runs with `node index.js` or `node dist/server.js`\n\n## Dependencies\n\nIn addition to NPM, the JRE/JDK will also be required to run the gradle build and compile the Kotlin code. Use of IntelliJ IDEA is highly recommended for working with Kotlin. \n\n## Should I Use This?\n\nProbably not.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachgrayio%2Fnest-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachgrayio%2Fnest-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachgrayio%2Fnest-kotlin/lists"}