Full Stack FastAPI + NextJS JWT Authentication Tutorial
GitHub Repos:
- https://github.com/fullstackbook/fullstackbook-jwt-fastapi
- https://github.com/fullstackbook/fullstackbook-jwt-nextjs
Description
Learn how to secure an application with FastAPI and NextJS.
Topics:
- FastAPI
- Dependencies
- Alembic
- PostgreSQL
- JWT Authentication
- Role based authorization
- NextJS
Terminal
pip install fastapi "uvicorn[standard]" alembic pyscopg2 "python-jose[cryptography]" "passlib[bcrypt]" python-multipart
pip freeze > requirements.txt
alembic init alembic
alembic revision -m "create users table"
alembic revision -m "create roles table"
alembic revision -m "create users_to_roles table"
alembic upgrade head
uvicorn main:app --reload