gitmyhub

FastUI

Python ★ 9.0k updated 2mo ago ▣ archived

Build better UIs faster.

A Python library that lets backend developers build complete web user interfaces by returning Python objects from API endpoints, no JavaScript or React knowledge needed. Currently inactive.

PythonPydanticFastAPIReactTypeScriptBootstrapsetup: easycomplexity 3/5

FastUI is a Python library that lets backend developers build web user interfaces entirely in Python, without writing any JavaScript or working with front-end tooling. The README notes that the project is currently inactive.

The core idea is that a Python developer describes what the page should look like by returning structured Python objects from their API endpoints. Those objects are validated by Pydantic, a popular Python data validation library, and then sent to the browser where a pre-built React application reads them and renders the actual interface. The developer never touches the React code directly; they just return lists of components from their Python functions.

For example, to show a table of users you write a normal Python function that returns a list of component objects describing a heading and a table, and the system figures out the HTML from there. Clicking a row can be wired up to navigate to another page by setting an event on the component, again in pure Python. A complete working web application, with pages that link to each other, can be written in a single Python file.

The project ships four pieces. The Python package defines all the component types and works with FastAPI or most other Python web frameworks. A JavaScript package lets front-end developers build their own component sets using the same underlying type system. A second JavaScript package provides implementations of all standard components styled with Bootstrap. A fourth package is a pre-built version of the React app served from a content delivery network, so Python developers do not need to install any JavaScript tools at all; one HTML page reference is all that is required to get the front end running.

The design philosophy draws on the original academic definition of REST, where the server controls the structure of the interface and the client is a general-purpose renderer. The practical benefits described in the README are that new features only need code written in one place, the front end and back end can be deployed independently, and Pydantic plus TypeScript type checking help catch mistakes where the two sides send data in incompatible shapes.

Where it fits