{"id":24911533,"url":"https://github.com/hackoregon/housing-backend","last_synced_at":"2025-03-28T03:14:59.751Z","repository":{"id":77886845,"uuid":"87670062","full_name":"hackoregon/housing-backend","owner":"hackoregon","description":null,"archived":false,"fork":false,"pushed_at":"2018-06-04T02:04:20.000Z","size":1309,"stargazers_count":1,"open_issues_count":3,"forks_count":8,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-02-02T04:23:31.501Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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-04-08T23:20:31.000Z","updated_at":"2018-06-04T02:04:22.000Z","dependencies_parsed_at":"2023-03-12T02:24:08.056Z","dependency_job_id":null,"html_url":"https://github.com/hackoregon/housing-backend","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fhousing-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fhousing-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fhousing-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Fhousing-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackoregon","download_url":"https://codeload.github.com/hackoregon/housing-backend/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:45.085Z","updated_at":"2025-03-28T03:14:59.727Z","avatar_url":"https://github.com/hackoregon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hack Oregon Housing Project, 2016-2017\nThis project will create a dynamic, educational portal that helps clarify the multifaceted and changing rental environment in PDX, with a focus on affordable rentals. The team will investigate what parts of town are currently affordable to a diverse spectrum of residents, and explore trends in how the Portland housing and rental market has changed over time, with a special emphasis on recent changes in the 7-year census gap. The project will approach common perceptions of the state of affordable rent in Portland with a range of digital, analytical, and creative strategies, with the overall goal of broadening insight on the experience of renting in Portland.\nThe most current version of Team Housing's Vision Document / Elevator Pitch is maintained by Gabriele Hayden.\n\n## Prerequisites\n\nIf you are running a recent edition of MacOS, Windows 10 Professional, or Linux, you need Docker and Git:\n\n* [Docker](https://www.docker.com/products/overview)\n* [Git](https://git-scm.com/)\n\nIf you are using an older version of Windows, you'll have need to use either Docker Toolbox, which is temperamental and not covered, or run Docker in a Vagrant box, provided here:\n\n* [Vagrant](https://www.vagrantup.com/downloads.html)\n* [Vagrant for Docker](https://github.com/JohnTasto/vagrant-for-docker)\n* [Virtualbox](https://www.virtualbox.org/wiki/Downloads)\n\n## Working with Git\n\n### Set up repositories:\n\nFrom GitHub, fork the Repo at [https://github.com/hackoregon/housing-backend](https://github.com/hackoregon/housing-backend).\n\nClone the GitHub repository using SSH or HTTPS:\n```\n# SSH:\n$ git clone git@github.com:YOUR-USERNAME/housing-backend.git\n# HTTPS:\n$ git clone https://github.com/YOUR-USERNAME/housing-backend.git\n```\n\nAdd upstream remote repository:\n```\n# SSH:\n$ git remote add upstream git@github.com:hackoregon/housing-backend.git\n# HTTPS:\n$ git remote add upstream https://github.com/hackoregon/housing-backend.git\n```\n\n### About the `datasources` branch:\n\nThis branch is reserved for the data that populates the database tables. See the branch README for more detail.  \n\n```\ngit checkout datasources\n```\n\n### Do some coding:\n\nMake a feature branch:  \n[optional]\n```\ngit branch \u003cbranchname\u003e\ngit checkout \u003cbranchname\u003e\n# or the shorthand:\ngit checkout -b \u003cbranchname\u003e\n```\n\nAdd and commit your changes:\n```\ngit add .\ngit commit -m \"a meaningful commit message in the imperative present tense\"\n```\n\nMerge back into master:  \n[optional - if working from a feature branch]\n```\ngit checkout master\ngit rebase \u003cbranchname\u003e\n```\n\n### Submit changes back to Github:\n\nDownload changes other's may have made and merge with your changes:\n```\ngit fetch upstream\ngit rebase upstream/master\n```\n\nPush changes back to your own fork:\n```\ngit push -f origin master\n```\n\n### Submit a Pull Request!\n\n### Other helpful commands:\n\nList changed / uncommitted files:\n```\n$ git status\n```\n\nList the current branches of the repository:\n```\n$ git branch -a\n```\n\n## Services Development Environment\n\nThese instructions establish local Docker containers and services for development of the API and database.\n\n### Dependencies\n\n* Docker or Docker toolkit\n* (Optional) Travis-CI - Contact the DevOps Team\n* (Optional) Cluster deployment keys - Contact the DevOps Team\n* (Optional) ECR Password - Contact the DevOps Team\n* (Optional) ECS Service Name - Contact the DevOps Team\n\n### How to build\n\n#### 1. Create the environment file\n\n* Create `env.sh` in the project with the following contents:\n\n```bash\n#! /bin/bash\n# Setup project specifics - Make sure env.sh is in the .gitignore and .dockerignore\nexport DOCKER_IMAGE=housing-service\nexport PROJ_SETTINGS_DIR=housingAPI\nexport DEPLOY_TARGET=dev\necho \"##############################\"\necho  Local Project Environment\necho \"##############################\"\necho DOCKER_IMAGE $DOCKER_IMAGE\necho PROJ_SETTINGS_DIR $PROJ_SETTINGS_DIR\necho DEPLOY_TARGET $DEPLOY_TARGET\n```\n\n* Run `chmod +x backend/bin/env.sh` to make the script file executable\n\nAt this point you need to determine if you want to run the database locally or reference the one hosted by AWS. This has implications on the degree of changes you can make to the data schema, table contents, and so on. Consult with your DevOps contact for help.\n\n* For maximum control when you want to update or code up a new API endpoint, run with a local database with default credentials. Create `housing-backend/backend/backend/project_config.py` (in the same directory as `settings.py`) with the following contents:\n\n```python\nAWS = {\n    # Settings for dev:\n    'ENGINE': 'django.db.backends.postgresql_psycopg2',\n    'NAME': 'postgres',\n    'HOST': 'db',\n    'PORT': '5432',\n    'USER': 'postgres',\n    'PASSWORD': '',\n    }\n\n# Note: the 192.168.99.100 enables testing with Docker Toolbox for Mac and Windows\nALLOWED_HOSTS = ['127.0.0.1',\n                 'localhost',\n                 '192.168.99.100']\n```\n\n* To run local services that reference the remote live database, Hack Oregon credential are required. This is usually the pattern required for incremental changes to the data loaded into the database tables or to run migrations on the live deployment. Obtain `project_config.py` from your DevOps contact. Place the file at: `housing-backend/backend/backend` (in the same directory as `settings.py`)\n\n#### 2. Setup your local environment\n\n* Run `source backend/bin/env.sh` to setup your environment\n\n#### 3. Build the container services\n\n* From `housing-backend`, run `backend/bin/build-proj.sh -l` to build your container locally\n\n#### 4. Start the project\n\n* From `housing-backend`, run `backend/bin/start-proj.sh -l`\n* From a web browser open `localhost:8000/housing/`\n\n### Shutdown:\n\n* From the terminal session you ran `start-proj.sh` press `Ctrl+C`\n\nOr\n\n* Open a new terminal session\n* From `housing-backend`, run `source backend/bin/env.sh` to setup your environment\n* From `housing-backend/backend`, run `docker-compose -f local-docker-compose.yml down`\n\n### Rebuild images (necessary if `requirements.txt` changes):\n\n* From `housing-backend`, run `source backend/bin/env.sh` to setup your environment\n* From `housing-backend/backend`, run `docker-compose -f local-docker-compose.yml up --build`\n\n### Container access examples:\n\nRun manage.py command directly:\n\n* From `housing-backend`, run `source backend/bin/env.sh` to setup your environment\n* From `housing-backend/backend`, run `docker-compose -f local-docker-compose.yml exec housing-service ./manage.py \u003ccommand\u003e`\n\nRun the Python shell:\n\n* From `housing-backend`, run `source backend/bin/env.sh` to setup your environment\n* From `housing-backend/backend`, run `docker-compose -f local-docker-compose.yml exec housing-service ./manage.py shell`\n\nMake migrations:\n\n* From `housing-backend`, run `source backend/bin/env.sh` to setup your environment\n* From `housing-backend/backend`, run `docker-compose -f local-docker-compose.yml exec housing-service ./manage.py makemigrations housing_backend`\n\n## Running test automation:\n\n* From `housing-backend`, run `source backend/bin/env.sh` to setup your environment\n* From `housing-backend`, run `backend/bin/test-proj.sh -l`\n\n## Contributing\n\nAll Hack Oregon projects are open source, built entirely by volunteers from our local community. Visit [Hack Oregon - Build With Us](http://www.hackoregon.org/join/) to learn more!\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your/project/tags).\n\n## Core Team\n\n* **Adrienne Tilley** - *Design Lead*\n* **Bimal Rajbhandary** - *Domain Expert / Strategic Development*\n* **David Daniel** - *Tech Lead*\n* **Derek Demaria** - *Front-end Lead*\n* **Gabriele Hayden** - *Facilitator / Strategic Development*\n* **Victoria James** - *Domain Expert / Strategic Development*\n* **Warren Friedland** - *Tech Lead*\n* **Kartik Nagappa** - *Design Lead*\n* **Riley Rustad** - *Tech Lead*\n* **Esme Miller** - *Research Lead*\n\nSee also the list of [contributors](https://github.com/hackoregon/housing-backend/contributors) who participated in this project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Fhousing-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackoregon%2Fhousing-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Fhousing-backend/lists"}