{"id":22752323,"url":"https://github.com/hackthevalley/htv-api","last_synced_at":"2025-03-30T06:44:11.598Z","repository":{"id":104068188,"uuid":"192432493","full_name":"hackthevalley/htv-api","owner":"hackthevalley","description":"API for HTV 3","archived":false,"fork":false,"pushed_at":"2020-01-07T06:59:03.000Z","size":137,"stargazers_count":0,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-07T07:33:08.211Z","etag":null,"topics":["golang","gqlgen","graphql","mlh","oauth2"],"latest_commit_sha":null,"homepage":"","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/hackthevalley.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":"2019-06-17T23:38:28.000Z","updated_at":"2024-06-19T07:58:11.371Z","dependencies_parsed_at":"2024-06-19T07:58:09.924Z","dependency_job_id":"014191e5-0de4-4071-9f48-907486a36a9d","html_url":"https://github.com/hackthevalley/htv-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackthevalley%2Fhtv-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackthevalley%2Fhtv-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackthevalley%2Fhtv-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackthevalley%2Fhtv-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackthevalley","download_url":"https://codeload.github.com/hackthevalley/htv-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285668,"owners_count":20752953,"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":["golang","gqlgen","graphql","mlh","oauth2"],"created_at":"2024-12-11T05:10:59.269Z","updated_at":"2025-03-30T06:44:11.570Z","avatar_url":"https://github.com/hackthevalley.png","language":"Go","readme":"Hack the Valley 3 API\n=====================\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/logo.png\"/\u003e\n\u003c/p\u003e\n\n[_powered by gqlgen_](https://gqlgen.com/)\n\n## Pre-requisites:\n1. Spin up MongoDB docker container:\n    ```bash\n    $ docker volume create mongo-data\n    $ docker network create htv-net\n    $ docker run -d --network htv-net -p 27017:27017 -v mongo-data:/data/db --name mongodb -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=password --restart always mongo\n    ```\n2. Spin up Redis docker container:\n    ```bash\n    $ docker volume create redis-data\n    $ docker run --name redis --restart always -d -p 6379:6379 --network htv-net -v redis-data:/data redis redis-server --appendonly yes\n    ```\n\n## Instructions:\n1. Install and configure Golang for your OS: [Here](https://golang.org/doc/install)\n2. Clone this repository master branch\n3. `cd` into the project root\n4. Run the following commands to download the dependencies, \nverify them and vendor it locally for your projects:\n    ```bash\n    $ go mod download\n    $ go mod tidy\n    $ go mod verify\n    $ go mod vendor\n    ```\n5. Set the following environment variables for the MLH Oauth middleware:\n    ```bash\n    export client_id=some_id \n    export client_secret=some_secret\n    export scope=email+education+birthday\n    export redirect_uri=http://localhost:8080/v1/auth/callback\n    ```\n6. Run the following command to start up the graphql playground:\n    ```bash\n    $ go run ./server/server.go\n    ```\n7. Modify `resolver.go` as you go along to add/modify features.\n8. Now on your frontend, redirect the user to the following url to initiate the flow\u003cbr/\u003e\n(provided you have added `http://localhost:8080/v1/auth/callback` to the redirect url section for your mlh client id)\n    ```\n    https://my.mlh.io/oauth/authorize?client_id=some_client_id\u0026redirect_uri=http://localhost:8080/v1/auth/callback\u0026response_type=code\u0026scope=email+education+birthday\n    ```\n8. For more information on how gqlgen works, check out the: [docs](https://gqlgen.com/getting-started/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackthevalley%2Fhtv-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackthevalley%2Fhtv-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackthevalley%2Fhtv-api/lists"}