{"id":18712233,"url":"https://github.com/vivekweb2013/deck-api","last_synced_at":"2025-04-12T11:51:22.499Z","repository":{"id":103593034,"uuid":"490541950","full_name":"vivekweb2013/deck-api","owner":"vivekweb2013","description":"A deck api server built with go","archived":false,"fork":false,"pushed_at":"2022-05-10T11:33:45.000Z","size":45,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-26T06:34:33.528Z","etag":null,"topics":["cards","deck","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","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/vivekweb2013.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-10T04:32:12.000Z","updated_at":"2024-12-25T15:36:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"60ee1fdc-252b-441a-83c3-812f21e761e9","html_url":"https://github.com/vivekweb2013/deck-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/vivekweb2013%2Fdeck-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekweb2013%2Fdeck-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekweb2013%2Fdeck-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekweb2013%2Fdeck-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vivekweb2013","download_url":"https://codeload.github.com/vivekweb2013/deck-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565001,"owners_count":21125413,"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":["cards","deck","go","golang"],"created_at":"2024-11-07T12:41:22.221Z","updated_at":"2025-04-12T11:51:22.494Z","avatar_url":"https://github.com/vivekweb2013.png","language":"Go","readme":"# Deck API\nThis is a simple golang application that exposes deck APIs useful for playing card games.\n\n## How to run\n- Install go version `1.18.1` or above\n- Clone this repository\n- Prepare config file\n\nThe application reads the configurations from `.app.yaml` file or the environment variables. The `app.yaml` is a sample config that can be used to create the actual config file. Execute the following command to create a app config file.\n```shell\ncp app.yaml .app.yaml\n```\nYou can edit the config values inside `.app.yaml` file.\n\n- Start the server directly using below command\n```shell\ngo run main.go\n```\n\nOr, If you want to build \u0026 run executable then below run commands.\n```shell\ngo build\n./deck-api\n```\n\nThis will start the http server on the host on port mentioned in the `.app.yaml` config file.\n\n## How to run tests\n- Run the following command from the root directory\n```shell\ngo test -v -cover ./...\n```\nThis will execute all the tests and also prints the code coverage percentage.\n\n## API Endpoints\n### `POST /api/v1/decks`\nCreate a new deck.\n#### Params\n| Name | Type | Optional | Description\n| --- | --- | --- | --- |\n| shuffled | boolean | yes | Can be set as `true/false`. If `true`, the cards from the deck will be shuffled.\n| cards | csv | yes | CSV of card codes (e.g. `AS,KD,AC,2C,KH`). If provided, deck will be created with only specified cards otherwise deck will be created with all cards.\n\n### `GET /api/v1/decks/:id`\nOpen a deck using deck uuid.\n#### Params\n| Param Name | Type | Optional | Description\n| --- | --- | --- | --- |\n| id | uuid (string) | no | The uuid of deck to be opened.\n\n### `POST /api/v1/decks/:id/draw`\nDraw card(s) from a specific deck.\n#### Params\n| Name | Type | Optional | Description\n| --- | --- | --- | --- |\n| id | uuid (string) | no | The uuid of deck.\n| count | int | no | Number of cards to draw from the deck.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekweb2013%2Fdeck-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvivekweb2013%2Fdeck-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekweb2013%2Fdeck-api/lists"}