Skip to content
Muslu Yüksektepe

Göztepeli.com

A Turkish training project that teaches web development with FastAPI through real examples: 21 endpoints, Jinja2, DuckDB and live deployment.

Göztepeli.com is a Turkish training project I made for people who want to learn web development with Python and FastAPI. I originally opened the repository in early 2025 for the goztepeli.com domain, and in April 2026 I rewrote it from scratch and turned it into a training project. The project does not stop at a small code sample. Next to the application code, it includes tests and an installation script that puts the application into production on a real server.

Purpose

One of the hardest things for people new to web development is understanding how a request travels from the browser to the server, and which response the server should return in which situation. Most Turkish resources either show a single "hello world" example or stop before reaching deployment. I wanted to prepare a resource that readers can run on their own computer, try out piece by piece and finally deploy to a server. I wrote every part of the code with Turkish explanations, so reading the file works like a lesson in itself.

How it works

The whole application lives in main.py and contains 21 endpoints in total. Four of them handle the basics: the home page rendered with a Jinja2 template, /ping for health checks, /api/test, which runs a sample SQL query with DuckDB, and /api/durum-kodlari, which lists all status codes. The remaining 17 endpoints each demonstrate one HTTP status code between 200 and 503. Among them are the most common ones, such as 201 Created, 204 No Content, the 301 and 302 redirects, 304 Not Modified, 401, 403, 404, 409, 422 and 429.

The description of every endpoint explains when the code is used, what the client should do and gives a real-life example. The 429 description, for instance, covers the Retry-After header and rate limiting methods such as fixed window, sliding window and token bucket. All status code endpoints return the same JSON structure made of the code, the status name, a Turkish explanation and an example. In the Swagger UI and ReDoc pages generated by FastAPI, the endpoints are grouped as 2xx, 3xx, 4xx and 5xx.

The JavaScript file on the home page shows how to use fetch and async/await. When the page opens it pings the server on its own, and the same can be done by hand with a button. The file also contains an example function that calls a status code endpoint with the right HTTP method and handles its response. The stylesheet uses Göztepe's red and yellow colours and includes notes explaining why each rule was written.

Testing and deployment

  • tests/test_endpoints.py calls every endpoint in turn with httpx and checks the expected status codes. The file can be run either as a standalone script or with pytest.
  • install/nginx_fastapi.sh installs everything on an Ubuntu server in 12 steps: system update, Python 3.12, Nginx, Certbot, the virtual environment, packages, application files, the systemd service, the Nginx configuration, the Let's Encrypt certificate, starting the services and a final check.
  • The Nginx configuration redirects HTTP to HTTPS and adds security headers such as HSTS, X-Frame-Options, X-Content-Type-Options and Referrer-Policy.

Technical background

The application is written with Python 3.12 and FastAPI. Uvicorn is used during development, and Gunicorn with four workers and UvicornWorker in production. I chose DuckDB as the database because it does not need a separate server. Redis appears in the installation script and the dependencies, but the application code does not use it yet.

Category
Teaching & community
Year
2026

Technologies

  • Python
  • FastAPI
  • DuckDB
  • Education

Links

  • GitHub https://github.com/muslu/goztepelicom

Back to all projects