# kodkod | Intro Course > Full Stack intro – 5 weeks: the computer, operating system and networks, professional Python, debugging and Git, OOP, backend and databases - [Privacy Policy and Terms of Use](https://intro-kodkod-6.nm-ambition.com/en/privacy/): This site is for course students only — do not pass the link on to others. Our privacy policy is explained here too. - [Choose a new password](https://intro-kodkod-6.nm-ambition.com/en/reset-password/): Choose a new password for your account - [Course chat](https://intro-kodkod-6.nm-ambition.com/en/chat/): A shared group chat for all the learners in the course - [Log in](https://intro-kodkod-6.nm-ambition.com/en/login/): Log in to the course site - [My profile](https://intro-kodkod-6.nm-ambition.com/en/profile/): Your name, description and color in the course chat - [Reset password](https://intro-kodkod-6.nm-ambition.com/en/forgot-password/): Request a password reset link - [Sign up](https://intro-kodkod-6.nm-ambition.com/en/signup/): Sign up to the course site - [Kodkod Intro Course](https://intro-kodkod-6.nm-ambition.com/en/docs/): Full Stack intro: the computer, operating system and networks, professional Python, debugging and Git, OOP, backend and databases ## Kodkod Intro Course > Full Stack intro: the computer, operating system and networks, professional Python, debugging and Git, OOP, backend and databases - [Installations](https://intro-kodkod-6.nm-ambition.com/en/docs/installations/): Everything you install in the course: Python, VS Code, Git and Docker on day one, how to check that everything works, and what gets added later. A hands-on theory topic, with no code. - [The Computer and the Operating System](https://intro-kodkod-6.nm-ambition.com/en/docs/computer-and-os/): The work environment and the terminal, how a computer is built and how a program runs on it: hardware components, kinds of programming languages, the operating system, processes, files and permissions. A theory topic. - [Networks and the Internet](https://intro-kodkod-6.nm-ambition.com/en/docs/networking/): How computers talk to each other: client-server, IP addresses, ports and DNS, the layer model and protocols, and what happens in the browser. A theory topic. - [Professional Python, Clean Code and Debugging](https://intro-kodkod-6.nm-ambition.com/en/docs/python-clean-code/): Names and small functions, DRY/KISS and separation of concerns, bugs, the stack trace and an orderly debugging process. - [Exceptions and Logging](https://intro-kodkod-6.nm-ambition.com/en/docs/python-errors-logging/): Handling errors with try/except/else/finally, raising errors with raise, and recording what happens in a program with logging — including to a file. - [Git and GitHub](https://intro-kodkod-6.nm-ambition.com/en/docs/git/): Version control: why we need it, the basic Git commands, and working with GitHub using push. - [Data Structures and Functions](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/): list, tuple, set and dict, slicing and mutability, functions with args/kwargs/lambda, scope (LEGB), and advanced functions: pure functions, higher-order functions, nonlocal and decorators. - [Modules, Files and JSON](https://intro-kodkod-6.nm-ambition.com/en/docs/python-modules-files/): Splitting code into modules and packages, working with text files and with, and saving and reading data as JSON. - [OOP – Object-Oriented Programming](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/): Classes and objects, state, encapsulation and property, inheritance and polymorphism, and OOP design — from the problem to a complete system. - [Backend and FastAPI](https://intro-kodkod-6.nm-ambition.com/en/docs/backend-fastapi/): What a backend is, HTTP methods and status codes, path/query/body, setting up a first server with FastAPI, and middleware that runs on every request. - [Databases and MySQL](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/): What a database is, MySQL in a Docker container with an interface in VS Code, creating tables and queries, and full CRUD operations from Python. - [Students API – a Server with a Database](https://intro-kodkod-6.nm-ambition.com/en/docs/students-api/): Connecting routes to the database, a Students API with full CRUD, and testing with Swagger. ### Installations > Everything you install in the course: Python, VS Code, Git and Docker on day one, how to check that everything works, and what gets added later. A hands-on theory topic, with no code. - [Installations: Everything You Install in the Course](https://intro-kodkod-6.nm-ambition.com/en/docs/installations/01-installations/): All the tools you install in the course — Python, VS Code, Git and Docker on day one, and what gets added later — what each tool is for, how to install it step by step, and how to check that everything works. ### The Computer and the Operating System > The work environment and the terminal, how a computer is built and how a program runs on it: hardware components, kinds of programming languages, the operating system, processes, files and permissions. A theory topic. - [The Work Environment: the Terminal and a First Code File](https://intro-kodkod-6.nm-ambition.com/en/docs/computer-and-os/01-dev-environment/): The command line — terminal, shell and basic commands — the course work folder, and what a code file is and how to run it. - [How a Computer Works: Components, Running a Program and Programming Languages](https://intro-kodkod-6.nm-ambition.com/en/docs/computer-and-os/02-how-computers-work/): The computer's components (CPU, RAM, storage, registers), what happens from the moment you start a program until it runs, and the kinds of programming languages. - [The Operating System: the Kernel, Processes, Files and Permissions](https://intro-kodkod-6.nm-ambition.com/en/docs/computer-and-os/03-operating-system/): What the operating system does and what the kernel is, a program versus a process and memory management, and the file system, users and permissions. ### Networks and the Internet > How computers talk to each other: client-server, IP addresses, ports and DNS, the layer model and protocols, and what happens in the browser. A theory topic. - [Networks and the Internet: Client-Server, Addresses, Protocols and the Journey of a Request](https://intro-kodkod-6.nm-ambition.com/en/docs/networking/01-networks-internet/): How computers communicate: networks and client-server, IP addresses, ports and DNS, the layer model and protocols, and what happens from typing an address until the site is shown. ### Professional Python, Clean Code and Debugging > Names and small functions, DRY/KISS and separation of concerns, bugs, the stack trace and an orderly debugging process. - [Clean Code A: Good Names, Small Functions and a Single Responsibility](https://intro-kodkod-6.nm-ambition.com/en/docs/python-clean-code/03-naming-and-small-functions/): Why clean code matters, how to choose names for variables, functions and files, and how to break a long function into small functions with a single responsibility (Single Responsibility). - [Clean Code B: DRY, KISS, Separation of Concerns, Comments and Refactoring](https://intro-kodkod-6.nm-ambition.com/en/docs/python-clean-code/04-dry-kiss-soc-comments/): Four principles that keep code healthy over time — don't repeat yourself (DRY), keep it simple (KISS), separate the different parts (Separation of Concerns) — and when you really need comments. Finally: how to improve existing code safely. - [Debugging A: What a Bug Is, Kinds of Errors and Reading a Stack Trace](https://intro-kodkod-6.nm-ambition.com/en/docs/python-clean-code/05-bugs-and-stack-trace/): What a bug is, the three kinds of errors — Syntax, Runtime and Logical — and how to read an error message and a Stack Trace from the bottom up to find exactly where and why the code broke. - [Debugging B: The Debugging Process and the VS Code Debugger](https://intro-kodkod-6.nm-ambition.com/en/docs/python-clean-code/06-debugging-process-and-tools/): An orderly process for finding bugs — reproduce, isolate, understand the root cause, fix and verify — and hands-on work with Breakpoints, Step Over, Step Into, the Variables window and the Call Stack, including solving a real bug from start to finish. ### Exceptions and Logging > Handling errors with try/except/else/finally, raising errors with raise, and recording what happens in a program with logging — including to a file. - [Exceptions A: Why Error Handling Is Needed, try and except](https://intro-kodkod-6.nm-ambition.com/en/docs/python-errors-logging/01-try-except/): What an Exception is, why real software cannot simply crash, how to catch an error with try/except, and how to handle several different kinds of Exceptions properly. - [Exceptions B: else and finally — the Full Structure](https://intro-kodkod-6.nm-ambition.com/en/docs/python-errors-logging/02-else-finally/): The full structure of try/except/else/finally — what runs when, why else separates the risky code from the code that depends on success, and why finally is the place for cleanup that must always happen. - [Exceptions C: raise — Throwing an Error Ourselves](https://intro-kodkod-6.nm-ambition.com/en/docs/python-errors-logging/03-raise/): How and when to throw an Exception ourselves with raise, how to choose the suitable error type, and why it is better for a function to throw a clear error than to silently return a wrong value — including passing an error on to the caller. - [Logging A: Why print Is Not Logging, and the Log Levels](https://intro-kodkod-6.nm-ambition.com/en/docs/python-errors-logging/04-logging-basics/): The difference between print and Logging, what a Log is and why every real system writes one, the five log levels — debug, info, warning, error, critical — and how to set which level is shown. - [Logging B: Saving Logs to a File and Recording Important Actions](https://intro-kodkod-6.nm-ambition.com/en/docs/python-errors-logging/05-logging-to-file/): How to save logs to a file that remains after the program ends, the writing modes (append versus overwrite), recording Exceptions with the full Traceback using logging.exception, and what exactly is worth recording. ### Git and GitHub > Version control: why we need it, the basic Git commands, and working with GitHub using push. - [Version Control: Why We Need It, and the Basic Concepts of Git](https://intro-kodkod-6.nm-ambition.com/en/docs/git/01-version-control-concepts/): What version control is and what problem it solves, what Git is, and the three areas every Git command works with — Working Directory, Staging Area and Repository — and what a Commit is. - [Basic Git Commands: init, status, add, commit, log](https://intro-kodkod-6.nm-ambition.com/en/docs/git/02-git-basic-commands/): Daily work with Git step by step — creating a Repository, reading git status, adding to Staging, a Commit with a message, viewing the history and the differences (log, diff), and the .gitignore file. - [GitHub, Remote and Push — and Good Commit Messages](https://intro-kodkod-6.nm-ambition.com/en/docs/git/03-github-remote-push/): Creating a Repository on GitHub, connecting a Remote to the local Repository, uploading the code with git push, authenticating with GitHub, and rules for writing clear Commit messages. ### Data Structures and Functions > list, tuple, set and dict, slicing and mutability, functions with args/kwargs/lambda, scope (LEGB), and advanced functions: pure functions, higher-order functions, nonlocal and decorators. - [list: Creating, Accessing, Adding, Removing, Searching and Looping](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/01-list/): Everything about list from the basics: how to create a list, positive and negative indexes, adding (append, insert), removing (remove, pop, del), searching (in, index, count), looping and sorting. - [tuple and set: a Fixed Record and a Collection Without Duplicates](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/02-tuple-and-set/): tuple — a fixed sequence that cannot be changed, and unpacking it into variables; set — a collection without duplicates and without order, fast membership checks and set operations: union, intersection and difference. - [dict: Key and Value](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/03-dict/): dict from the basics: how to create a dictionary, read a value by key, add, update and delete, get with a default, looping with keys/values/items, and a list of dictionaries — the structure that represents records and JSON. - [Slicing, Mutable versus Immutable, and is versus ==](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/04-slicing-mutability-identity/): Cutting sequences with Slicing [start:stop:step]; the difference between types that can be changed and types that cannot; what happens when two variables point to the same list; and the difference between value equality (==) and object identity (is). - [Functions in Depth: Default Values, Functions as Objects, *args, **kwargs and Lambda](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/05-functions-args-kwargs-lambda/): An orderly review of functions, parameters with a default value and named arguments, a function as an object that can be passed around, functions with a variable number of arguments (*args, **kwargs), and lambda at an introductory level. - [Scope: Local, Enclosing, Global and Built-in (LEGB)](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/06-scope-legb/): Where a variable 'lives' and from where it can be seen: local variables inside a function, global variables, a function inside a function (Enclosing), built-in names, and the LEGB lookup order — including global and why it is better to avoid it. - [Pure Functions and Side Effects](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/07-pure-functions/): What a pure function is, what counts as a Side Effect, why a function that changes a list it received is a trap, and how to write a pure version that returns a new value. - [Higher-Order Functions: Functions That Receive and Return Functions](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/08-higher-order-functions/): A function that receives a function as a parameter or returns a function: passing an action as a parameter, map, filter, the key parameter of sorted/max/min, and a function that creates functions. - [Nested Functions, Closures and nonlocal](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/09-nested-functions-nonlocal/): A function inside a function, the E of LEGB (Enclosing), a Closure — a function that remembers the variables of the function that created it, and nonlocal for changing a variable of the enclosing function. - [Decorators: Adding Behavior to a Function Without Touching It](https://intro-kodkod-6.nm-ambition.com/en/docs/python-data-functions/10-decorators/): What a Decorator is, how it is built from Higher-Order Functions and Closures, the @ syntax, a wrapper that fits any function with *args and **kwargs, and useful examples: printing calls and measuring time. ### Modules, Files and JSON > Splitting code into modules and packages, working with text files and with, and saving and reading data as JSON. - [Modules: Why We Split into Files, import, from and as](https://intro-kodkod-6.nm-ambition.com/en/docs/python-modules-files/01-modules-and-import/): What a Module is, why a project is split into several files, how to import code from another file with import, from and as, and what happens behind the scenes when you import. - [Packages, __init__.py and if __name__ == "__main__"](https://intro-kodkod-6.nm-ambition.com/en/docs/python-modules-files/02-packages-and-main-guard/): How to organize modules in folders (a Package), what the role of __init__.py is, how to import from inside a Package, and what the condition if __name__ == '__main__' means — and why every file meant to be run needs it. - [Working with Text Files: open, with, Reading and Writing](https://intro-kodkod-6.nm-ambition.com/en/docs/python-modules-files/03-text-files-with/): How to open a file, the opening modes (r, w, a), why a file must be closed and how with does it for us, ways to read (read, readlines, a loop) and to write (write), and how to build a path that does not depend on the folder you run from. - [JSON: Reading, Writing and Saving Data](https://intro-kodkod-6.nm-ambition.com/en/docs/python-modules-files/04-json/): What JSON is and why it is the most common format for saving and transferring data, the match between JSON and Python's dict and list, and saving and loading data with json.dump, json.load, json.dumps and json.loads. ### OOP – Object-Oriented Programming > Classes and objects, state, encapsulation and property, inheritance and polymorphism, and OOP design — from the problem to a complete system. - [Classes and Objects: From the Problem to a Complete Class](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/01-classes-and-objects/): One lesson that unfolds like a story: a small bank system that breaks without OOP, then Class and Object, __init__ and self, Methods and Class Attributes — and at the end we return to the bank and rebuild it, plus a mini project that connects everything. - [Objects at Work: State, Information Hiding, Properties and a Complete Class](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/02-objects-in-practice/): One lesson that unfolds like a story: many objects and state that changes, then we discover that any code can break the data — we hide it (Encapsulation), keep a simple syntax with @property that checks every assignment, and build a complete class with rules. At the end — a mini project that connects everything. - [Inheritance and super: Similar Classes Without Duplicated Code](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/03-inheritance/): One lesson that unfolds like a story: an employee and a manager with the same code twice — inheritance solves it; then a Child that needs to behave a little differently — overriding (Override) and super(). At the end — a mini project that connects everything. - [Polymorphism: a Common Interface, Different Behavior](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/04-polymorphism/): What Polymorphism means, why it is useful — one piece of code that works on many types without ifs — a common interface through a Parent Class, Duck Typing in Python, and how this makes a system easy to extend. - [Single Responsibility in OOP and Composition Versus Inheritance](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/05-srp-and-composition/): How to break a God Class into classes with a single responsibility, what Composition is ('has a' — an object made of other objects), and how to choose between Composition and Inheritance — at an introductory level. - [Guided Practice: From a Verbal Requirement to a Class Structure](https://intro-kodkod-6.nm-ambition.com/en/docs/oop/06-from-requirements-to-classes/): A full design workshop step by step: we receive a requirement for a gym system, analyze it, decide on Classes and responsibilities, draw relationships, write a skeleton, implement and test — a process you can repeat in every project. ### Backend and FastAPI > What a backend is, HTTP methods and status codes, path/query/body, setting up a first server with FastAPI, and middleware that runs on every request. - [Backend and HTTP: Who Does What, Methods and Status Codes](https://intro-kodkod-6.nm-ambition.com/en/docs/backend-fastapi/01-what-is-backend/): The role of the Backend — how the Client, the Server and the Database work together, and what an API and an Endpoint are — and how you talk to it: GET, POST, PUT and DELETE versus CRUD, and the basic response codes every Backend returns. - [FastAPI from Scratch: Installation, app = FastAPI(), a First Route and Running the Server](https://intro-kodkod-6.nm-ambition.com/en/docs/backend-fastapi/04-fastapi-setup-first-route/): Setting up a first FastAPI server step by step: a virtual environment (venv), installing with pip, creating main.py, importing FastAPI, creating app, defining a first Route with a Decorator, running it with uvicorn, and the automatic documentation page /docs. - [Path Params, Query Parameters and Body](https://intro-kodkod-6.nm-ambition.com/en/docs/backend-fastapi/03-params-query-body/): The three ways a Client passes information to the server: a parameter in the path (/students/7), parameters in the Query (?city=Haifa&limit=10), and a Body in JSON — when to use each one, and what they look like in a real request. - [FastAPI: Path Params, Query, Body and HTTPException](https://intro-kodkod-6.nm-ambition.com/en/docs/backend-fastapi/05-fastapi-params-query-body/): How FastAPI reads the three kinds of input: a Path Parameter with type conversion, Query Parameters with default values and optional parameters, and a Body defined with a Pydantic model — including Type Hints, status_code=201, HTTPException for 404, and the automatic 422 error. - [Middleware: Code That Runs on Every Request](https://intro-kodkod-6.nm-ambition.com/en/docs/backend-fastapi/06-middleware/): What Middleware is in FastAPI: code that wraps every request to the server — before the Route and after it. A log for every request, measuring time and a Header for every response, async and await, and when Middleware is not the right place. ### Databases and MySQL > What a database is, MySQL in a Docker container with an interface in VS Code, creating tables and queries, and full CRUD operations from Python. - [A Database and Setting Up MySQL: Tables, Keys, Docker and a Driver](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/01-what-is-a-database/): Why you need a database when there are JSON files, and what Table, Row, Column, Primary Key, types and constraints are — and how to set up a MySQL server in a Docker container, connect to it from VS Code with Database Client and from Python through the Driver. - [Connecting, a Table and Inserting Data: Connection, CREATE TABLE and INSERT](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/03-open-test-close-connection/): We open a connection to MySQL, check that it works and close it properly with try/finally — and then create a table with types and constraints, insert data from Python and see the database refuse data that breaks the rules. - [Basic SQL: SELECT, WHERE by id and Simple Filtering](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/02-select-where/): Reading data from a table: SELECT of all the rows or of chosen columns, WHERE by id to fetch one record, simple conditions (=, >, AND), ORDER BY for sorting, and what a query that found nothing returns. - [Running a Query from Python: execute, Parameters, commit and fetch](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/03-queries-from-python/): The full path Python → Connection → Query → Database → Result → Python: running CREATE, INSERT and SELECT with execute, parameters with %s (and why you must not build SQL by concatenation — SQL Injection), commit for saving, lastrowid, and fetchone/fetchall. - [Updating and Deleting: UPDATE and DELETE by id — from SQL and from Python](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/01-update/): Updating a record and deleting a record by id, both in SQL and from Python with parameters: why WHERE is required, how to know whether something really changed with rowcount, and what happens to an id that was deleted. - [Full CRUD from Python: a Complete db.py Module and Testing All Four Actions](https://intro-kodkod-6.nm-ambition.com/en/docs/databases/04-full-crud-module/): Connecting everything we learned into one complete database-access module — init_db, create, get_all, get, update and delete — with parameters, commit, rowcount, translating errors and dicts, and a test script that runs all four CRUD actions on one Entity. ### Students API – a Server with a Database > Connecting routes to the database, a Students API with full CRUD, and testing with Swagger. - [Connecting Routes to Database Actions: the Architecture](https://intro-kodkod-6.nm-ambition.com/en/docs/students-api/01-connecting-routes-to-db/): How to connect FastAPI to db.py: separating the Route from the database-access code, the mapping table POST→INSERT, GET→SELECT, PUT→UPDATE, DELETE→DELETE, what happens in one request from end to end, and running the first two Endpoints — GET all and GET by id. - [Students API — Full CRUD: POST, GET, PUT and DELETE on the Database](https://intro-kodkod-6.nm-ambition.com/en/docs/students-api/02-students-api-full-crud/): Completing the server: a Pydantic model for input, a shared validation function, a POST that creates and returns 201, a PUT that updates with 404 and 409, a DELETE that returns 204 — the full code of main.py, and all its real responses. - [Testing the System: Swagger UI, curl and a Test Script in Python](https://intro-kodkod-6.nm-ambition.com/en/docs/students-api/03-testing-with-swagger/): Three ways to test an API — Swagger UI at /docs (Try it out), curl from the Terminal, and a Python script that runs a sequence of requests and compares them to the expected codes — and an orderly list of manual tests for all the CRUD actions.