1-02-networking¶
python/ip-address/—my-public-ip.pyandmy-local-ip.py(literalinclude)scripts to discover one’s public and local IP addresses
1-03-layer4¶
a hands-on demo of raw TCP client/server communication
1-04-marshaling¶
python/tcp-awkward-api/(mentioned)illustrates the need for data encoding on top of raw TCP
1-05-http¶
python/httpbin-client/(mentioned)uses the
requestslibrary against httpbin.org to experiment with HTTP
1-06-epilogue¶
python/api-random/(mentioned)a simple API server that generates random numbers on demand
2-02-my-first-server¶
python/http-servers/server1_static.py(literalinclude)a minimal static-file HTTP server written with the stdlib
python/http-servers/— other files (mentioned)hand-written variants:
server2_static_byhand.py,server3_post_stateful.py,server4_template.py
2-05-security¶
a server that sets and reads cookies, to inspect in browser DevTools
python/raw-websockets/(mentioned)a raw “ping-pong” WebSocket demo (server + client in Python and JS)
3-02-fastapi-basics¶
python/random-generator/(mentioned)exercise: a FastAPI app with GET/POST endpoints for random numbers
python/random-generator/generator.py(mentioned)alternative seed endpoint using a Pydantic model
3-04-databases-1¶
python/db-single-table/(mentioned)complete CRUD example with a single
Usertable using SQLModel
3-04-databases-2¶
python/db-relationships/user_posts.py(mentioned)one-to-many example: one User has many Posts
python/db-relationships/students_courses.py(mentioned)many-to-many example with an association table for students/courses
3-05-templates-html¶
python/jinja-demo.py(mentioned)runnable example of Jinja2 template rendering with dictionary data
3-06-forms¶
python/db-single-table/users.py(literalinclude)the SQLModel
Userclass used as the backend data model
python/fastapi-forms/register.html(literalinclude)an HTML form to register a user (name, email, active checkbox)
python/fastapi-forms/hijack-forms.js(literalinclude)JS snippet that intercepts form submission and sends JSON via fetch
python/db-single-table,python/fastapi-forms(mentioned)running backend and frontend on separate ports triggers CORS errors
python/fastapi-forms/(mentioned)vite.config.js that proxies API requests to bypass CORS in dev
3-07-websockets¶
python/fastapi-websockets/(mentioned)shared on/off toggle demo: all connected clients see state changes in real-time
python/fastapi-websockets/app.py(literalinclude)the FastAPI WebSocket endpoint definition
python/fastapi-websockets/index.html(literalinclude)the JS client that connects to the WebSocket and updates the UI