This repository contains a working example of a FastAPI application with the pydantic forms frontend and backend modules working together. It shows how you can use the pydantic forms pypy module on top of pydantic models to automatically generate forms on the frontend using the pydantic forms npm module that ask for user input. It also show validation and processing of the user input.
This example application creates as FastApi application to serve as a backend for a react frontend.
To install using a virtual environment:
$ cd backend
$ python -m venv env
$ source env/bin/activate
$ pip install -r requirements.txt
$ fastapi dev main.py
Visit http://127.0.0.1:8000/docs to view the api documentation
$ cd frontend
$ npm i
$ npm run dev
Visit http://127.0.0.1:3000 to view the generated form
When setting up this repo to contribute initialize the pre-commit hooks using pre-commit (eq. brew install pre-commit
).
For installing prec
$ pre-commit install
This repository is also used to publish the pydantic forms ui package to NPM. <TODO: Publish instructions>