What Is Software Engineering?#

Software engineering is the disciplined application of engineering principles to the design, development, testing, and maintenance of software systems. This learning track covers the foundational knowledge and practical techniques used to build production-quality web APIs with Python.

Web Fundamentals#

Modern software communicates over the web. The foundation is HTTP — the request-response protocol connecting clients and servers. Understanding HTTP methods (GET, POST, PUT, DELETE), status codes, REST architectural principles, and JSON data exchange is essential before building any web API.

OS Concepts: File Descriptors and Sockets#

At the operating system level, every I/O resource — files, network connections, pipes — is represented by a file descriptor (an integer handle managed by the OS). Sockets are file descriptors that represent network endpoints. Understanding how the OS assigns, shares, and monitors file descriptors is key to understanding how web servers handle thousands of concurrent connections efficiently.

Asynchronous Programming#

Python’s asyncio framework enables concurrent I/O without threads. An event loop runs in a single thread and schedules coroutines cooperatively: when a coroutine awaits an I/O operation, control returns to the loop, which runs other ready coroutines. This model is highly efficient for I/O-bound workloads like web servers.

Related concepts include threading, the Global Interpreter Lock (GIL), multiprocessing, and the difference between CPython’s C-implemented internals and pure-Python reference implementations.

FastAPI#

FastAPI is a high-performance Python web framework built on Starlette (an ASGI framework) and Pydantic (a data validation library). It provides:

  • Automatic request parsing and validation via type annotations

  • Auto-generated OpenAPI documentation

  • Dependency injection via Depends()

  • Full async support

FastAPI follows the ASGI specification — the modern, async successor to WSGI — allowing it to run on servers like Uvicorn.

Databases#

Production APIs persist data in relational databases. This track covers PostgreSQL with SQLAlchemy (both synchronous and async), Alembic for schema migrations, and patterns for structuring database sessions as FastAPI dependencies.

Authentication#

Securing APIs requires understanding several layers:

  • JWT (JSON Web Tokens): stateless, signed tokens encoding user claims

  • OAuth2: an authorization framework for delegating access, including the Password flow and Google OAuth integration

  • FastAPI security utilities: OAuth2PasswordBearer, OAuth2PasswordRequestForm, and the Depends() pattern for protecting routes

Testing#

Reliable software requires tests. This track covers unit testing FastAPI endpoints with TestClient and httpx.AsyncClient, mocking async database sessions via dependency overrides, and testing JWT authentication flows including expired and malformed tokens.

Architecture#

Software engineering is also about structure. Topics include:

  • ASGI application architecture and the Uvicorn → FastAPI request flow

  • CRUD application design with dependency injection

  • Greenlets and how SQLAlchemy’s async engine bridges sync and async code

  • Role-based access control (RBAC) patterns