{"id":13682808,"url":"https://github.com/AlejandroME/ReaderM","last_synced_at":"2025-04-30T09:34:34.783Z","repository":{"id":149447480,"uuid":"96046034","full_name":"AlejandroME/ReaderM","owner":"AlejandroME","description":"Repository with a simple Microservice demonstrating some Functional Patterns","archived":false,"fork":false,"pushed_at":"2017-07-03T16:33:05.000Z","size":22,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-02T13:34:35.321Z","etag":null,"topics":["akka-http","cats","circe","doobie","functional-programming","scala"],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/AlejandroME.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-02T20:01:30.000Z","updated_at":"2023-05-19T10:47:43.000Z","dependencies_parsed_at":"2023-06-19T17:50:27.677Z","dependency_job_id":null,"html_url":"https://github.com/AlejandroME/ReaderM","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroME%2FReaderM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroME%2FReaderM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroME%2FReaderM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlejandroME%2FReaderM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlejandroME","download_url":"https://codeload.github.com/AlejandroME/ReaderM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224206240,"owners_count":17273413,"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":["akka-http","cats","circe","doobie","functional-programming","scala"],"created_at":"2024-08-02T13:01:53.583Z","updated_at":"2024-11-12T02:31:57.136Z","avatar_url":"https://github.com/AlejandroME.png","language":"Scala","funding_links":[],"categories":["Scala"],"sub_categories":[],"readme":"# ReaderM\n\n\nThis is a _toy project_ which I made for demonstrate some concepts in [my blog](https://alejandrome.github.io). It will be evolving with new functionalities that I'm going to explore.\n\nThis is a runnable _microservice_ built with the following stack of technologies:\n\n* [Akka Http](http://doc.akka.io/docs/akka-http/current/scala/http/) (10.0.9)\n* [cats](http://typelevel.org/cats/) (0.9.0)\n* [doobie](https://github.com/tpolecat/doobie) (0.4.1)\n* [Circe](https://github.com/circe/circe) (0.8.0)\n* [spray Revolver](https://github.com/spray/sbt-revolver) (0.8.0)\n\nOf course, on top of Scala (2.12.2).\n\nThis MS models a **_music domain_**: it documents my favourite artists, bands (not the same as artists), albums and songs. This because of my lack of _ideas_ for a domain :sweat_smile:, but it'll be enough for demonstration purposes.\n\nYou can run the API typing the following commands in your terminal (using revolver):\n\n```shell\n$ sbt\n\u003e reStart\n```\n\nWith this command you are starting a forked JVM which can be killed or `reStart`'d without killing your `sbt` session. That means that you can type in any moment `reStart` for re-starting your application if you've made any change.\n\nAlso, you can run the application in the old-fashioned way:\n\n```shell\n$ sbt\n\u003e run\n```\n\nThe service will be listening on port **7101**.\n\nThe requests (in the actual version) that you can issue are:\n\n* `[GET]` `http://localhost:7101/api/artists` **to list all the artists available in the database.**\n* `[GET]` `http://localhost:7101/api/artists?id=\u003cid\u003e` **to query an artist by his/her ID in the database.**\n* `[GET]` `http://localhost:7101/api/artists?name=\u003cname\u003e` **to query an artist by his/her _EXACT_ name.**\n* `[POST]` `http://localhost:7101/api/artists` **to create a new artist in the database**\n* `[PUT]` `http://localhost:7101/api/artists` **to update**\n\nAll the examples and the entities for creating and updating an artists are included in the project root as a [Postman](https://www.getpostman.com/) collection if you want to take a look and test it for yourself.\n\n# Database initialization\n\nThis first version assumes that you have a local installation of PostgreSQL running in your machine with the default user/schema (`postgres`). You can run the `DDL_PG.sql` script (located in the `SQL/` folder of this project) in that schema to create all the database model and then run the `DML_PG.sql` that contains a very basic dataset.\nThis is not yet automated, but it will in future versions, so you don't have to do it by hand.\n\nIf you are running macOS you can use the excellent [Postgres.app](https://postgresapp.com/) that runs a complete instance of the database in your machine without configuring or messing up with a new installation of PG.\n\nIn other OS's you need to install the Database engine and execute the scripts mentioned above.\n\n**REMEMBER:** the model is created in the `postgres` default schema.\n\n# Disclaimer\n\nAs noted before, this is a _toy project_, so, things like exception handling, exception messages and so on can fail abruptly. This is going to be improved in future versions of this project. Again, the code here is only for demonstration purposes and it isn't intended for production use (yet?).\n\n# License\n\nThe code in this repository is licensed under the MIT license. If you don't understand what does that means, here's an excerpt from [choosealicense](https://choosealicense.com/licenses/mit/):\n\n\u003e A short and simple permissive license with conditions only requiring preservation of copyright and license notices. Licensed works, modifications, and larger works may be distributed under different terms and without source code.\n\nAnd that's it :)\nIf you have questions you can get in touch with me on [Twitter](https://twitter.com/AlejandroM_E).\n\nAME.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlejandroME%2FReaderM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlejandroME%2FReaderM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlejandroME%2FReaderM/lists"}