{"id":16364121,"url":"https://github.com/hieuwu/supa-spring-kt","last_synced_at":"2025-03-23T02:31:56.131Z","repository":{"id":242720248,"uuid":"804142942","full_name":"hieuwu/supa-spring-kt","owner":"hieuwu","description":"Spring Boot backend with RESTful APIs, session management via Supabase","archived":false,"fork":false,"pushed_at":"2024-07-13T10:08:21.000Z","size":131,"stargazers_count":12,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T18:17:22.512Z","etag":null,"topics":["backend","restful-api","spring-boot","supabase","supabase-kt","swagger-ui"],"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/hieuwu.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-22T03:20:05.000Z","updated_at":"2025-02-22T09:38:15.000Z","dependencies_parsed_at":"2024-06-04T17:08:28.557Z","dependency_job_id":"87957dbe-3015-48b2-8ccc-467420004ac5","html_url":"https://github.com/hieuwu/supa-spring-kt","commit_stats":null,"previous_names":["hieuwu/supa-spring-kt"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuwu%2Fsupa-spring-kt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuwu%2Fsupa-spring-kt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuwu%2Fsupa-spring-kt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hieuwu%2Fsupa-spring-kt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hieuwu","download_url":"https://codeload.github.com/hieuwu/supa-spring-kt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245047979,"owners_count":20552430,"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","restful-api","spring-boot","supabase","supabase-kt","swagger-ui"],"created_at":"2024-10-11T02:29:25.208Z","updated_at":"2025-03-23T02:31:55.744Z","avatar_url":"https://github.com/hieuwu.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# supa-spring-kt\n\nSpring Boot backend with RESTful APIs, session management via Supabase\n\u003cimg width=\"720\" alt=\"Screenshot 2024-06-05 at 00 07 52\" src=\"https://github.com/hieuwu/supa-spring-kt/assets/43868345/8c60932e-dcf2-4994-bae9-85cb60079958\"\u003e\n\n## ⭐️ About\nThis project demonstrate how to integrate Supabase to a RESTful service built with Spring Boot. This backend plays as a middleware to handle requests from multiple clients via RESTful API then interact with Supabase. The common use case is using this service to public APIs to multiple clients so that each client does not have to interact with Supabase via specific SDK.\n\n\u003e [!TIP]\n\u003e If you want to see the more about Supabase Kotlin Multiplatform samples, check out the [supabase-kt](https://github.com/supabase-community/supabase-kt) repository.\n\n## ⚙️ Setup\n1. Get started with Spring Boot project with [Spring Initializr](https://start.spring.io/), select Kotlin and Java 17 (JVM)\n\n2. Add dependencies to `build.gradle`\n```kotlin\nval ktor_version = \"2.3.10\"\nimplementation(\"io.ktor:ktor-client-core:$ktor_version\")\nimplementation(\"io.ktor:ktor-client-java:$ktor_version\")\nimplementation(\"io.ktor:ktor-client-cio:$ktor_version\")\n\nval supabaseVersion = \"2.4.0\"\nimplementation(platform(\"io.github.jan-tennert.supabase:bom:$supabaseVersion\"))\nimplementation(\"io.github.jan-tennert.supabase:gotrue-kt\")\nimplementation(\"io.github.jan-tennert.supabase:postgrest-kt\")\nimplementation(\"io.github.jan-tennert.supabase:storage-kt\")\nimplementation(\"io.github.jan-tennert.supabase:serializer-jackson:$supabaseVersion\")\n```\n\n3. Create `SupabaseConfiguration` class to provide Supabase client instance:\n```kotlin\n@Configuration\nclass SupabaseConfiguration {\n    @Bean\n    fun supabaseClient(): SupabaseClient {\n        return createSupabaseClient(\n            supabaseUrl = \"SUPABASE_URL\",\n            supabaseKey = \"SUPABASE_KEY\"\n        ) {\n            install(Auth)\n            install(Postgrest)\n            defaultSerializer = JacksonSerializer()\n        }\n    }\n}\n```\n4. Use Supabase Client\n```kotlin\n@Repository\nclass ProductRepository(supabase: SupabaseClient) {\n    ...\n}\n```\n\n## 📒 API docs \u0026 Supabase schema\n### API Docs\n\u003cimg width=\"750\" alt=\"Screenshot 2024-06-23 at 19 29 54\" src=\"https://github.com/hieuwu/supa-spring-kt/assets/43868345/8086c8bf-65e7-4390-a685-24d8a92777fb\"\u003e\n\n### Schema\n\u003cimg width=\"320\" alt=\"Screenshot 2024-06-04 at 23 16 08\" src=\"https://github.com/hieuwu/supa-spring-kt/assets/43868345/bdfbdd05-705d-4dc1-ac2d-0ba3e845d7af\"\u003e\n\n## 👨‍💻 Run\n`./gradlew run`\n\n**Service status:** `http://localhost:8080/actuator/health`\n\n**Swagger API:** `http://localhost:8080/swagger-ui/index.html`\n\n### With Docker\n1. Run below command to build the image\n```bash\n ./gradlew build \u0026\u0026 java -jar build/libs/gs-spring-boot-docker-0.1.0.jar\n```\n\n```bash\ndocker build --build-arg JAR_FILE=build/libs/\\*.jar -t springio/gs-spring-boot-docker .\n```\n2. Run the image\n```bash\ndocker-compose up\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhieuwu%2Fsupa-spring-kt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhieuwu%2Fsupa-spring-kt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhieuwu%2Fsupa-spring-kt/lists"}