Micro Free Course — 100% Free Learning

All lessons in this module are free to learn. Sign in with Google to save your progress.

1

Data Layer and Auth

SQLAlchemy 2.0 ORM (modern Mapped style); Alembic migrations; Pydantic vs SQLAlchemy models (separation); JWT authentication and OAuth2; role-based authorization patterns.

Module Progress0% Complete
110 min total
10 Lessons
0 Completed

Module Content

SQLAlchemy 2.0 ORM

The modern SQLAlchemy: typed Mapped columns, declarative style, async support. The standard Python ORM. FIND_VIDEO: search 'sqlalchemy 2.0 tutorial mapped' — recommended channel: ArjanCodes / Mike Bayer talks. Aim for 11 min or under.

11 minVideo
Start

Recap — Mapped Columns, Sessions, Query Patterns

SQLAlchemy 2.0's modern style: Mapped types, sessions, select() syntax, common query patterns.

11 minTutorial
Start

Database Migrations with Alembic

Schema changes as code. Alembic generates migration scripts; running them migrates production safely. FIND_VIDEO: search 'alembic database migrations fastapi tutorial' — recommended channel: ArjanCodes / Pretty Printed. Aim for 10 min or under.

10 minVideo
Start

Recap — Manual vs Autogenerate, Migration Patterns

When to autogenerate, when to write by hand, and the patterns for safe schema changes in production.

10 minTutorial
Start

Pydantic vs SQLAlchemy Models

Why your DB models and your API models should be different types — and how to convert cleanly. FIND_VIDEO: search 'pydantic sqlalchemy separation api models' — recommended channel: ArjanCodes. Aim for 9 min or under.

9 minVideo
Start

Recap — Separation of Concerns and Response Shaping

The 'one model per layer' pattern, ORM-to-Pydantic conversion, and avoiding data leaks.

10 minTutorial
Start

Authentication — JWT & OAuth2

The standard auth pattern: hash passwords, issue JWTs, OAuth2 flow. The auth layer of any modern API. FIND_VIDEO: search 'fastapi jwt authentication oauth2 tutorial' — recommended channel: ArjanCodes / Tech with Tim. Aim for 11 min or under.

11 minVideo
Start

Recap — Token-Based Auth Flow

The end-to-end JWT auth: signup, login, hash passwords with bcrypt, issue tokens, validate via dependency.

11 minTutorial
Start

Authorization — Roles & Permissions

Authentication says who; authorization says what. Roles, permissions, scopes, and the dependency patterns. FIND_VIDEO: search 'fastapi role based access control RBAC' — recommended channel: ArjanCodes. Aim for 10 min or under.

10 minVideo
Start

Recap — RBAC Patterns and Scopes

Role-based and permission-based access control in FastAPI, OAuth2 scopes, and the practical patterns for production.

10 minTutorial
Start
Data Layer and Auth | Backend Development with FastAPI | Topfolio