{"id":18233329,"url":"https://github.com/grimmerk/search-github-starred","last_synced_at":"2025-04-03T19:31:02.623Z","repository":{"id":44309177,"uuid":"65841652","full_name":"grimmerk/search-github-starred","owner":"grimmerk","description":"Full-Text Search the readme, description, homepage and URL of your GitHub starred repository. Use GitHub OAuth 2, React, Redux, Golang (server side), Elasticsearch, Redis.","archived":false,"fork":false,"pushed_at":"2023-01-25T18:20:36.000Z","size":1075,"stargazers_count":16,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-19T15:45:13.543Z","etag":null,"topics":["aws","github-api","go","google-adsense","google-analytics"],"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/grimmerk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-16T17:53:57.000Z","updated_at":"2023-12-05T15:03:53.000Z","dependencies_parsed_at":"2023-02-14T10:10:22.504Z","dependency_job_id":null,"html_url":"https://github.com/grimmerk/search-github-starred","commit_stats":null,"previous_names":["grimmerk/search-github-starred"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimmerk%2Fsearch-github-starred","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimmerk%2Fsearch-github-starred/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimmerk%2Fsearch-github-starred/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grimmerk%2Fsearch-github-starred/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grimmerk","download_url":"https://codeload.github.com/grimmerk/search-github-starred/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247065161,"owners_count":20877718,"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":["aws","github-api","go","google-adsense","google-analytics"],"created_at":"2024-11-04T15:04:06.244Z","updated_at":"2025-04-03T19:31:02.170Z","avatar_url":"https://github.com/grimmerk.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# search-github-starred\nFull-Text Search the readme, description, homepage and URL of your GitHub starred repository. ~~Try https://searchgithub.herokuapp.com~~ which is kept alive by synthetics of newrelic. **Update:** Since the AWS service is not paid so this site is not working. \n\nThis is the missing function on GitHub. GitHub site only supplies the function to search repo-descripton and also only exact phrase match. This site supports both types. Type \"A B\" for phrase A B and type A B for sequence not important case.\n\nPlease try: https://searchgithub.herokuapp.com.\n\nIt uses OAuth 2, React, Redux, Golang (server side), Elasticsearch, Redis and so on. Will open source later.\n\n### Local Development\n1. npm install\n2. install go extension of Visual Studio Code.\n3. change the necessary fields in .vscode/launch.json (YOUR_ fields), example:\n    ~~~ javascript\n    {\n        \"version\": \"0.2.0\",\n        \"configurations\": [\n            {\n                \"name\": \"Launch\",\n                \"type\": \"go\",\n                \"request\": \"launch\",\n                \"mode\": \"debug\",\n                \"remotePath\": \"\",\n                \"preLaunchTask\": \"buildclient\",\n                \"port\": 2345,\n                \"host\": \"127.0.0.1\",\n                \"program\": \"${workspaceRoot}\",\n                \"env\": {\n                    \"GITHUB_CLIENT_ID\" : \"YOUR_GITHUB_CLIENT_ID\", //ouath of your github app\n                    \"GITHUB_CLIENT_SECRET\": \"YOUR_GITHUB_CLIENT_SECRET\",  //ouath of your github app\n                    \"CallbackURL\": \"http://YOUR_SITE_ADDRESS/auth/callback/\",\n                    \"AWS_ACCESS_KEY_ID\": \"YOUR_AWS_ACCESS_KEY_ID\",  // elasticserach of aws\n                    \"AWS_SECRET_ACCESS_KEY\": \"YOUR_AWS_SECRET_ACCESS_KEY\", // elasticserach of aws\n                    \"REDIS_URL\": \"YOUR_REDIS_URL\" //setup your heroku redis or other service's redis\n                },\n                \"args\": []\n            }\n        ]\n    }\n    ~~~\n\n4. use Visual Studio Code to launch the server.\n5. open localhost:5000.\n\n`YOUR_REDIS_URL` could be `redis://localhost:6379` or ` redis://h:YOUR_REDIS_PWD@REDIS_ADDRESS:PORT`. You can use `docker run -p 6379:6379 --name some-redis -d redis` to run a local dockerized Redis.\n\n### Set up AWS' Elasticserach\n\nThe keypoint is to create a AMI role to have a permission to write to AWS' Elasticsearch, then only give anonymous users the read permission.\n\n#### Set up an AWS AMI\n\nThis project uses [Resource-based Policies](https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-ac.html#es-ac-types-resource), so it does not need to add any permission to this AMI user.\n\n#### Set up Elasticsearch\n\nLaunch a Elasticsearch service and choose version 2.3. The current go API is not updated to the latest Elasticsearch version yet.\n\nThen create a new Domain, e.g. `searchgithub`. Then modify the access policy like this,\n\n```\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"AWS\": \"*\"\n      },\n      \"Action\": \"es:*\",\n      \"Resource\": “Domain ARN/githubrepos/_search\"\n    },\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"AWS\": \"User ARN\"\n      },\n      \"Action\": \"es:*\",\n      \"Resource\": \"Domain ARN/*\"\n    }\n  ]\n}\n```\n\n`githubrepos` is the fixed Elasticsearch `index` in this project. The first statement is let browser have read permission, and the the second is to let the server have the write permission if it has AWS access key of the AMI user.\n\nThe account name of each user will be used as the `type` of Elasticsearch.\n\n#### Modify the Elasticsearch setting in indexAPI.go and repos.js\n\nindexAPI.go:\n```\nawsURL = \"AWS_ELASTICSEARCH_DOMAIN_ENDPOINT\"\n```\n\nrepos.js:\n```\nconst client = new elasticsearch.Client({\n  host: 'AWS_ELASTICSEARCH_DOMAIN_ENDPOINT/githubrepos',\n});\n```\n\n`AWS_ELASTICSEARCH_DOMAIN_ENDPOINT` could be found out in AWS dashboard. E.g. `https://search-searchgithub-XXXXXXXXXXXXXXXXXXXXXXXXXX.us-west-2.es.amazonaws.com`\n\n**use locally dockerized Elasticsearch**\n\n```\ndocker run -p 9200:9200 -p 9300:9300 -e \"discovery.type=single-node\" grimmer0125/elasticsearch:2.3\n```\n\nThen use `http://localhost:9200` as the above `AWS_ELASTICSEARCH_DOMAIN_ENDPOINT` in the codes. \n\n### Deployment on Heroku\n\nHeroku' Redis add-on will automatically create the REDIS_URL as the environment config variable, shown in the dashboard setting page. The other variables needed to be added in the Heroku setting page. https://devcenter.heroku.com/articles/heroku-redis#configuring-your-instance indicates that its REDIS_URL may change at any time.\n\n### Referenced repository\nThe parameters and the flow about github api calls are from https://github.com/mjmsmith/starredsearch, which is a excellent project and uses Swift on server side to implement the function seraching the information on starred repositories. This repo is based on that repository and add the feature, fulll-text (elasticserach).  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrimmerk%2Fsearch-github-starred","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrimmerk%2Fsearch-github-starred","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrimmerk%2Fsearch-github-starred/lists"}