{"id":16113007,"url":"https://github.com/guilospanck/dota2-counters-backend","last_synced_at":"2025-04-06T07:24:02.860Z","repository":{"id":103566827,"uuid":"392144342","full_name":"Guilospanck/dota2-counters-backend","owner":"Guilospanck","description":"Backend hosted on an EC2 Amazon instance to serve as backend to the react native application Dota2CountersReactNative.","archived":false,"fork":false,"pushed_at":"2021-08-03T01:16:23.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-12T12:55:46.534Z","etag":null,"topics":["backend","dota2","ec2","node"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Guilospanck.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-03T01:14:30.000Z","updated_at":"2022-12-14T14:48:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ba64181-5cd0-4e22-914d-228820550410","html_url":"https://github.com/Guilospanck/dota2-counters-backend","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/Guilospanck%2Fdota2-counters-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guilospanck%2Fdota2-counters-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guilospanck%2Fdota2-counters-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guilospanck%2Fdota2-counters-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guilospanck","download_url":"https://codeload.github.com/Guilospanck/dota2-counters-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247446873,"owners_count":20940201,"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":["backend","dota2","ec2","node"],"created_at":"2024-10-09T20:09:57.419Z","updated_at":"2025-04-06T07:24:02.826Z","avatar_url":"https://github.com/Guilospanck.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dota 2 Counters - Backend\nBackend hosted on an EC2 Amazon instance to serve as backend to the react native application [Dota2CountersReactNative](https://github.com/Guilospanck/Dota2CountersReactNative).\n\n---\n\n## Some configurations to remember\n\n### FOR NODE APPLICATIONS YOU'LL NEED PM2:\n1) Install PM2 on your server \n```bash\nnpm install pm2@latest -g\n```\n:arrow_right: ```PM2``` it's a package that is going to run the process in the background.\n\n2) Go to your ```server.js``` folder and run  \n```bash\npm2 start server.js\n```  \n:arrow_right: If you have problems and need to add node params, you can do something like: \n```bash\npm2 start server.js --node-args=\"--max-http-header-size=16384\"\n```\n\nOther configs to pm2:\n```bash\npm2 status\npm2 restart {index}\n```\n\n---\n\n### TO FORWARD PORTS IN UBUNTU:\n\n1) ```cat /proc/sys/net/ipv4/ip_forward```  :arrow_right: verify if port forwarding is enabled (1: enabled, 0: disabled)\n2) if disabled (0), then:\n    - ```sudo nano /etc/sysctl.conf```\n    - uncomment the following line: ```net.ipv4.ip_forward```\n    - ```sudo sysctl -p /etc/sysctl.conf```  (to enable changes)\n3) ```cat /proc/sys/net/ipv4/ip_forward``` :arrow_right: verify if port forwarding is enabled (1: enabled, 0: disabled)\n4) set port forwarding:\n```bash\nsudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport {PORT_OF_YOUR_INSTANCE} -j REDIRECT --to-port {PORT_OF_YOUR_SERVER_APPLICATION}\n```\nFor e.g.: \n```bash\nsudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080\n```\nwhere:\n        - {PORT_OF_YOUR_INSTANCE} is the port opened on your machine (usually 80, 443, 22 ...)\n        - {PORT_OF_YOUR_SERVER_APPLICATION} is the port that you're listening on your application (on server.js for node)\n5) Now open your firewall to that port\n```bash\nsudo iptables -A INPUT -p tcp -m tcp --sport {PORT_OF_YOUR_INSTANCE} -j ACCEPT\n```\nFor e.g.:\n```bash\nsudo iptables -A INPUT -p tcp -m tcp --sport 80 -j ACCEPT)\n```\nAnd:\n```bash\nsudo iptables -A OUTPUT -p tcp -m tcp --dport {PORT_OF_YOUR_INSTANCE} -j ACCEPT\n```\n\n---\n\n### TO SET CRONTAB:   \n1) Enable cron: sudo systemctl enable cron\n2) Type   crontab -e    and then enter\n3) select nano as your editor (usually option 1)\n4) Set your crontab service (go to cron guru for examples)\n```bash\n30 03 * * * python3 /home/ubuntu/dota2cp/dotabuff_scrapper.py\n```\nIt'll run dotabuff_scrapper.py everyday at 03:30am.\n\n  :arrow_right: (don't forget the \"/\" before the path in \"/home...\", otherwise will not work)\n  \n  :arrow_right: (always test before, in other words, test on the terminal: python3 /home/ubuntu/dota2cp/dotabuff_scrapper.py)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilospanck%2Fdota2-counters-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguilospanck%2Fdota2-counters-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguilospanck%2Fdota2-counters-backend/lists"}