Skip to content

NPM package that implements forms generated by the pydantic forms module

Notifications You must be signed in to change notification settings

workfloworchestrator/pydantic-forms-ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pydantic forms example

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.

Installation

This example application creates as FastApi application to serve as a backend for a react frontend.

backend

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

frontend

$ cd frontend
$ npm i
$ npm run dev

Visit http://127.0.0.1:3000 to view the generated form

Contributing

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

Publishing to npm

This repository is also used to publish the pydantic forms ui package to NPM. <TODO: Publish instructions>

About

NPM package that implements forms generated by the pydantic forms module

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •