{"id":22288849,"url":"https://github.com/michael-valdron/tvgr-api","last_synced_at":"2025-10-08T20:25:03.186Z","repository":{"id":47024573,"uuid":"417716132","full_name":"michael-valdron/tvgr-api","owner":"michael-valdron","description":"Demo Scala Play web backend for making / view records of video game titles and their information.","archived":false,"fork":false,"pushed_at":"2022-07-20T02:51:56.000Z","size":113,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T21:21:45.830Z","etag":null,"topics":["play-framework","rest-api","scala","slick"],"latest_commit_sha":null,"homepage":"https://tvgr-api.herokuapp.com/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michael-valdron.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}},"created_at":"2021-10-16T04:32:46.000Z","updated_at":"2021-11-23T09:19:35.000Z","dependencies_parsed_at":"2022-09-03T12:21:13.486Z","dependency_job_id":null,"html_url":"https://github.com/michael-valdron/tvgr-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michael-valdron/tvgr-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-valdron%2Ftvgr-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-valdron%2Ftvgr-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-valdron%2Ftvgr-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-valdron%2Ftvgr-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michael-valdron","download_url":"https://codeload.github.com/michael-valdron/tvgr-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michael-valdron%2Ftvgr-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000659,"owners_count":26082817,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["play-framework","rest-api","scala","slick"],"created_at":"2024-12-03T17:07:10.989Z","updated_at":"2025-10-08T20:25:03.171Z","avatar_url":"https://github.com/michael-valdron.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Video Game Repository API\n\n[![Scala CI](https://github.com/michael-valdron/tvgr-api/actions/workflows/scala.yml/badge.svg)](https://github.com/michael-valdron/tvgr-api/actions/workflows/scala.yml)\n\nDemo Scala Play web backend for making / view records of \nvideo game titles and their information.\n\n## Requirements\n\n- Java 1.8+\n- Scala 2.13.6+\n- sbt 1.5.2+\n\n## Setup\n\nBefore running the application or using the test cases, there\nis a few things that need to be setup.\n\n### Environment Variables\n\nThere are two ways to setup the necessary environment variables\n\n1. Manual Exports - Recommended for production setups\n2. `.env` File - Using `sbt` allows for the automatic \nexporting of environment variable declarations in `.env`\nthanks to the\n[sbt-dotenv](https://github.com/mefellows/sbt-dotenv) plugin.\n\n#### Environment Variable Definitions\n|           Name           |           Description                       |\n|--------------------------|---------------------------------------------|\n| POSTGRES_URL             | The JDBC address to the database deployment. Example: `jdbc:postgresql://localhost:5432/mydb`|\n| POSTGRES_USER            | The user for accessing the deployed database. |\n| POSTGRES_PASSWORD        | The password for the user defined above.      |\n| POSTGRES_THREADS         | Number of threads for database actions. Example: `10` |\n| POSTGRES_MAX_CONNECTIONS | Max number of connection to database at one given time. **Note**: This must be at most as much as `POSTGRES_THREADS` or there can be problems. \n| PLAY_HTTP_SECRET_KEY     | The HTTP secret key for this Play application. Ensure all application instances that use the same authentication methods have the same key. |\n| SILHOUETTE_SHARED_SECRET | The shared secret to sign the JWT tokens.     |\n\n### Database\n\nThis project uses the \n[PostgreSQL](https://www.postgresql.org/) DBMS as the backend\ndatabase system.\n\nFor deploying a local instance of PostgreSQL, one can either\ninstall it to their system or using `docker-compose` in\nthe project folder as such:\n\n```shell\ndocker-compose up postgres\n```\n\nOne can start PostgreSQL as a background process by doing\nthe following:\n\n```shell\ndocker-compose up -d postgres\n```\n\nClean up can be done using:\n\n```shell\ndocker-compose down\n```\n\n**Note**: Base directory `docker-compose.yml` is used for\nlocal deployments NOT production. If you plan to run this\nin a live environment, please perform the proper database\nsetup for doing for. For instance, setup system environment\nvariables in the live environment rather than use a `.env`\nfile.\n\n## Usage\nTo run the application, use the follow form in the shell:\n\n```shell\nsbt run\n# or \ndocker up -d postgres \u0026\u0026 sbt run # if database is not deployed yet\n```\n\n### Testing\n\nFor testing, one can run the testsuites by doing the following:\n\n```shell\nsbt test\n# or \ndocker up -d postgres \u0026\u0026 sbt test # if database is not deployed yet\n```\n\n## Routing\n### APIs\n| Method |    Route             | Parameter(s) |\n|--------|----------------------|--------------|\n|  GET   |     `/v1/games`      |              |\n|  GET   |  `/v1/game/:entryId` |   `entryId`  |\n|  PUT   |  `/v1/add`           |              |\n|  POST  |  `/v1/edit/:entryId` |   `entryId`  |\n| DELETE | `/v1/remove/:entryId`|   `entryId`  |\n\n### Authentication\n\n| Method |    Route             | Parameter(s) |\n|--------|----------------------|--------------|\n|  POST  |     `/register`      |              |\n|  POST  |   `/login`           |              |\n\n## JSON Schemes\n\n### User Example\n\n```json\n{\n  \"username\": \"user\",\n  \"password\": \"password1\"\n}\n```\n\n### Game Example\n\n```json\n{\n  \"id\": 243425,\n  \"title\": \"Well of Quests\",\n  \"genre\": \"RPG\",\n  \"description\": \"An adventure game of the ages!\",\n  \"releaseDate\": \"2005-10-01\"\n}\n```\n\n## References\n\n### Authentication\n\nDue to the continuous learning process of learning \nthe Play framework the following was used as references\nfor a good portion of the authentication process:\n- Dmitriy Chuprina \u0026 Oleg Yermolaiev's [GitHub example](https://github.com/sysgears/auth-with-play-silhouette-example)\n- Dmitriy Chuprina's [blog](https://sysgears.com/articles/how-to-create-restful-api-with-scala-play-silhouette-and-slick/) \non setting up for JWT authentication using Play\n\n### Others\n- Play Framework's Slick [samples](https://github.com/playframework/play-slick/tree/master/samples)\n- Slick's [samples](https://github.com/slick/slick/tree/main/samples)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael-valdron%2Ftvgr-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichael-valdron%2Ftvgr-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichael-valdron%2Ftvgr-api/lists"}