{"id":13571356,"url":"https://github.com/codeforboston/police-data-trust","last_synced_at":"2026-04-07T11:31:55.589Z","repository":{"id":37839236,"uuid":"342570977","full_name":"codeforboston/police-data-trust","owner":"codeforboston","description":"A national archive of police data collected by journalists, lawyers, and activists around the country.","archived":false,"fork":false,"pushed_at":"2026-04-01T01:31:12.000Z","size":111511,"stargazers_count":59,"open_issues_count":25,"forks_count":102,"subscribers_count":17,"default_branch":"main","last_synced_at":"2026-04-01T02:50:16.963Z","etag":null,"topics":["accountability","open-government","police-misconduct","transparency"],"latest_commit_sha":null,"homepage":"https://www.nationalpolicedata.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeforboston.png","metadata":{"funding":{"custom":"https://www.codeforboston.org/donate/"},"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-26T12:35:31.000Z","updated_at":"2026-04-01T01:31:17.000Z","dependencies_parsed_at":"2022-07-18T23:47:07.532Z","dependency_job_id":"0a71d8f0-cda6-44b7-8dcb-23dc8c0db8a8","html_url":"https://github.com/codeforboston/police-data-trust","commit_stats":{"total_commits":1139,"total_committers":50,"mean_commits":22.78,"dds":0.781387181738367,"last_synced_commit":"63506a41674285f0020075607488bcb0fc3a8723"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/codeforboston/police-data-trust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforboston%2Fpolice-data-trust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforboston%2Fpolice-data-trust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforboston%2Fpolice-data-trust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforboston%2Fpolice-data-trust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeforboston","download_url":"https://codeload.github.com/codeforboston/police-data-trust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeforboston%2Fpolice-data-trust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31511585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["accountability","open-government","police-misconduct","transparency"],"created_at":"2024-08-01T14:01:01.319Z","updated_at":"2026-04-07T11:31:55.560Z","avatar_url":"https://github.com/codeforboston.png","language":"Python","funding_links":["https://www.codeforboston.org/donate/"],"categories":["Python"],"sub_categories":[],"readme":"# police-data-trust\n\nTo get started:\n\n1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) a copy of the main repo to your GitHub account.\n\n2. Clone your fork: `git clone git@github.com:YOUR_GITHUB_NAME/police-data-trust.git`\n\n3. Add the main repo to your remotes\n\n```\ncd police-data-trust\ngit remote add upstream https://github.com/codeforboston/police-data-trust.git\ngit fetch upstream\n```\n\nNow, whenever new code is merged you can pull in changes to your local repository:\n\n```\ngit checkout main\ngit pull upstream main\n```\n\n## Installation (Full Application)\n\nThis method uses Docker to run the complete application stack.\n\n1. Make sure that [Docker](https://www.docker.com) is installed on your machine.\n\n2. Create a `.env` file by running `cp .env.template .env` in the root of your local project folder, and change GRAPH_PASSWORD to a unique value.\n\n\u003e **Note**\n\u003e When running locally, you may need to update one of the ports in the `.env` file if it conflicts with another application on your machine.\n\n\u003e **Note**\n\u003e Windows users will need to run the following in PowerShell before proceeding:\n\u003e ```\n\u003e winget install dos2unix\n\u003e dos2unix run_dev.sh\n\u003e ```\n\n3. Build and run the project.\n\n```\ndocker compose build \u0026\u0026 docker compose up -d \u0026\u0026 docker compose logs -f\n```\n\n## Installation (Frontend Only)\n\nThis method runs the frontend natively on your computer and does not require a running backend, which can be convenient.\n\n1. Make sure that you have `node 16+` and either `npm 7+` or `yarn` installed.\n2. Follow the [install instructions](./frontend/README.md) in the `frontend` directory.\n\n## Testing with Docker\n\nAll code must pass the unit tests and style checks before it can be merged into the main branch. You can run the tests locally by opening up a comand line interface to a docker container while it's running the application:\n\n\n```\ndocker exec -it \"police-data-trust_api_1\" /bin/bash\n\n```\n\nYou'll need to replace `police-data-trust-api-1` with the name of the container you'd like tro connect to. You can see the names of all currently running containers by running `docker container ls`\n\n```bash\ndocker container ls\nCONTAINER ID   IMAGE                   COMMAND                  CREATED              STATUS              PORTS                    NAMES\nc0cf********   police-data-trust-api   \"/bin/sh -c '/wait \u0026…\"   About a minute ago   Up About a minute   0.0.0.0:5001-\u003e5001/tcp   police-data-trust-api-1\n5e6f********   postgres:17             \"docker-entrypoint.s…\"   3 days ago           Up About a minute   0.0.0.0:5432-\u003e5432/tcp   police-data-trust-db-1\ndacd********   police-data-trust-web   \"docker-entrypoint.s…\"   3 days ago           Up About a minute   0.0.0.0:3000-\u003e3000/tcp   police-data-trust-web-1\n```\n\n### Backend Tests\n\nThe current backend tests can be found in the GitHub Actions workflow file [python-tests.yml](https://github.com/codeforboston/police-data-trust/blob/0488d03c2ecc01ba774cf512b1ed2f476441948b/.github/workflows/python-tests.yml)\n\nTo run the tests locally, first start the application with docker compose. Then open up a command line interface to the running container:\n\n```\ndocker exec -it \"police-data-trust-api-1\" /bin/bash\n```\n\nThen run the tests:\n\n```\nflake8 backend/\npython -m pytest\n```\n\nFor more information on running the tests, see the [backend tests README](./backend/tests/README.md)\n\n### Front End Tests\n\nThe current frontend tests can be found in the GitHub Actions workflow file [frontend-checks.yml](https://github.com/codeforboston/police-data-trust/blob/0488d03c2ecc01ba774cf512b1ed2f476441948b/.github/workflows/frontend-checks.yml)\n\nTo run the tests locally, first start the application with docker compose. Then open up a command line interface to the running container:\n\n```\ndocker exec -it \"police-data-trust-web-1\" /bin/bash\n```\n\nThen run the tests:\n\n```\nnpm run lint\nnpm run check-formatting\nnpm run test\nnpm run check-types\n```\n\n# Documentation\n\n[Docs](https://codeforboston.github.io/police-data-trust)\n\n# Code Standards\n\n## Typescript Style Guide\n\nThis style guide is intended to act as a quick reference for the most common scenarios\n\n### Custom Types\n\nFor this codebase, we are using [interfaces](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#interfaces) instead of [type aliases](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-aliases).\n\n### Utilizing Types\n\n- We are aiming for a loose standard of explicitly typing as little as possible (relying on type inference or third-party library typing files to do the work whenever convenient), but as much as necessary (function params/args are a good example of what the compiler is bad at inferring). Erring on the side of 'stricter than absolutely necessary' definitely works for us!\n\n- The [`any`](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#any) type should never be utilized here. Prefer [union types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) in the case of values that are initially `null` (such as values that come from API calls), or [`unknown`](https://www.typescriptlang.org/docs/handbook/2/functions.html#unknown) in case of a type being truly impossible to discern ahead of time.\n\n- When typing primitive values declared with `const`, explicitly typing them will be necessary to prevent their type from being implied as the literal value of said primitive, rather than it's corresponding data type.\n\n## Functions\n\n- Always use explicit typing in the case of function params and return types.\n\n- If function parameters don't get modified by the function, strongly consider making them `readonly` to prevent mutation and have clearer code.\n\n## React\n\n- Prefer the `.tsx` file extension when JSX is involved, and `.ts` when it isn't.\n\n### Props\n\n- Refer to the [React/TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/basic_type_example) for examples of common propTypes.\n\n- In the case of components that accept other React components as props, prefer typing those as `React.ReactNode`.\n\n### Hooks\n\n- Prefer type inference for `useState` for simple cases. If the hook initializes with a nullish value, strongly consider a union type.\n\n- Since `useEffect` and `useLayoutEffect` don't return values, typing them is not necessary.\n\n- When typing `useRef`, refer to the React/TypeScript cheatsheet for guidance on [your specific situation](https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/hooks#useref).\n\n### Forms \u0026 Events\n\n- Type inference should be sufficient in the case of inline event handlers.\n\n- IDE tooling (such as VSCode autocomplete) will offer helpful suggestions for specific event handler types.\n\n- The React/TypeScript cheatsheet has a list of [specific event types](https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/forms_and_events#list-of-event-types).\n\n## Organization of props and attributes\n\nOrdering of components —\n\n- Class definitions\n- Component / imports\n- Event handlers inside class\n\nHTML Props/attributes order:\n\n- id, class, attributes\n- Like properties alphabetized (?)\n\nDirectory structure:\n\n- Pages: routable containers\n- Shared: components being used/planned to be used in multiple places\n- Compositions: components that have a single/limited specific context\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforboston%2Fpolice-data-trust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeforboston%2Fpolice-data-trust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeforboston%2Fpolice-data-trust/lists"}