{"id":19315177,"url":"https://github.com/matgalv2/shop-app","last_synced_at":"2026-05-02T22:33:20.974Z","repository":{"id":259718562,"uuid":"858241039","full_name":"matgalv2/shop-app","owner":"matgalv2","description":"Simple CRUD REST-based application for managing online store. Database consists of 5 tables: clients, products, orders, addresses and ordersproducts, which resolves N:N relation between those two.","archived":false,"fork":false,"pushed_at":"2024-12-14T21:21:44.000Z","size":360,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-06T03:41:32.486Z","etag":null,"topics":["cats","flyway","http4s","openapi","postgresql","rest-api","scala","zio"],"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/matgalv2.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-09-16T14:56:09.000Z","updated_at":"2024-12-18T21:39:56.000Z","dependencies_parsed_at":"2025-01-06T03:40:36.510Z","dependency_job_id":"f07c035c-80ad-4aa8-9bb4-c99073de0506","html_url":"https://github.com/matgalv2/shop-app","commit_stats":null,"previous_names":["matgalv2/shop-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matgalv2%2Fshop-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matgalv2%2Fshop-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matgalv2%2Fshop-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matgalv2%2Fshop-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matgalv2","download_url":"https://codeload.github.com/matgalv2/shop-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240416907,"owners_count":19797901,"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":["cats","flyway","http4s","openapi","postgresql","rest-api","scala","zio"],"created_at":"2024-11-10T01:04:57.975Z","updated_at":"2025-11-15T02:04:15.219Z","avatar_url":"https://github.com/matgalv2.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shop app\nSimple CRUD REST-based application for managing online store. Database consists of 5 tables: clients, products, orders, addresses and ordersproducts, which resolves N:N relation between those two.\n\n![image info](./icon.png)\n\n\n### Progress\n![](https://geps.dev/progress/100?dangerColor=800000\u0026warningColor=ff9900\u0026successColor=006600)\n\n|                   | Customers | Products | Orders |\n|-------------------|-----------|----------|--------|\n| Implementation    | ✅         | ✅        | ✅      |\n| Unit Tests        | ✅         | ✅        | ✅      |\n| Integration Tests | ✅         | ✅        | ✅      |\n| Acceptance Tests  | ✅         | ✅        | ✅      |\n\n## Technology \u0026 tools:\nTechnology stack:\n* Scala 2.13\n* ZIO 2\n* PostgreSQL\n* Flyway\n* Http4s\n* Cats 2\n* OpenAPI\n* Kafka\n\nTools \u0026 libraries:\n* Guardrail\n* Quill\n* Chimney\n* Typesafe config\n* Docker\n\n## API\nAll APIs are described here:\n* [Customers API](./api/customerApi.yaml)\n* [Products API](./api/productApi.yaml)\n* [Orders API]()\n\n## Design decisions:\n### 1. REST API\n* Based on OpenApi specifications Guardrail generates boilerplate code for controllers.\n\n### 2. Database\n* Database migrations - to ensure application works with latest version of database Flyway controls database migrations.\n* DSL - to simplify work with database Quill provides QDSL for expressing queries in Scala.\n* Queries implementations - due to fact that quill queries return effects that can fail with SQLError all effects should die with DatabaseCriticalFailure.\n* Audit table - to allow monitoring changes in orders table audit table has been utilized. Any change in orders table triggers trigger which saves modification in orders_aud table.\n* Indexes - due to the fact that sooner or later orders_aud will become large in size hash and btree indexes were added to simplify queries using this table.\n\n### 3. Data transformation\n* Mappers - Chimney library was utilized for transforming data types (Domain \u003c-\u003e DTO).\n\n### 4. Domain\n* Validation - to ensure all data flowing through app is valid, all the objects are validated before being used. \n* ErrorMessage - special type class for all domain errors to easily transform them into error responses.\n\n### 5. Data flow\n* To allow fetching reasonable number of some type of data all repositories supports fetching with offset and limit.\n\n### 6. Automation\n* Cyclic jobs - side tasks that must be done in specified intervals like archiving delivered orders after 3 months.\n\n### 7. Asynchronous processing\n* Message Broker - some time-consuming operations should be nonblocking that is why Kafka was utilized to process order requests.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatgalv2%2Fshop-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatgalv2%2Fshop-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatgalv2%2Fshop-app/lists"}