{"id":13617695,"url":"https://github.com/Hacktoberfest/hacktoberfest-2020","last_synced_at":"2025-04-14T06:35:09.122Z","repository":{"id":48707239,"uuid":"200877850","full_name":"Hacktoberfest/hacktoberfest-2020","owner":"Hacktoberfest","description":"Hacktoberfest - App to manage the annual open-source challenge, used for the 2019 \u0026 2020 seasons.","archived":true,"fork":false,"pushed_at":"2021-07-13T15:16:40.000Z","size":75749,"stargazers_count":496,"open_issues_count":27,"forks_count":147,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-08-03T01:29:31.890Z","etag":null,"topics":["hacktoberfest","ruby"],"latest_commit_sha":null,"homepage":"https://hacktoberfest.digitalocean.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hacktoberfest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-06T15:26:12.000Z","updated_at":"2024-06-07T22:55:03.000Z","dependencies_parsed_at":"2022-09-13T08:00:45.385Z","dependency_job_id":null,"html_url":"https://github.com/Hacktoberfest/hacktoberfest-2020","commit_stats":null,"previous_names":["digitalocean/hacktoberfest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hacktoberfest%2Fhacktoberfest-2020","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hacktoberfest%2Fhacktoberfest-2020/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hacktoberfest%2Fhacktoberfest-2020/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hacktoberfest%2Fhacktoberfest-2020/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hacktoberfest","download_url":"https://codeload.github.com/Hacktoberfest/hacktoberfest-2020/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223621972,"owners_count":17174795,"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":["hacktoberfest","ruby"],"created_at":"2024-08-01T20:01:46.377Z","updated_at":"2024-11-08T02:31:03.274Z","avatar_url":"https://github.com/Hacktoberfest.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eHacktoberfest\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/digitalocean/hacktoberfest/stargazers\"\u003e\u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/digitalocean/hacktoberfest\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/digitalocean/hacktoberfest/issues\"\u003e\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/digitalocean/hacktoberfest\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/digitalocean/hacktoberfest/network\"\u003e\u003cimg alt=\"GitHub forks\" src=\"https://img.shields.io/github/forks/digitalocean/hacktoberfest\"\u003e\u003c/a\u003e\n    \u003ca href=\"#\"\u003e\u003cimg alt=\"GitHub language count\" src=\"https://img.shields.io/github/languages/count/digitalocean/hacktoberfest\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/digitalocean/hacktoberfest/search?l=ruby\"\u003e\u003cimg alt=\"GitHub top language\"src=\"https://img.shields.io/github/languages/top/digitalocean/hacktoberfest\"\u003e\u003c/a\u003e\n    \u003cbr\u003e\n    \u003cimg alt=\"Snyk Vulnerabilities for GitHub Repo\" src=\"https://img.shields.io/snyk/vulnerabilities/github/digitalocean/hacktoberfest\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"/app/assets/images/HF-full-logo.svg\" alt=\"Hacktoberfest-2020 Logo\" width=\"350\"\u003e\n\u003c/p\u003e\n\n## Features\n\n* Static pages\n* Airtable backed events and FAQs\n* Issue discovery by language\n* Log in with GitHub\n* Multi-step registration\n* Pull request timeline\n* Challenge completion validation\n* Prize distribution\n\n## Components\n\nThere are three major components that are entirely separate from one another:\n\n1. Issue discovery - Fetches issues from GitHub with the label `hacktoberfest` and persists them in the database to be featured on the homepage based on a randomized quality filter.\n\n2. Content pages - Primarily static pages that are supplemented with dynamic data from Airtable.\n\n3. Participant management - Allows users to register to participate in Hacktoberfest, tracks user progress, and distributes prizes based on availability. The majority of the business logic is implemented with a state machine, validating that various conditions are met before a user may be transitioned to a new state and with certain actions being triggered on successful state transitions.\n\n\n## Getting Started\n\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.\n\n### Prerequisites\n\n- Ensure your os is the latest MacOS\n\n- Have brew installed (Run the following command in a mac os terminal to install):\n\n```\n/usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n```\n\n## Application Setup\n\n1) [Install and Setup](#installing)\n2) [Local Setup With Docker](#local-setup-with-docker)\n3) [Setup Oauth Token](#setup-oauth-token)\n4) [Configure remaining environment variables](#env-variables)\n5) [Create first user](#create-first-user)\n6) [Import Projects](#import-projects)\n\n### Installing\n\nClone the repo:\n\n```\ngit clone https://github.com/digitalocean/hacktoberfest\n```\n\nIn your local repository, run script/setup, which will install all necessary dependencies for you:\n\n```\nscript/setup\n```\n### Local Setup With Docker\n\nIf you would like to use Docker to work with the application, first make sure that you have Docker and Docker Compose on your local machine.\n\nNext clone the repo as described in [Step 1](#installing). \n\nFrom there, create a local `.env` file, and add fill out the following values, using steps [3](#setup-oauth-token) and [4](#env-variables) to guide you:\n\n```\nHACKTOBERFEST_DATABASE_HOST=database\nHACKTOBERFEST_DATABASE_USERNAME=hacktoberfest\nHACKTOBERFEST_DATABASE_PASSWORD=sekret\nHACKTOBERFEST_API_KEY=sekret\nREDIS_HOST=redis\nREDIS_PORT=6379\nDALLI_SERVER=memcached\nGITHUB_CLIENT_ID=\u003cfill-in-for-dev-setup\u003e\nGITHUB_CLIENT_SECRET=\u003cfill-in-for-dev-setup\u003e\nSTART_DATE=\u003cfill-in-for-dev-setup\u003e\nRULES_DATE=\u003cfill-in-for-dev-setup-same-as-start\u003e\nEND_DATE=\u003cfill-in-for-dev-setup\u003e\nAIRTABLE_API_KEY=\u003cfill-in-for-dev-setup\u003e\nAIRTABLE_APP_ID=\u003cfill-in-for-dev-setup\u003e\nSEGMENT_WRITE_KEY=\u003cleave-blank\u003e\nTEST_USER_GITHUB_TOKEN=\u003cleave-blank\u003e\n```\n**Note**: Use the following values when setting up your Oauth token:\n\n```\n\u003e Homepage URL: `http://localhost`\\\n\u003e Authorization callback URL: `http://localhost/auth/github/callback`\n```\nThe local Docker setup uses a webserver, in the same way that the application does in staging and production, so it will be reachable on port `80`.\n\nRun the startup script, `./script/docker-startup.sh` to start your services.\n\n**Note:** You do not need to use the other startup scripts in the repo if you are using Docker to run the application locally. When using Docker, follow the steps in this section of the README.\n\n**Inspecting and Troubleshooting**\n\nYou can inspect whether or not your services have started successfully by running the `check` script: `./script/check.sh`. You will see the following output if the services are all running:\n\n```\n         Name                         Command               State           Ports         \n-------------------------------------------------------------------------------------------\nhacktoberfest_app_1         ./script/docker-entrypoint.sh    Up      3000/tcp              \nhacktoberfest_database_1    docker-entrypoint.sh postgres    Up      0.0.0.0:5432-\u003e5432/tcp\nhacktoberfest_redis_1       docker-entrypoint.sh redis ...   Up      6379/tcp              \nhacktoberfest_sidekiq_1     ./script/sidekiq-entrypoint.sh   Up      3000/tcp              \nhacktoberfest_webserver_1   nginx -g daemon off;             Up      0.0.0.0:80-\u003e80/tcp    \n```\n\nIn cases where you need to investigate an exit status, you can get the logs of the service with `docker-compose logs \u003cservice-name\u003e`.\n\nTo check that the application is ready to accept traffic, run `docker-compose logs app`. You should see the following output:\n\n```\napp_1        | ==\u003e Hacktoberfest is now ready to go!\napp_1        | =\u003e Booting Puma\napp_1        | =\u003e Rails 5.2.3 application starting in development \napp_1        | =\u003e Run `rails server -h` for more startup options\napp_1        | Puma starting in single mode...\napp_1        | * Version 4.1.1 (ruby 2.5.8-p224), codename: Fourth and One\napp_1        | * Min threads: 5, max threads: 5\napp_1        | * Environment: development\napp_1        | * Listening on tcp://0.0.0.0:3000\napp_1        | Use Ctrl-C to stop\n```\nOnce the app is running, you can connect to it by navigating to `localhost`. Please note that trying to connect to the app at `localhost` before it is ready will result in `502` Bad Gateway error, so be sure to check the logs first.\n\n**Testing**\n\nIf you would like to run commands against your app service, you can do that with the following command (using rubocop as an example): \n\n```\n./script/test-command.sh bundle exec rubocop app config db lib spec --safe-auto-correct\n```\n\nOr to run a particular spec:\n\n```\n./script/test-command.sh bundle exec rspec \u003cyour-spec-file\u003e\n```\n**Running migrations**\n\nIn cases where you want to create a migration in the context of your current development, you can use the following command:\n\n```\ndocker-compose exec app rails g migration \u003cyour migration\u003e\n```\nTo run the migration, type:\n\n```\ndocker-compose exec app bundle exec rake db:migrate\n```\nIn both cases, the relevant files and changes will be available on your host, as well as on your container.\n\nIf the app is currently stopped and you need to run migrations, you can use the `restart-app` script, which will restart the app and run any pending migrations. See the explanation below for more detail.\n\n**Reloading the server**\n\nThere are cases where you will need to stop and restart the Rails server, in order for things like configuration changes to take effect. \n\nTo do this, run the following script to stop and restart the app: `./script/restart-app.sh`.\n\nThis will restart the app and run any pending migrations.\n\n**Adding a new gem to the project**\n\nAnother task you may need to accomplish is adding a new gem to the project. Because this local Docker setup depends on a gem volume (to speed up development and boot times), you need to both stop the application and remove this volume for your changes to take effect. \n\nTo do this, run the following script: `./script/rebuild-app.sh`.\n\n**Taking the setup down**\n\nTo stop your services and remove the network, you can run `docker-compose down`.\n\nOr, if you would like to remove your build cache and volumes, you can use the `stop-and-clean` script: `./script/stop-and-clean.sh`. \n\n### Setup Oauth Token\n\nHacktoberfest uses `GITHUB_CLIENT_ID` \u0026 `GITHUB_CLIENT_SECRET` variables to configure OmniAuth.\n\nThis allows users to be authorized for Hacktoberfest via Github.\n\nFor this, you will have to create a Github OAuth App (https://developer.github.com/apps/building-oauth-apps)\n\nBe sure your OAuth app is configured with the following URLs\n\n![Oauth Config](https://user-images.githubusercontent.com/7976757/66855839-fd259980-ef51-11e9-808b-26a9251841bf.png)\n\n\u003e Homepage URL: `http://localhost:3000`\\\n\u003e Authorization callback URL: `http://localhost:3000/auth/github/callback`\n\nThe Client ID and Client Secret are right above this configuration. Use them to set the following ENV variables: \n\n```\nGITHUB_CLIENT_ID=\nGITHUB_CLIENT_SECRET=\n```\n\n### ENV Variables\n\n#### Start Date \u0026 End Date\n\nHacktoberfest is officially active from October 1st - October 31st (in any timezone)\n\nThe app can be in three different states:\n\n* Pre-launch \n  - Users can sign up and all pages are reachable, but the profile page is not yet tracking pull requests\n* Active\n  - All pages are active and the profile is tracking PRs\n* Finished\n  - Hacktoberfest has declared its winners\n\nSo your dates can look something like this if you're developing in October 2019 and you want the app in the Active state.\n\n```bash\n START_DATE=\"2019-09-30 10:00:00 UTC\"\n END_DATE=\"2019-11-01 12:00:00 UTC\"\n```\n\n(These timestamps account for the furthest positive UTC offset (+14 in Kiribati), where they’ll see 1st Oct 00:00 on 30th Sept 10:00 UTC and the furthest negative UTC offset (-12 in the US Outlying Islands), where they’ll see 1st Nov 00:00 on 1st Nov 12:00 UTC).\n\nIf you want to work on the app in the `Pre-Launch` state, set the start date to a future date.\nIf you want to work on the app in the `Finished` state, set the end date to a past date.\n\n#### Airtable API Key \u0026 Airtable App ID\n\nHacktoberfest uses Airtable as a CMS to hold useful data such as:\n  - Events\n  - FAQ\n  - Spam Repositories\n\nFor your convenience we have created two options:\n\n##### Create an Airtable Database:\n\nWe created a read-only copy of what the Airtable database should look like.\n\nWith this you can create your own schema by following this format:\n(https://airtable.com/shrqM142bVC1Gj2t8)\n\nAfter you’ve created and configured the schema of an Airtable base from the graphical interface,\n\nyour Airtable base will provide its own API to create, read, update, and destroy records.\n\nYou should update these variables accordingly in your `.env`\n\n##### Use Placeholder Airtable Service\n\nIf configuring your own Airtable schema does not sound like your cup of tea - don't fret.\n\nWe have created placeholder service objects that will render test data if your Airtable keys are not set.\n\nThis service will be used as default.\n\nYou can find this service in `app/services/airtable_placeholder_service.rb`\n\n### Create First User\n\n1) Spin up the server by running `script/server`\n\n2) Now, open your browser of choice and visit `localhost:3000`\n\n3) Click `START HACKING` on the top right of the navigation bar\n\n![start hacking](https://user-images.githubusercontent.com/7976757/66863220-8e9c0800-ef60-11e9-8100-87af508fdf3d.png)\n\n4) Log in with your github account\n\n5) Agree to the terms and conditions and continue\n\n### Import Projects\n\nThis task imports repositories to the hacktoberfest app(these are displayed on the homepage). If you don't run the task, there simply won't be any repositories on the homepage aside from the hard-coded climate change repos.\n\n1) Spin up sidekiq:\n\n```\nscript/sidekiq\n```\n\n2) In a separate terminal window, run the import script:\n\n```bash\nbin/rails github:fetch_popular_languages_projects\n```\n\n## Running the project\n\nThere are two commands you will need for running the project.\n\nFirst, spin up the rails server locally:\n\n```\nscript/server\n```\n\nIf you will be running any background jobs through sidekiq, run the following command in a separate terminal window from `script/server` which will spin up both redis and sidekiq:\n\n```\nscript/sidekiq\n```\n\n## Contributing\n\nHacktoberfest is open source and we welcome contributions. See [CONTRIBUTING.md](/CONTRIBUTING.md) for more info.\n\n## Code of Conduct\n\nThis project uses the Contributor Covenant Code of Conduct. See [CODE_OF_CONDUCT.md](/CODE_OF_CONDUCT.md) for more info.\n\n## Credits\n\nThe Hacktoberfest app is built and maintained for DigitalOcean by developers from [Raise.dev](https://raise.dev).\n\n## License\n\nLicensed under the [MIT License](http://en.wikipedia.org/wiki/MIT_License).\nThe full license text is available in [LICENSE.md](/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHacktoberfest%2Fhacktoberfest-2020","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHacktoberfest%2Fhacktoberfest-2020","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHacktoberfest%2Fhacktoberfest-2020/lists"}