Adapted from Michael Herman's article Developing a Single Page App with FastAPI and Vue.js last updated December 14th, 2022, with github repo https://github.com/testdrivenio/fastapi-vue.
Pay particular attention to the graphical OpenAPI interface, which is auto-generated by FastAPI!
I simply added validation rules, and a confirm password field, to the existing registration page.
Here's a snapshot:
)
Make sure Docker is running locally.
Then use the images and spin up the containers:
$ docker-compose up -d --build
Apply the database migration for Tortoise ORM on PostgreSQL using aerich:
$ docker-compose exec backend aerich upgrade
Open browser to http://localhost:5000 to verify that FastAPI service is running
This should show "FastAPI service is running"
Go to the OpenAPI interface at http://localhost:5000/docs
This will show the FastAPI-generated OpenAPI interface, first the requests
and then the schemas.
Finally, go to the homepage http://localhost:8080 to register or login