{"id":21101179,"url":"https://github.com/brentgreeff/tv_api","last_synced_at":"2025-11-11T19:15:01.340Z","repository":{"id":39689076,"uuid":"242459414","full_name":"brentgreeff/tv_api","owner":"brentgreeff","description":"movies, seasons \u0026 episodes","archived":false,"fork":false,"pushed_at":"2023-01-19T17:33:25.000Z","size":60,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T02:42:33.728Z","etag":null,"topics":["api","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/brentgreeff.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":"2020-02-23T05:00:47.000Z","updated_at":"2021-10-03T11:56:56.000Z","dependencies_parsed_at":"2023-02-11T13:00:56.649Z","dependency_job_id":null,"html_url":"https://github.com/brentgreeff/tv_api","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/brentgreeff%2Ftv_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentgreeff%2Ftv_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentgreeff%2Ftv_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentgreeff%2Ftv_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brentgreeff","download_url":"https://codeload.github.com/brentgreeff/tv_api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243544648,"owners_count":20308169,"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":["api","rails","ruby"],"created_at":"2024-11-19T23:41:23.746Z","updated_at":"2025-11-11T19:15:01.309Z","avatar_url":"https://github.com/brentgreeff.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TV API\n\n[![Maintainability](https://api.codeclimate.com/v1/badges/84fbf16dd2a019ec6a1c/maintainability)](https://codeclimate.com/github/brentgreeff/tv_api/maintainability)\n\n[![Test Coverage](https://api.codeclimate.com/v1/badges/84fbf16dd2a019ec6a1c/test_coverage)](https://codeclimate.com/github/brentgreeff/tv_api/test_coverage)\n\n## Development setup\n\n`docker-compose up`\n\nCheck services are running:\n`docker-compose ps`\n\nSetup DB:\n`docker-compose exec api bin/rails db:create db:migrate`\n\nAccess Adminer:\nhttp://localhost:8080/?server=database\u0026username=root\u0026db=app_development\npassword: root\n\n## Run tests\n\n`docker-compose exec api bin/guard`\n\nPress [Enter] - to run all tests.\n\nSimpleCov is installed.\n\nAs is the recommendation by the Rails core team \u0026 the RSpec team I am writing request specs since they exercise the whole stack. Guard is configured to run the corresponding request_spec when the controller is saved.\n\n## Architectural considerations\n\nI am a fan of [Domain Driven Design](https://www.amazon.com/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215). I read it many years ago, but I think the core idea was to model the system in the same language \u0026 terms used by the client. This could be the internal client or business analyst. The goal being that as the system evolves, the development team \u0026 the business at large use the same keywords. For example, the client could use the term \"content\" and the developers have implemented this in the code as \"entity\". The reason I bring this up is because of the duplication of fields. If I understand the description correctly then both Season \u0026 Episode have the same fields [title, plot, number]. Movie has [title \u0026 plot]. It seems to point to using STI but I am not fond of this pattern. As the app develops in the future these concepts are sure to diverge in how the behave.\n\n\n### Versioning\n(not implemented at this time)\n\nSupporting multiple versions indefinitely can be difficult \u0026 potentially unnecessary if the API is internal. I like Github's method of using Accept headers instead of versioned URLs - https://developer.github.com/v3/versions/\n\n### Performance\n\n#### Alternatives to Rails\n\nI initially considered Roda because of its performance profile, but Hanami looks even more appealing especially for an API - http://hanamirb.org/blog/2020/02/26/introducing-hanami-api.html\n\n#### serialization\nI spent quite a bit of time thinking about serializers. AMS is easy to use, but slow, and the future of that project is uncertain. I have also used fast_jsonapi - which is a questionable choice for this exercise. I looked through all the open-source github repos for \"the company\" - nothing API related it seems. jsonapi-rb has good performance \u0026 low memory usage but follows the JSON:API spec. There could be some reasons not to follow that spec: https://apisyouwonthate.com/blog/lets-stop-building-apis-around-a-network-hack\n\n#### Database\nROM is very interesting - https://rom-rb.org/blog/rom-5-0-and-rom-sql-3-0-released/ - could have performance advantages, but looks experimental still.\n\n### Consistent\n\n### Stable\n\n### Well documented\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentgreeff%2Ftv_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrentgreeff%2Ftv_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentgreeff%2Ftv_api/lists"}