DJANGO REST FRAMEWORK PROJECT

Modern E-Commerce
REST API

Django REST Framework ile geliştirilmiş; güvenli, ölçeklenebilir ve test edilebilir modern bir e-ticaret backend API projesi.

Projeyi Keşfet ↓ Gerçek Proje • Gerçek API • Gerçek Deneyim
01

Genel Sistem Mimarisi

Client'tan PostgreSQL'e kadar ShopAPI'nin temel backend veri akışı.

💻

Client

Web / Mobil / Postman
  • HTTP API istekleri
  • JSON veri gönderimi
  • JWT token ile authentication
  • Frontend bağımsız kullanım
HTTPS REST API
→
ORM Database
→
🐘

PostgreSQL

Database
  • Relational Database
  • User Isolation
  • Persistent Data
  • Production Ready
02

Veri Modeli

ShopAPI'nin PostgreSQL üzerinde çalışan ilişkisel database yapısı.

👤

User

AbstractUser
id username email password is_staff
1 : N User Orders
↓
📦

Order

Customer Order
id user status total_price created_at
1 : N Order Items
↓
🧾

OrderItem

Order Product
id order product quantity unit_price
🏷️

Category

Product Group
id name slug created_at
1 : N Category Products
→
🛍️

Product

Store Product
id category name price stock is_active
Relational Architecture User 1:N Order   •   Order 1:N OrderItem   •   Category 1:N Product
03

API Endpoints

Authentication, product, category ve order işlemleri REST endpoint'leri üzerinden yönetilir.

🔐

Authentication

JWT Authentication

POST /api/auth/register/
POST /api/auth/login/
POST /api/auth/refresh/
🏷️

Categories

Category Management

GET /api/categories/
POST /api/categories/
🛍️

Products

Product CRUD

GET /api/products/
POST /api/products/
GET /api/products/{id}/
PATCH /api/products/{id}/
DELETE /api/products/{id}/
📦

Orders

Order Management

GET /api/orders/
POST /api/orders/
GET /api/orders/{id}/
04

Roller & Permissions

Authentication tek başına yeterli değildir. Kullanıcıların hangi kaynaklara erişebileceği permission katmanında kontrol edilir.

👤
NORMAL USER

Kullanıcı

  • ✓ Ürünleri görüntüleyebilir
  • ✓ Kategorileri görüntüleyebilir
  • ✓ Sipariş oluşturabilir
  • ✓ Kendi siparişlerini görüntüleyebilir
  • ✓ JWT ile korunan endpoint'lere erişebilir
  • × Başka kullanıcının siparişine erişemez
🔒 Ownership / User Isolation
🛡️
STAFF USER

Admin

  • ✓ Product CRUD işlemleri
  • ✓ Category yönetimi
  • ✓ Sipariş yönetimi
  • ✓ Yönetim endpoint'lerine erişim
  • ✓ Staff permission kontrolleri
🛡️ Role Based Permission
05

Teknolojiler

ShopAPI'nin development ve production altyapısında kullanılan temel teknolojiler.

🐍

Python

3.12.10

Backend programlama dili

🌿

Django

5.2.17

Web framework

⚙️

DRF

3.18.1

REST API framework

🐘

PostgreSQL

17.11

Relational database

🔑

JWT

SimpleJWT

Token authentication

📘

OpenAPI

Swagger

Interactive API documentation

06

Test & Production

Bir API yalnızca çalışmasıyla değil; test, güvenlik ve deployment süreçleriyle tamamlanır.

DEVELOPMENT

API Development

  • REST API
  • Serializer Validation
  • Filtering
  • Search
  • Ordering
  • Pagination
SECURITY

Authentication & Permissions

  • JWT Authentication
  • Permissions
  • User Isolation
  • Ownership Control
  • Protected Endpoints
TEST

Testing

  • Postman
  • Swagger UI
  • Automated Tests
  • Negative Test Cases
  • Regression Tests
PRODUCTION

Deployment

  • Ubuntu VPS
  • Gunicorn
  • Nginx
  • Domain & DNS
  • SSL / TLS
  • HTTPS
  • HSTS
DOMAIN / DNS → HTTPS → NGINX → GUNICORN → DJANGO + DRF → POSTGRESQL