{"id":31925044,"url":"https://github.com/activist-org/ts-backend-check","last_synced_at":"2026-04-25T15:00:33.392Z","repository":{"id":296080941,"uuid":"909174489","full_name":"activist-org/ts-backend-check","owner":"activist-org","description":"Check TypeScript interfaces against backend models","archived":false,"fork":false,"pushed_at":"2026-04-23T20:00:27.000Z","size":674,"stargazers_count":1,"open_issues_count":5,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-23T21:29:38.636Z","etag":null,"topics":["backend","cd","check","checker","ci","cicd","continuous-integration","hacktoberfest","python","ts","typescript","validation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/activist-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2024-12-27T23:41:16.000Z","updated_at":"2026-04-23T20:00:38.000Z","dependencies_parsed_at":"2026-02-05T17:00:43.504Z","dependency_job_id":null,"html_url":"https://github.com/activist-org/ts-backend-check","commit_stats":null,"previous_names":["activist-org/tsbe-check","activist-org/ts-backend-check"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/activist-org/ts-backend-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activist-org%2Fts-backend-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activist-org%2Fts-backend-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activist-org%2Fts-backend-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activist-org%2Fts-backend-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activist-org","download_url":"https://codeload.github.com/activist-org/ts-backend-check/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activist-org%2Fts-backend-check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32265977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: 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":["backend","cd","check","checker","ci","cicd","continuous-integration","hacktoberfest","python","ts","typescript","validation"],"created_at":"2025-10-14T00:26:42.430Z","updated_at":"2026-04-25T15:00:33.383Z","avatar_url":"https://github.com/activist-org.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/activist-org/ts-backend-check\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/activist-org/ts-backend-check/main/.github/resources/TSBackendCheckGitHubBanner.png\" width=1024 alt=\"TS Backend Check logo\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n[![rtd](https://img.shields.io/readthedocs/ts-backend-check.svg?label=%20\u0026logo=read-the-docs\u0026logoColor=ffffff)](http://ts-backend-check.readthedocs.io/en/latest/)\n[![ci_static_analysis](https://img.shields.io/github/actions/workflow/status/activist-org/ts-backend-check/ci_static_analysis.yaml?branch=main\u0026label=%20\u0026logo=ruff\u0026logoColor=ffffff)](https://github.com/activist-org/ts-backend-check/actions/workflows/ci_static_analysis.yaml)\n[![ci_pytest](https://img.shields.io/github/actions/workflow/status/activist-org/ts-backend-check/ci_pytest.yaml?branch=main\u0026label=%20\u0026logo=pytest\u0026logoColor=ffffff)](https://github.com/activist-org/ts-backend-check/actions/workflows/ci_pytest.yaml)\n[![issues](https://img.shields.io/github/issues/activist-org/ts-backend-check?label=%20\u0026logo=github)](https://github.com/activist-org/ts-backend-check/issues)\n[![python](https://img.shields.io/badge/Python-4B8BBE.svg?logo=python\u0026logoColor=ffffff)](https://github.com/activist-org/ts-backend-check/blob/main/CONTRIBUTING.md)\n[![pypi](https://img.shields.io/pypi/v/ts-backend-check.svg?label=%20\u0026color=4B8BBE)](https://pypi.org/project/ts-backend-check/)\n[![pypistatus](https://img.shields.io/pypi/status/ts-backend-check.svg?label=%20)](https://pypi.org/project/ts-backend-check/)\n[![license](https://img.shields.io/github/license/activist-org/ts-backend-check.svg?label=%20)](https://github.com/activist-org/ts-backend-check/blob/main/LICENSE.txt)\n[![coc](https://img.shields.io/badge/Contributor%20Covenant-ff69b4.svg)](https://github.com/activist-org/ts-backend-check/blob/main/.github/CODE_OF_CONDUCT.md)\n[![matrix](https://img.shields.io/badge/Matrix-000000.svg?logo=matrix\u0026logoColor=ffffff)](https://matrix.to/#/#activist_community:matrix.org)\n\n# Contents\n\n- [About ts-backend-check](#about-ts-backend-check)\n- [Installation](#installation)\n  - [Users](#users)\n  - [Development Build](#development-build)\n- [How It Works](#how-it-works)\n  - [Commands](#commands)\n  - [Example Outputs](#example-outputs)\n- [Configuration](#configuration)\n  - [YAML File](#yaml-file)\n  - [pre-commit](#pre-commit)\n  - [GitHub Action](#github-action)\n- [Contributing](#contributing)\n  - [Contact the Team](#contact-the-team)\n  - [Contributors](#contributors)\n\n# About ts-backend-check\n\n\u003e [!IMPORTANT]\n\u003e Before you contribute, read the [contributing guide](CONTRIBUTING.md).\n\n`ts-backend-check` (`tsbc`) is a Python package for checking TypeScript types against their corresponding backend models to assure that all fields have been accounted for.\n\nDeveloped by the [activist community](https://github.com/activist-org), this package helps keep frontend and backend development teams in sync.\n\nThe package supports Django-based backends.\n\n# Installation\n\n## Users\n\nYou can install `ts-backend-check` using [uv](https://docs.astral.sh/uv/) (recommended) or [pip](https://pypi.org/project/ts-backend-check/).\n\n### uv\n\n(Recommended - fast, Rust-based installer)\n\n```bash\nuv pip install ts-backend-check\n```\n\n### pip\n\n```bash\npip install ts-backend-check\n```\n\n## Development Build\n\nYou can install the latest development build using uv, pip, or by cloning the repository.\n\n### Clone the Repository (Development Build)\n\n```bash\ngit clone https://github.com/activist-org/ts-backend-check.git  # or ideally your fork\ncd ts-backend-check\n```\n\n### uv (Development Build)\n\n```bash\nuv sync --all-extras  # install all dependencies\nsource .venv/bin/activate  # activate venv (macOS/Linux)\n# .venv\\Scripts\\activate  # activate venv (Windows)\n```\n\n### pip (Development Build)\n\n```bash\npython -m venv .venv  # create virtual environment\nsource .venv/bin/activate  # activate venv (macOS/Linux)\n# .venv\\Scripts\\activate  # activate venv (Windows)\npip install -e .\n```\n\n\u003csub\u003e\u003ca href=\"#top\"\u003eBack to top.\u003c/a\u003e\u003c/sub\u003e\n\n# How It Works\n\n## Commands\n\nThese are some example commands:\n\n**Show Help and Available Commands**\n\n```bash\n# You can use either ts-backend-check or tsbc to access the CLI.\n# ts-backend-check --help\ntsbc --help\n```\n\n**Generate a Configuration File**\n\n```bash\n# ts-backend-check --generate-config-file\ntsbc -gcf\n```\n\n**Generate the Test Project**\n\n```bash\n# ts-backend-check includes a test project for testing the functionalities.\n# ts-backend-check --generate-test-project\ntsbc -gtp\n```\n\n**Check a TypeScript Interface Against a Backend Model**\n\n```bash\n# ts-backend-check --identifier \u003cmodel-interface-identifier-from-config-file\u003e\ntsbc -i \u003cmodel-interface-identifier-from-config-file\u003e\n```\n\n**Check All Models and Interfaces**\n\n```bash\n# ts-backend-check --all\ntsbc -a\n```\n\n## Example Outputs\n\nThese are some example outputs for passed and failed checks.\n\n### Passed Check\n\n```\nts-backend-check -i valid_model\n✅ Success: All backend models are synced with their corresponding TypeScript interfaces for the provided 'valid_model' files.\n```\n\n### Failed Check\n\n```\nts-backend-check -i invalid_model\n\n❌ ts-backend-check error: There are inconsistencies between the provided 'invalid_model' backend models and TypeScript interfaces. Please see the output below for\ndetails.\n\nField 'description' (camelCase: 'description') from model 'EventModel' is missing in the TypeScript interfaces.\nExpected to find this field in the frontend interfaces: Event, EventExtended\nTo ignore this field, add the following comment to the TypeScript file (in order based on the model fields): '// ts-backend-check: ignore description'\n\nField 'participants' (camelCase: 'participants') from model 'EventModel' doesn't match the TypeScript interfaces based on blank to optional agreement.\nPlease check 'src/ts_backend_check/test_project/backend/models.py' and the corresponding files in 'ts_interface_paths' to make sure that all 'blank=True' fields are optional (?) in the TypeScript interfaces file.\n\nNo matching TypeScript interface found for the model 'UserModel'.\nPlease name your TypeScript interfaces the same as the corresponding backend models.\nYou can also use the 'backend_to_ts_model_name_conversions' option within the configuration file.\nThe key is the backend model name and the value is a list of the corresponding interfaces.\nThis option is also how you can break larger backend models into multiple interfaces that extend one another.\n\nPlease fix the 3 errors above to continue the sync of the backend models of src/ts_backend_check/test_project/backend/models.py and the corresponding TypeScript interfaces.\n```\n\n\u003csub\u003e\u003ca href=\"#top\"\u003eBack to top.\u003c/a\u003e\u003c/sub\u003e\n\n# Configuration\n\n## YAML File\n\nYou can configure `ts-backend-check` using the `.ts-backend.check.yaml` (or `.yml`) configuration file.\n\nFor an example, see the [configuration file for this repository](/.ts-backend-check.yaml) that we use in testing.\n\nThis example describes the structure of an entry in this file:\n\n```yaml\nmodel_identifier: # an identifier you define that you want to pass to the CLI\n  backend_model_path: path/to/a/models.py\n  ts_interface_paths:\n    - path/to/the/corresponding/model_interfaces.ts\n    - path/to/another/corresponding/model_interfaces.ts\n  check_blank_model_fields: true # whether to assert that fields that can be blank must also be optional\n  backend_to_ts_model_name_conversions: # used if the frontend name is not the backend name\n    BackendModel:\n      - Interface\n      - InterfaceExtended\n```\n\n## pre-commit\n\nThis is an exaple of a [prek](https://prek.j178.dev/) or [pre-commit](https://github.com/pre-commit/pre-commit) hook:\n\n```yaml\n- repo: local\n  hooks:\n    - id: run-ts-backend-check\n      name: run ts-backend-check key-value checks\n      files: ^src-dir/\n      entry: ts-backend-check -a\n      language: python\n      pass_filenames: false\n      additional_dependencies:\n        - ts-backend-check\n```\n\n## GitHub Action\n\nThis is an example YAML file for a GitHub Action to check your backend models and TypeScript interface files on pull requests and commits:\n\n```yaml\nname: ci_ts_backend_check\non:\n  workflow_dispatch:\n  pull_request:\n    branches:\n      - main\n    types:\n      - opened\n      - reopened\n      - synchronize\n  push:\n    branches:\n      - main\n\njobs:\n  ts_backend_check:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Project\n        uses: actions/checkout@v6\n\n      - name: Setup Python\n        uses: actions/setup-python@v6\n        with:\n          python-version: \"3.12\"\n\n      - name: Install uv\n        uses: astral-sh/setup-uv@v7\n\n      - name: Install Dependencies\n        run: uv sync --frozen --all-extras\n\n      - name: Execute All ts-backend-check Key-Value Checks\n        run: |\n          uv run ts-backend-check -a\n```\n\n\u003csub\u003e\u003ca href=\"#top\"\u003eBack to top.\u003c/a\u003e\u003c/sub\u003e\n\n# Contributing\n\nSee the [contribution guidelines](CONTRIBUTING.md) before contributing. You can help by:\n\n- 🐞 Reporting bugs.\n- ✨ Working with us on new features.\n- 📝 Improving the documentation.\n\nWe track work that is in progress or may be implemented in the the [issues](https://github.com/activist-org/ts-backend-check/issues) and [projects](https://github.com/activist-org/ts-backend-check/projects).\n\n## Contact the Team\n\n\u003ca href=\"https://matrix.to/#/#activist_community:matrix.org\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/activist-org/Organization/main/resources/images/logos/MatrixLogoGrey.png\" width=\"175\" alt=\"Public Matrix Chat\" align=\"right\"\u003e\u003c/a\u003e\n\nactivist uses [Matrix](https://matrix.org/) for team communication. [Join us in our public chat rooms](https://matrix.to/#/#activist_community:matrix.org) to share ideas, ask questions or just say hi to the team.\n\nWe recommend using the [Element](https://element.io/) client and [Element X](https://element.io/app) for a mobile app.\n\n## Contributors\n\nThanks to all our amazing [contributors](https://github.com/activist-org/ts-backend-check/graphs/contributors)! ❤️\n\n\u003ca href=\"https://github.com/activist-org/ts-backend-check/graphs/contributors\"\u003e\n  \u003cimg src=\"https://contrib.rocks/image?repo=activist-org/ts-backend-check\" /\u003e\n\u003c/a\u003e\n\n\u003csub\u003e\u003ca href=\"#top\"\u003eBack to top.\u003c/a\u003e\u003c/sub\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivist-org%2Fts-backend-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivist-org%2Fts-backend-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivist-org%2Fts-backend-check/lists"}