{"id":21004654,"url":"https://github.com/flaque/wikiracer","last_synced_at":"2026-04-27T09:02:27.788Z","repository":{"id":80716219,"uuid":"100515084","full_name":"Flaque/wikiracer","owner":"Flaque","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-21T20:48:49.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T10:13:49.541Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Flaque.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-16T17:26:31.000Z","updated_at":"2019-08-01T03:15:10.000Z","dependencies_parsed_at":"2023-04-01T10:38:06.634Z","dependency_job_id":null,"html_url":"https://github.com/Flaque/wikiracer","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/Flaque%2Fwikiracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fwikiracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fwikiracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flaque%2Fwikiracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flaque","download_url":"https://codeload.github.com/Flaque/wikiracer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243419461,"owners_count":20287894,"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":[],"created_at":"2024-11-19T08:37:22.383Z","updated_at":"2025-12-27T11:59:24.739Z","avatar_url":"https://github.com/Flaque.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚗 Wikiracer\n\n## Running \n\n### Setup\n\nYou'll need go 1.8. To update your existing version, you can follow [these instructions](https://gist.github.com/nikhita/432436d570b89cab172dcf2894465753).\n\n### Running a build\n\nBuilding and running should just be \n\n```sh\n$ git clone https://github.com/Flaque/wikiracer.git\n$ cd wikiracer\n$ make run\n```\n\nThen you can hit endpoints from `localhost:8080`.\n\n### Running tests\n\nTo run all tests in all packages, you can run:\n\n```\n$ go test $(go list ./... | grep -v vendor)`\n``` \n\nTo exclude the integration tests (and load tests) (that make service calls and are therefore slower), run:\n```\n$ go test $(go list ./... | grep -v integration_tests | grep -v load_tests | grep -v vendor)\n```\n\n### Dockerizing\n\nIf you have docker installed, you should be able to dockerize the project with:\n\n```\nmake docker\n```\n\nThen you can hit endpoints from `localhost:6060`. \n\n### Testing out an endpoint\n\nTo try out a search, try the connections between `Dog` and `Airplane`:\n\nIf running locally without docker: [http://localhost:8080/search/Cat/Airplane](http://localhost:8080/search/Cat/Airplane)\n\nIf running locally with docker: [http://localhost:6060/search/Dog/Airplane](http://localhost:6060/search/Cat/Airplane)\n\n# Technical Overview\n\nThis wikiracer uses a concurrent **breadth first search (BFS)** in order to find a path as fast as possible. It keeps track of nodes in a priority queue where the priority is defined as the current depth of the node. That way, even if nodes get added out of order (because one goroutine finishes quicker than another), they'll still be searched in roughly equivilant \"rows\" of the search tree. If we didn't do this, then the search speed would be wildly different each time since some might end up looking more like a depth first search (which doesn't work all that well). \n\nWhen all goes well, the search can take roughly 1 to 3 seconds. We also **cache previous wikipedia nodes, as well as previous requests**, so if we search through nodes we've already seen or search the same thing twice, it should be under a second. \n\n## Logging \nThe project uses structured logging in JSON format via [zap](https://github.com/uber-go/zap). This let's us easily query our logs and easily ship them to other services in the future. \n\n## Packages\nThere are currently 5 packages. \n\n### wikimedia\nThe wikimedia package let's us interact with the wikmedia query API. Note that this is different than the REST API which will return HTML data.\n\n### search\nThe search package is what runs our concurrent BFS through wikimedia. \n\n### load_tests\nLoad tests is a WIP package that may eventually let us run some load tests. At the moment it's not perfect since it relies on there already being an instance of our API running. \n\n### integration_tests\nIntegration tests are currently in their own seperate package to make it easier to skip over them if you'd just like to run simple unit tests. These tests will query the api and therefore take a bit to complete.\n\n### tracer\nThis package is a simple little utility to log the time a function takes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaque%2Fwikiracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaque%2Fwikiracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaque%2Fwikiracer/lists"}