{"id":31644136,"url":"https://github.com/bgildson/enext-challenge","last_synced_at":"2026-04-15T16:31:37.003Z","repository":{"id":57538306,"uuid":"280024729","full_name":"bgildson/enext-challenge","owner":"bgildson","description":"This repository contains the source code to satisfy the enext challenge","archived":false,"fork":false,"pushed_at":"2020-08-08T01:24:06.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T04:18:10.300Z","etag":null,"topics":["api","challenge","ci","coverage","docker","golang","parser","quake3","report","rest","tdd","tests"],"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/bgildson.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":"2020-07-16T01:45:52.000Z","updated_at":"2020-08-08T01:24:08.000Z","dependencies_parsed_at":"2022-09-07T17:35:45.261Z","dependency_job_id":null,"html_url":"https://github.com/bgildson/enext-challenge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bgildson/enext-challenge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgildson%2Fenext-challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgildson%2Fenext-challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgildson%2Fenext-challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgildson%2Fenext-challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bgildson","download_url":"https://codeload.github.com/bgildson/enext-challenge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bgildson%2Fenext-challenge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31849703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","challenge","ci","coverage","docker","golang","parser","quake3","report","rest","tdd","tests"],"created_at":"2025-10-07T04:05:47.240Z","updated_at":"2026-04-15T16:31:36.977Z","avatar_url":"https://github.com/bgildson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ENEXT-CHALLENGE\n\n[![Test Status](https://github.com/bgildson/enext-challenge/workflows/Test%20and%20Send%20Coverage%20Report/badge.svg)](https://github.com/bgildson/enext-challenge/actions?workflow=test)\n[![Coverage Status](https://coveralls.io/repos/github/bgildson/enext-challenge/badge.svg?branch=master)](https://coveralls.io/github/bgildson/enext-challenge?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bgildson/enext-challenge)](https://goreportcard.com/report/github.com/bgildson/enext-challenge)\n\nThis repository contains the source code to satisfy the [enext challenge](CHALLENGE.md).\n\n## How to run the challenge solution\n\nTo facilitate the command executions, the commands bellow will use Docker as runner.\n_In case of need to run pieces of the solution, you should use [Golang 1.14](https://golang.org/dl/) with modules and install the dependencies._\n\n### Task 1\n\nThe first task was to create the **Quake 3 log parser**, run the command bellow to execute the parser.\n\n```sh\ndocker run --rm -it -v $(pwd):/app -w /app golang:1.14 go run ./cmd/parser/main.go -log=./games.log -out=./games.json\n```\n\nThe parser will generate a `.json` with the parsed games and should looks like the bellow representation.\n\n```json\n{\n  ...\n  \"2\": {\n    \"id\": \"2\",\n    \"total_kills\": 11,\n    \"players\": [\n      \"Isgalamido\",\n      \"Mocinha\"\n    ],\n    \"kills\": {\n      \"Isgalamido\": -7,\n      \"Mocinha\": 0\n    }\n  },\n  ...\n}\n```\n\n### Task 2\n\nThe second task was to create the **Game Report**, the report has two output types, one for **players results ranking grouped by game** and other for **players general results ranking**. run the command bellow to execute the games report.\n\n_obs: the commands bellow depends of the task 1 command execution, because it uses the `games.json` parser output._\n\nReport **players results ranking grouped by game**\n```sh\ndocker run --rm -it -v $(pwd):/app -w /app golang:1.14 go run ./cmd/report/main.go -games-json-path=./games.json -general=false\n```\n\nThe first report should looks the like bellow representation.\n\n```json\nGame 1                              Total Kills: 0\nPosition | Player                         | Points\n\nGame 2                             Total Kills: 11\nPosition | Player                         | Points\n       1 | Mocinha                        | 0\n       2 | Isgalamido                     | -7\n...\n```\n\nReport **players general results ranking**\n```sh\ndocker run --rm -it -v $(pwd):/app -w /app golang:1.14 go run ./cmd/report/main.go -games-json-path=./games.json -general=true\n```\n\nThe second report should looks the like bellow representation.\n\n```json\nGeneral Ranking                  Total Kills: 1069\nPosition | Player                         | Points\n       1 | Isgalamido                     | 138\n       2 | Zeh                            | 120\n       3 | Oootsimo                       | 108\n...\n```\n\n### Task 3\n\nThe third task was to create the **api for games results**, the api was created using a Clean Architecture minimum implementation and using the output from _the parser_ as data source. The api has two endpoints **/games** to list the games and the **/games/{id}** to find the game by id.\n\n_obs: the commands bellow depends of the task 1 command execution, because it uses the `games.json` parser output._\n\n```sh\ndocker run --rm -it -v $(pwd):/app -p 8080:8080 -w /app golang:1.14 go run ./cmd/api/main.go -games-json-path=./games.json -port=8080\n```\n\nThe api will run on http://localhost:8080 and will provide one endpoint for **[/games](http://localhost:8080/games)** and other for **[/games/{id}](http://localhost:8080/games/2)**.\n\n## How to run the solution tests\n\nAll the code is covered by tests and to execute the tests use the command bellow.\n\n```sh\ndocker run --rm -it -v $(pwd):/app -w /app golang:1.14 go test -v ./...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgildson%2Fenext-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbgildson%2Fenext-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbgildson%2Fenext-challenge/lists"}