{"id":24911542,"url":"https://github.com/hackoregon/backend-service-pattern","last_synced_at":"2025-03-28T03:14:59.944Z","repository":{"id":77886434,"uuid":"83918620","full_name":"hackoregon/backend-service-pattern","owner":"hackoregon","description":"Exemplar HackOregon Django Backend Pattern for 2017 Project season","archived":false,"fork":false,"pushed_at":"2019-03-08T03:13:33.000Z","size":1566,"stargazers_count":2,"open_issues_count":1,"forks_count":11,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-02T04:23:33.506Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/hackoregon.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":"2017-03-04T19:21:46.000Z","updated_at":"2019-03-08T03:13:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ff555c3-3d97-48d1-a1a4-f7d6a675bb67","html_url":"https://github.com/hackoregon/backend-service-pattern","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/hackoregon%2Fbackend-service-pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fbackend-service-pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fbackend-service-pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fbackend-service-pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackoregon","download_url":"https://codeload.github.com/hackoregon/backend-service-pattern/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245960813,"owners_count":20700781,"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":"2025-02-02T04:20:47.674Z","updated_at":"2025-03-28T03:14:59.927Z","avatar_url":"https://github.com/hackoregon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://travis-ci.org/hackoregon/backend-service-pattern.svg?branch=master)](https://travis-ci.org/hackoregon/backend-service-pattern)\n\n## Hack Oregon Exemplar Backend Service\n\nNOTE: this is based on the Homelessness team's backend repo, and as such still includes many hardcoded references to \"homeless\" and/or \"homelessness\". You will want to update all such app-specific references when implementing this pattern for your project's application.  \n\n## Purpose\n\nDemonstrates CI/CD for HackOregon Django service\n\n## Dependencies\n\n* Docker or Docker toolkit\n* Travis-CI\n* Cluster deployment keys  - Contact the DevOps team\n* ECR Password - Contact the DevOps Team\n* ECS Service Name - See Section 5\n\n\n## How to build\n\n### 1.  Create Your Environment file\n\n* Create `env.sh` in the project with the following contents:\n\n```bash\n#! /bin/bash\n# Setup Project Specfics - Make sure env.sh is in the .gitignore and .dockerignore\nexport DOCKER_IMAGE= #see section 5 for conventions\nexport PROJ_SETTINGS_DIR= #see section 5 for conventions\nexport DEPLOY_TARGET=dev # it's always dev on your local machine\necho \"##############################\"\necho  Your Local Project Environement\necho \"##############################\"\necho DOCKER_IMAGE $DOCKER_IMAGE\necho PROJ_SETTINGS_DIR $PROJ_SETTINGS_DIR\necho DEPLOY_TARGET $DEPLOY_TARGET\n```\n### 2. Setup your local environment\n\n* Run `source env.sh` to setup your environment\n\n### 3. Build \u0026 Test the container\n\n* Run `./bin/build-test-proj -l` to build your container locally\n\n**Note:** For this to work correctly you will need to get your DBA to run the following SQL as the postgres user:\n\n```SQL\nGRANT CONNECT ON database postgres TO \u003cyour_db_user\u003e;\nGRANT USAGE ON SCHEMA public to \u003cyour_db_user\u003e;\nGRANT SELECT ON ALL TABLES IN SCHEMA public TO \u003cyour_db_user\u003e;\n```\n\n### 4. Start the project\n\n* Make sure you've got a local copy of your projects's `project_config.py`\n* Run `./bin/start-proj -l` to view your service's swaggerized API\n\n### 5. Setup your project in travis\n\n* Set up the following environment variables\n\n```bash\n ECS_SERVICE_NAME       #Your service name as defined on the ECS Cluster. Valid values for the integration cluster are:\n                        # - civiclab            \"hacko-integration-CivicLabService-SHCQWODY5CF4-Service-5R2TN149GD71\"\n                        # - budget              \"hacko-integration-BudgetService-16MVULLFXXIDZ-Service-1BKKDDHBU8RU4\"\n                        # - emergency response  \"hacko-integration-EmerreponseService-1LC4181KR6KN5-Service-1WR6VWC6KKIEP\"\n                        # - homelessness        \"hacko-integration-HomelessService-1MT93S2GQTJZ4-Service-15OXS2BV07GN0\"\n                        # - housing             \"hacko-integration-HousingService-1LLLKFJR36AJ5-Service-15AO7849OUCYV\"\n                        # - transportation      \"hacko-integration-transportService-67KME5SFWBJO-Service-12UZIOOA2FNIK\"\n                        #\n ECS_CLUSTER            # Use \"hacko-integration\"\n                        #\n DOCKER_REPO            # Use \"845828040396.dkr.ecr.us-west-2.amazonaws.com\"\n                        #\n DOCKER_IMAGE           # The name of your service. Valid values are:\n                        # - civiclab            \"civic-lab-service\"\n                        # - budget              \"budget-service\"\n                        # - emergency response  \"emergency-service\"\n                        # - homelessness        \"homeless-service\"\n                        # - housing             \"housing-service\"\n                        # - transportation      \"transport-service\"\n                        #\n                        #\n DEPLOY_TARGET          # What environment you are deploying to. Valid values are:\n                        # - For travis integration deploys: \"travis\"\n                        #\n PROJ_SETTINGS_DIR      # the directory (relative to your top-level) where your configuration files are found. Valid values are:\n                        # - civiclab            \"civiclabSettings\"\n                        # - budget              \"budgetAPI\"\n                        # - emergency response  \"emerresponseAPI\"\n                        # - homelessness        \"homelessAPI\"\n                        # - housing             \"housingAPI\"\n                        # - transportation      \"transportationAPI\"\n\n                        #\n CONFIG_BUCKET          # The s3 configuration bucket. Valid values:\n                        # - civiclab            \"hacko-civiclab-config\"\n                        # - budget              \"hacko-budget-config\"\n                        # - emergency response  \"emerresponse-config\"\n                        # - homelessness        \"hacko-homeless-config\"\n                        # - housing             \"hacko-housing-config\"\n                        # - transportation      \"hacko-transportation-config\"\n AWS_DEFAULT_REGION     # Use \"us-west-2\"\n                        #\n AWS_ACCESS_KEY_ID      # The service deployer keyid for your service (Always hide in travis)                \n                        #\n AWS_SECRET_ACCESS_KEY  # The service deployer secret key for your service (Always hide in travis)\n```\n\n**IMPORTANT:** Make sure that you don't store AWS or Docker repository credentials in your github repo or expose them in travis\n\n### 7. Commit  \n* Commit and push your code and ensure travis builds and deploys correctly\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Fbackend-service-pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackoregon%2Fbackend-service-pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Fbackend-service-pattern/lists"}