APIs and Backend Development with Python | Nesqual TechCourse outline
From web pages to JSON APIs
- What a web API is, and who calls itLesson30 min
- JSON as the wire formatLesson30 min
- HTTP from the API's sideLesson30 min
- Calling an API properly from PythonLesson35 min
- Meeting the Brightwater toolkitLesson35 min
- How APIs are documented and consumed at workLesson30 min
- Chapter quiz: from web pages to JSON APIsQuiz15 min
Inside a small API framework
Why build on a tiny toolkit
Lesson25 min
Reading web.py: requests, responses and errorsLesson30 minThe router: from a path to a handlerLesson30 minMiddleware: code around every requestLesson30 minThe app factory, run.py and call()Lesson30 minThe same endpoints in Flask, FastAPI and Django REST frameworkLesson30 minQuiz: inside a small API frameworkQuiz15 minResources, methods and persistence
- Designing resources and URLsLesson30 min
- Representations: from a row to JSONLesson30 min
- sqlite3 behind an APILesson35 min
- CRUD mapped to HTTP methodsLesson35 min
- Status codes as design decisionsLesson35 min
- Thin handlers and a data layerLesson30 min
- Chapter quiz: resources, methods and persistenceQuiz15 min
- Lab: the Brightwater books resource with SQLiteLab40 min
Validation and error responses
- Why validate at the boundaryLesson30 min
- Writing a validator with rules as dataLesson35 min
- Problem details: one shape for every errorLesson30 min
- Type traps in JSON inputLesson30 min
- Errors that help and do not leakLesson30 min
- Validation in frameworksLesson25 min
- Quiz: validation and error responsesQuiz15 min
Collections: pagination, filtering and sorting
- Why every collection needs a limitLesson30 min
- Offset pagination: familiar, simple and fragileLesson30 min
- Cursor pagination: remember the last row, not the positionLesson35 min
- Filtering: from query parameters to a safe WHERE clauseLesson35 min
- Sorting with an allow-list, and cursors that follow the sortLesson35 min
- Fast collections: indexes, query plans and the N+1 problemLesson30 min
- Quiz: collections, pagination, filtering and sortingQuiz15 min
- Lab: page, filter and sort the Brightwater catalogueLab40 min
API contracts, OpenAPI and versioning
- Why an API needs a written contractLesson30 min
- The anatomy of an OpenAPI 3.1 documentLesson35 min
- Describing data with JSON Schema 2020-12Lesson35 min
- Generating the OpenAPI document from the routerLesson35 min
- Checking the service against its contractLesson35 min
- Versioning and evolving an API without breaking clientsLesson35 min
- Quiz: API contracts, OpenAPI and versioningQuiz15 min
Authentication and authorisation
- Who is calling? Identity, authentication and authorisationLesson30 min
- API keys for service clientsLesson30 min
- Passwords and the login endpointLesson30 min
- Signed tokensLesson35 min
- Authorisation: roles, owners and propertiesLesson35 min
- Hygiene for API builders: TLS, CORS, secrets and logsLesson30 min
- Chapter quiz: authentication and authorisationQuiz15 min
- Lab: lock down the Brightwater APILab40 min
Idempotency, concurrency and consistency
- Failure is normal: timeouts, retries and idempotenceLesson30 min
- Idempotency keys for POSTLesson35 min
- Lost updates, ETags and conditional requestsLesson35 min
- Race conditions in the databaseLesson35 min
- Building the loans resourceLesson35 min
- Consistency beyond one databaseLesson30 min
- Quiz: idempotency, concurrency and consistencyQuiz15 min
- Lab: loans that survive retries and racesLab40 min
Testing APIs with unittest
- What to test in an API, and at which levelLesson35 min
- unittest for APIs: cases, helpers and tables of inputsLesson35 min
- Controlling time, randomness and the environmentLesson35 min
- Loopback tests through a real socketLesson30 min
- Unhappy paths, concurrency and regression testsLesson35 min
- Running, organising and judging a test suiteLesson30 min
- Chapter quiz: testing APIsQuiz15 min
- Lab: test the library service and catch three bugsLab40 min
Logging, metrics and observability
- Why observabilityLesson30 min
- Structured logging with the logging moduleLesson35 min
- Request ids, context and tracingLesson35 min
- Metrics, histograms and the /metrics endpointLesson35 min
- Health and readiness checksLesson30 min
- Debugging with telemetryLesson35 min
- Logging, metrics and observability quizQuiz15 min
Background work, webhooks and rate limiting
- Keeping requests fast with 202 AcceptedLesson30 min
- A job queue in SQLiteLesson35 min
- Failure, retries and idempotent jobsLesson30 min
- Webhooks that receivers can trustLesson35 min
- Rate limiting with a token bucketLesson35 min
- Limits, timeouts and back-pressure in productionLesson25 min
- Chapter quiz: background work, webhooks and rate limitsQuiz15 min
- Lab: a job queue, signed webhooks and a rate limitLab40 min
Capstone: shipping the Brightwater Library API
- The finished service: requirements, shape and build orderLesson30 min
- Configuration and running the service for realLesson30 min
- A builder's security review against the OWASP API Top 10Lesson35 min
- Moving to a framework: what it takes over and what stays yoursLesson30 min
- One feature end to end: renewing a loanLesson35 min
- Where next: courses, frameworks and databasesLesson20 min
- Capstone quiz: shipping the Brightwater Library APIQuiz15 min
- Capstone lab: assemble and finish the Brightwater Library APILab40 min