Metadata-Version: 2.4
Name: bazis-front
Version: 0.1.0
Summary: Frontend layer of Bazis: the contract, the specs and the TypeScript code copied into the frontend of a product.
Author-email: Ilya Kharyn <ilya.tt07@gmail.com>
Maintainer-email: Ilya Kharyn <ilya.tt07@gmail.com>
License-Expression: Apache-2.0
Project-URL: Home, https://github.com/ecofuture-tech/bazis-front
Keywords: bazis,django,fastapi,pydantic,framework,jsonapi,frontend,typescript,react
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Framework :: Django
Classifier: Framework :: FastAPI
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
Requires-Dist: bazis>=2.16.0
Requires-Dist: PyYAML>=6.0.1
Requires-Dist: jsonschema>=4.18
Provides-Extra: test
Requires-Dist: bazis-test-utils>=2.5.2; extra == "test"
Requires-Dist: bazis-users>=2.9.0; extra == "test"
Requires-Dist: bazis-authing>=2.7.0; extra == "test"
Requires-Dist: bazis-permit>=2.11.0; extra == "test"
Requires-Dist: bazis-statusy>=2.12.0; extra == "test"
Requires-Dist: bazis-uploadable>=2.7.0; extra == "test"
Requires-Dist: bazis-ws>=2.7.0; extra == "test"
Requires-Dist: bazis-notify>=0.1.0; extra == "test"
Requires-Dist: bazis-author>=2.5.0; extra == "test"
Requires-Dist: bazis-bg>=2.6.0; extra == "test"
Requires-Dist: bazis-async-background>=2.5.0; extra == "test"
Requires-Dist: bazis-async-request>=2.5.0; extra == "test"
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Dynamic: license-file

# bazis-front

The frontend layer of [Bazis](https://github.com/ecofuture-tech/bazis), the JSON:API
framework on Django + FastAPI + Pydantic. A product built on Bazis gets a React +
TypeScript + Vite frontend whose contract is generated from its own backend and whose
protocol code is copied from this package.

**Status: first release (0.1.0).** The API may change in the minor versions.

bazis-front is a Python package (`pip install bazis-front`, module `bazis.contrib.front`),
released together with the other Bazis packages. It has no npm packages: its TypeScript
code is shipped as package data and copied into the frontend of a product, which owns the
copy and gets fixes through new versions of the package.

| Part | What it is | State |
|---|---|---|
| [`assets/client`](bazis/contrib/front/assets/client) | The JSON:API protocol of Bazis in TypeScript, typed by the OpenAPI types generated from a product | available |
| [`assets/react`](bazis/contrib/front/assets/react) | React hooks over the client and TanStack Query: lists, items, runtime schemas, mutations, forms bound to the runtime schema, the transits of bazis-statusy, the uploads of bazis-uploadable, the socket of bazis-ws, the tasks of bazis-bg, the background requests of bazis-async-request | available |
| [`assets/template`](bazis/contrib/front/assets/template) | The frontend of a product: React, TypeScript, Vite, TanStack Query, Tailwind with shadcn/ui | available |
| `manage.py bazis_front init` | Creates the frontend of a product from the template, with copies of the client and the hooks and a lock, and the starters of its specs | available |
| `manage.py bazis_front contract` | Exports the contract of a product (`contract/openapi.json`, `contract/contract.json`), generates its TypeScript in the frontend and checks that both are up to date | available |
| `manage.py bazis_front check` | Validates the specs of a product (`spec/`: product, screens, design) against their JSON Schemas, each other and the contract | available |
| [`assets/ui`](bazis/contrib/front/assets/ui) | Components on shadcn/ui and Tailwind 4 over the hooks: layout, states, list, card, form, login (with the logins of bazis-authing), the status and the transits of bazis-statusy, the file field of bazis-uploadable, the notifications and the live queries of bazis-ws, the progress of a task of bazis-bg, the result of a background request, each with its contract test | available |
| `manage.py bazis_front add` | Copies components into the frontend of a product, with the assets they require | available |
| [`assets/playwright`](bazis/contrib/front/assets/playwright) | Playwright helpers that run the steps of the scenarios through the `data-bz` marks of the screens | available |
| `manage.py bazis_front e2e` | Generates a Playwright test per scenario of the specs and checks that they are up to date | available |
| `manage.py bazis_front update` | Brings the copied assets to a new version of the package, merging them with the changes of the product | available |

The layers and the principles are described in [docs/architecture.md](docs/architecture.md).
AI agents building a product read
[bazis/contrib/front/AGENTS.md](bazis/contrib/front/AGENTS.md).

## License

Apache License 2.0, see [LICENSE](LICENSE). The components of shadcn/ui in
`bazis/contrib/front/assets/ui/shadcn/` are under the MIT License of shadcn/ui, whose notice
is in their headers.
