Materi 12 - Programming dan Data Science

Backend Programming Basics

Server-side logic, database, dan API. Pondasi aplikasi web full-stack.

Durasi 30 Menit Level intermediate Kurikulum 30 Materi

1. Apa Itu Backend

Bagian server yang user tidak lihat langsung. Handle business logic, akses database, autentikasi, dan kirim response ke frontend. Berjalan di server (cloud atau on-premise).

2. Bahasa Backend Populer

Python (Django, FastAPI). Node.js (Express, NestJS). Java (Spring). Go (Gin, Echo). PHP (Laravel). Ruby (Rails). Pilih sesuai ekosistem dan kebutuhan tim.

3. Request-Response Cycle

Client kirim request HTTP ke server. Server proses (validasi, query database, business logic). Server kirim response (JSON, HTML, file). Status code: 200 OK, 404 Not Found, 500 Server Error.

4. Routing

Map URL ke function handler. Contoh: GET /users return list user, POST /users create user baru. Framework modern handle routing otomatis dengan decorator atau middleware.

5. Environment dan Config

Pisahkan kode dari config sensitif (API key, database password). Pakai environment variable. File .env untuk development. Secret manager untuk production. Jangan commit credential ke git.

Tugas Praktik

  1. Setup Express atau FastAPI starter project
  2. Implementasi routing untuk CRUD users
  3. Connect ke database (SQLite untuk mulai)
  4. Pakai .env untuk config
  5. Deploy ke Railway, Render, atau Vercel

Rangkuman