{"id":15556387,"url":"https://github.com/cranst0n/dogleg-web","last_synced_at":"2025-10-15T03:06:23.864Z","repository":{"id":35630408,"uuid":"39904426","full_name":"cranst0n/dogleg-web","owner":"cranst0n","description":"Dogleg web backend.","archived":false,"fork":false,"pushed_at":"2015-07-29T16:36:41.000Z","size":1628,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-03T13:15:21.381Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","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/cranst0n.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}},"created_at":"2015-07-29T16:35:41.000Z","updated_at":"2015-07-29T16:37:07.000Z","dependencies_parsed_at":"2022-08-17T21:55:45.774Z","dependency_job_id":null,"html_url":"https://github.com/cranst0n/dogleg-web","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cranst0n%2Fdogleg-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cranst0n%2Fdogleg-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cranst0n%2Fdogleg-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cranst0n%2Fdogleg-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cranst0n","download_url":"https://codeload.github.com/cranst0n/dogleg-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246131940,"owners_count":20728400,"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-10-02T15:13:36.931Z","updated_at":"2025-10-15T03:06:23.773Z","avatar_url":"https://github.com/cranst0n.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Web backend component for serving \u0026 managing dogleg golf data.\n\n### Intro\n\nThis project serves as the backend for storing golf data (among a number of\nother things) which can be used for any number of purposes. The current project\nis being driven by personal goal of a GPS/statistics manager for my rounds.\n\nThere are a few other projects that can be used in conjuction with this one:\n\n[dogleg-courses](https://github.com/cranst0n/dogleg-courses)\n[dogleg-android](TBD)\n\n### Requirements\n\n1. Typesafe Activator\n1. Postgres \u003e= 9.4\n  1. ```postgis``` extension\n  1. ```pg_trgm``` extension\n1. Redis\n\n### Typical Install\n\n```bash\nsudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main\" \u003e /etc/apt/sources.list.d/pgdg.list'\nsudo apt-get install wget ca-certificates\nwget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -\nsudo apt-get update\nsudo apt-get upgrade\nsudo apt-get install -qq postgresql-9.4\nsudo apt-get install -qq postgresql-9.4-postgis-2.1\nsudo apt-get install -qq postgresql-contrib\n\n# Setup postgres authentication\nsudo -u postgres psql template1\nALTER USER postgres with encrypted password 'xxxxxxx';\nsudo vim /etc/postgresql/9.4/main/pg_hba.conf\n  # local    all    postgres    md5\nsudo /etc/init.d/postgresql restart\n\n# Create databases for test/production\npsql -c \"create user dogleg with password 'dogleg'\" -U postgres\npsql -c \"alter user dogleg with superuser\" -U postgres\npsql -c \"create database doglegtest with owner dogleg\" -U postgres\npsql -c \"create database dogleg with owner dogleg\" -U postgres\npsql -c \"alter schema public owner to dogleg\" -U postgres doglegtest\npsql -c \"alter schema public owner to dogleg\" -U postgres dogleg\npsql -c \"grant all privileges on database doglegtest to dogleg\" -U postgres\npsql -c \"grant all privileges on database dogleg to dogleg\" -U postgres\n\n# Redis\nsudo apt-get install -qq redis-server\n```\n\n### Testing\n\n#### Backend (specs2)\n\nBecause dogleg uses postgres, using Play's in memory database testing strategy\ndoesn't work well. Instead you'll need to manually create another postgres DB\nwith the same user/password credentials as the production/development DB but\nnamed ```doglegtest```.\n\n**The dogleg user must also be a SUPERUSER (so it can create the postgis\nextension when necessary during tests/evolutions)**\n\n```sql\nALTER USER dogleg WITH SUPERUSER ;\n```\n\nDogleg's test harness will connect to the test database in a test like:\n\n  ```scala\n    \"require user activation after insert\" in DoglegTestApp { implicit module =\u003e\n      // Do some database stuff\n      DB withConnection { implicit connection =\u003e\n        SQL\"\"\"select * from table\"\"\".execute\n      }\n    }\n  ```\n\nThe ```DoglegTestApp``` scope will configure Play's DB configuration and\n**also wrap any test code so that the entire DB schema is cleaned after each\ntest is executed.**\n\n#### Frontend\n\n```bash\n  npm install\n```\n\n##### Unit (Jasmine)\n\n```bash\n  ./node_modules/karma/bin/karma start conf/karma.conf.js\n```\n\n##### End to End (Protractor)\n\nRun the following commands (in seperate windows)\n\n```bash\n  ./node_modules/protractor/bin/webdriver-manager update     # First run only\n  ./node_modules/protractor/bin/webdriver-manager start\n```\n\n```bash\n  ./node_modules/protractor/bin/protractor test/assets/e2e/conf.js\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcranst0n%2Fdogleg-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcranst0n%2Fdogleg-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcranst0n%2Fdogleg-web/lists"}