{"id":19972976,"url":"https://github.com/nkcoder/bondi","last_synced_at":"2025-03-01T18:24:07.656Z","repository":{"id":248652703,"uuid":"811649688","full_name":"nkcoder/bondi","owner":"nkcoder","description":"Scala scripts with functional programming in Scala 3 (Cats Effect, ZIO, Skunk etc.)","archived":false,"fork":false,"pushed_at":"2024-12-09T20:24:11.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T09:30:00.403Z","etag":null,"topics":["aws-sdk","functional-programming","postgresql","scala3","skunk"],"latest_commit_sha":null,"homepage":"","language":"Scala","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/nkcoder.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T02:54:52.000Z","updated_at":"2024-12-09T20:24:15.000Z","dependencies_parsed_at":"2024-12-09T21:23:27.366Z","dependency_job_id":"4f051eac-8099-44eb-bace-798f57134561","html_url":"https://github.com/nkcoder/bondi","commit_stats":null,"previous_names":["nkcoder/bondi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcoder%2Fbondi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcoder%2Fbondi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcoder%2Fbondi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nkcoder%2Fbondi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nkcoder","download_url":"https://codeload.github.com/nkcoder/bondi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241405815,"owners_count":19957905,"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":["aws-sdk","functional-programming","postgresql","scala3","skunk"],"created_at":"2024-11-13T03:09:56.788Z","updated_at":"2025-03-01T18:24:07.648Z","avatar_url":"https://github.com/nkcoder.png","language":"Scala","readme":"\u003e Bondi Beach: A world-famous beach in Sydney known for its golden sands, surf-friendly waves, vibrant beach culture,\n\u003e and the iconic Bondi Icebergs swimming club.\n\n## Introduction\n\nI have a deep passion for Scala and Functional Programming, although my professional work predominantly involves\nJavaScript and TypeScript on Node.js.\n\nTo bridge this gap, I initiated this project to handle various one-time or recurring tasks. More importantly,\nthis project serves as a platform for me to learn and practice Scala 3, delve into Functional Programming with libraries\nlike Cats and ZIO, and explore other Scala libraries.\n\n**Topics**:\n\n- [Scala 3](https://scala-lang.org/)\n- [Skunk](https://github.com/typelevel/skunk): a functional PostgreSQL client for Scala.\n- [PureConfig](https://github.com/pureconfig/pureconfig): a Scala library for loading configuration files.\n- [PostgreSQL](https://www.postgresql.org/): a powerful, open source object-relational database system.\n- [cats](https://typelevel.org/cats/): a library that provides abstractions for functional programming in Scala.\n- [cats-effect](https://typelevel.org/cats-effect/): a library that provides abstractions for effectful programming in\n  Scala.\n- [circe](https://circe.github.io/circe/): a JSON library for Scala.\n\n## Apps\n\n### RefundApp\n\n**Run**:\n\n```shell\nauto/dev io.daniel.apps.RefundApp\nauto/prod io.daniel.apps.RefundApp\n```\n\n### ClubTransfer\n\nRead a CSV file, then send emails using AWS SES client.\n\nHow to run the application:\n\n- changeAwsProfileToProd\n- change the `paymentType` to `PIF` or `DD`\n- put the corresponding input file in the `src/main/resources` folder\n  - if the format is `json` (`pif_club_transfer.json`, `dd_club_transfer.json`): git checkout version/json_input\n  - if the format is `csv` (`pif_club_transfer.csv`, `dd_club_transfer.csv`): git checkout version/csv_input\n- run the application: `auto/prod io.daniel.apps.ClubTransfer`\n- can test by changing #185 to `toDaniel` email\n\n**Run**:\n\n```shell\nauto/dev io.daniel.apps.ClubTransfer\nauto/prod io.daniel.apps.ClubTransfer\n```\n\n### FixDuplicateEmails\n\nRead a plain text file with emails, query and update Dynamodb data using AWS SDK.\n\n```shell\nauto/dev io.daniel.apps.FixDuplicateEmails\nauto/prod io.daniel.apps.FixDuplicateEmails\n```\n\n## Setup\n\nStart the local PostgreSQL database using Docker:\n\n```shell\ndocker compose  up\n```\n\n## Trouble Shooting\n\n### How to specify the application to run\n\n- Setting the mainClass in `build.sbt`\n    ```sbt\n    Compile / mainClass := Some(\"io.daniel.Main\")\n    Compile / mainClass := Some(\"io.daniel.apps.RefundApp\")\n    ```\n- Using the `run` task with the `--main` option\n    ```shell\n    sbt \"runMain io.daniel.apps.FixDuplicateEmails\"\n    ```\n\n### Secrets Manager can't find the specified secret.\n\n\u003e Secrets Manager can't find the specified secret. (Service: SecretsManager, Status Code: 400, Request ID:\n\u003e aab88d0e-ca3b-461a-8a6f-21371846fc63)\n\n**Options**:\n\n- Option 1: add environment variable `AWS_PROFILE=prod` to Intellij Idea Run/Debug configuration.\n- Option 2: run on the command line: `AWS_PROFILE=prod auto/prod io.daniel.apps.ClubTransfer`\n\n## References\n\n- [The Skunk Scala Library for Database Interaction: A Comprehensive Guide](https://blog.rockthejvm.com/skunk-complete-guide/#8-sql-interpolation-query-and-command)\n- [PureConfig doc](https://pureconfig.github.io/docs/)\n- [Skunk doc](https://typelevel.org/skunk/)\n- [Cats doc](https://typelevel.org/cats/)\n- [Cats Effect doc](https://typelevel.org/cats-effect/)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkcoder%2Fbondi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnkcoder%2Fbondi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnkcoder%2Fbondi/lists"}