百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
P

python-ts-graphql-demo

> 前端框架
开源

演示SQLAlchemy和草莓的Asyncio Python项目如何通过代码和TypeScriptZ Re在前端有一个很好的DX类型

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

演示SQLAlchemy和草莓的Asyncio Python项目如何通过代码和TypeScriptZ Re在前端有一个很好的DX类型

Modern Python Web Stack

SQLAlchemy now has an asyncio extension. Strawberry is a new-ish GraphQL library based on Python dataclasses that makes full use of type hints and mypy extensions. Codegen can generate typed React hooks in TypeScript. This template or reference project shows how all these pieces can be put together for an awesome typed developer experience.

This is a mini version of the Inch tech stack. The schema is monitored by codegen that creates urql TypeScript hooks. The goal was to have strong data consistency between the backend and frontend. Another benefit is a great VS Code environment that highlights any potential errors when communicating with the backend.

Getting started

Install Python and NPM packages

bash
poetry install
npm i

Drop and recreate all database tables

bash
poetry run python models.py

Run the Python GraphQL backend on port :8000 - Next.js will reverse proxy /graphql to here

bash
poetry run uvicorn app:app --reload --host '::'

Start the GraphQL server

bash
npm run codegen --watch

Run the frontend

bash
npm run dev

VS Code

Inside .vscode/settings.json you'll see how to have nice VS Code mypy errors, import sorting and code formatting. Pylance does not yet deal well with declarative type hinted SQLAlchemy models. However there are pretty good SQLA type stubs and a mypy plugin. That's why in the settings you'll see python.analysis.typeCheckingMode switched off and mypy enabled instead.

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcodegengraphqlhooksnextjs

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架