Memuat...

Dokumentasi API

Referensi endpoint publik aplikasi QIslamic. Semua contoh di bawah sudah disesuaikan dengan route yang aktif saat ini.

API Status: Online

Base URL

Production: https://your-domain

Local: http://localhost:3000

Catatan: endpoint /quotes akan mengembalikan HTML jika request biasa browser. Untuk JSON, kirim header Accept: application/json.

GET

/quotes?page=1

Ambil daftar quotes dalam format JSON (pagination).

curl -X GET "https://your-domain/quotes?page=1" \
  -H "Accept: application/json"
{
  "success": true,
  "data": [
    {
      "id": 1772100322768,
      "username": "Admin",
      "quote": "Testing",
      "createdAt": "2026-02-26T10:05:22.768+00:00",
      "updatedAt": null
    }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 1,
    "totalItems": 1
  }
}
POST

/quotes/add

Tambah quote baru.

curl -X POST "https://your-domain/quotes/add" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "Ahmad",
    "quote": "Berimanlah kepada Allah dan Rasul-Nya"
  }'
{
  "success": true,
  "message": "Quote berhasil ditambahkan!"
}

Validasi error: jika username atau quote kosong, server mengembalikan status 400.

GET

/berita

Halaman berita Islami (server-rendered HTML) dari agregasi berita Republika Khazanah.

curl -X GET "https://your-domain/berita"
GET

/doa-harian

Halaman doa harian (server-rendered HTML) dengan data dari API doa eksternal.

curl -X GET "https://your-domain/doa-harian"

Web Push Reminder Sholat

Endpoint berikut dipakai frontend untuk Service Worker Push Notification.

  • GET /push/public-key untuk mengambil VAPID public key.
  • POST /push/subscribe untuk menyimpan subscription + kota aktif.
  • POST /push/update-city untuk sinkronisasi kota subscription.
  • POST /push/unsubscribe untuk menonaktifkan subscription.
curl -X POST "https://your-domain/internal/push/dispatch-prayer-reminders" \
  -H "x-push-cron-secret: YOUR_SECRET"

Endpoint internal di atas dipanggil cron server tiap menit untuk mengirim reminder 10 menit sebelum waktu sholat.

Prasyarat: jalankan SQL migration scripts/push_notifications.sql di Supabase SQL Editor sebelum endpoint push dipakai.

Catatan Endpoint Publik

  • GET /quotes/add menampilkan form tambah quote (HTML).
  • GET /tentang-kami menampilkan halaman profil (HTML).
  • Endpoint admin (/admin/*) tidak didokumentasikan di halaman ini.