{"id":14007004,"url":"https://github.com/jokull/python-ts-graphql-demo","last_synced_at":"2025-04-27T06:52:09.623Z","repository":{"id":38350317,"uuid":"424419429","full_name":"jokull/python-ts-graphql-demo","owner":"jokull","description":"Demo project to demonstrate how an asyncio Python project with SQLAlchemy and Strawberry can have a great typed DX on the frontend via codegen and TypeScript React hooks.","archived":false,"fork":false,"pushed_at":"2021-12-04T13:04:42.000Z","size":493,"stargazers_count":95,"open_issues_count":3,"forks_count":12,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-27T06:52:03.710Z","etag":null,"topics":["codegen","graphql","hooks","nextjs","nextjs-starter","nextjs-template","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jokull.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":"2021-11-04T00:13:16.000Z","updated_at":"2025-03-21T00:15:30.000Z","dependencies_parsed_at":"2022-08-25T04:50:41.290Z","dependency_job_id":null,"html_url":"https://github.com/jokull/python-ts-graphql-demo","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/jokull%2Fpython-ts-graphql-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jokull%2Fpython-ts-graphql-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jokull%2Fpython-ts-graphql-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jokull%2Fpython-ts-graphql-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jokull","download_url":"https://codeload.github.com/jokull/python-ts-graphql-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251099735,"owners_count":21536153,"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":["codegen","graphql","hooks","nextjs","nextjs-starter","nextjs-template","react","typescript"],"created_at":"2024-08-10T10:01:45.714Z","updated_at":"2025-04-27T06:52:09.599Z","avatar_url":"https://github.com/jokull.png","language":"TypeScript","readme":"# Modern Python Web Stack\n\n![image](https://user-images.githubusercontent.com/701/141482559-1992d50a-07f1-42e6-b0f6-bc0bb65ccc9e.png)\n\nSQLAlchemy now has an asyncio extension. Strawberry is a new-ish GraphQL library based on Python\ndataclasses that makes full use of type hints and mypy extensions. Codegen can generate typed React\nhooks in TypeScript. This template or reference project shows how all these pieces can be put\ntogether for an awesome typed developer experience.\n\nThis is a mini version of the [Inch](https://tryinch.com) tech stack. The schema is monitored by\n[codegen](https://www.graphql-code-generator.com) that creates\n[urql](https://github.com/FormidableLabs/urql) TypeScript hooks. The goal was to have strong data\nconsistency between the backend and frontend. Another benefit is a great VS Code environment that\nhighlights any potential errors when communicating with the backend.\n\n![](https://user-images.githubusercontent.com/701/140308942-264f40fa-f6ac-43cf-88f0-b6c4bfdfe105.mp4)\n\n## Getting started\n\nInstall Python and NPM packages\n\n```bash\npoetry install\nnpm i\n```\n\nDrop and recreate all database tables\n\n```bash\npoetry run python models.py\n```\n\nRun the Python GraphQL backend on port :8000 - Next.js will reverse proxy `/graphql` to here\n\n```bash\npoetry run uvicorn app:app --reload --host '::'\n```\n\nStart the GraphQL server\n\n```bash\nnpm run codegen --watch\n```\n\nRun the frontend\n\n```bash\nnpm run dev\n```\n\n## VS Code\n\nInside `.vscode/settings.json` you'll see how to have nice VS Code mypy errors, import sorting and\ncode formatting. Pylance does not yet deal well with declarative type hinted SQLAlchemy models.\nHowever there are pretty good SQLA type stubs and a mypy plugin. That's why in the settings you'll\nsee `python.analysis.typeCheckingMode` switched off and mypy enabled instead.\n","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjokull%2Fpython-ts-graphql-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjokull%2Fpython-ts-graphql-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjokull%2Fpython-ts-graphql-demo/lists"}