| Fitur | Deskripsi |
|---|---|
| 🔍 Search | Cari drama berdasarkan keyword |
| 📺 Streaming | Dapatkan URL streaming (m3u8/mp4) |
| 📋 Episode List | Daftar semua chapter/episode |
| 🏷️ Categories | Jelajahi berdasarkan kategori |
| ⭐ Recommendations | Drama yang direkomendasikan |
| 👑 VIP Content | Akses konten VIP/Theater |
| Best Practice | Status |
|---|---|
| ⚡ Rate Limiting | ✅ 100 req/min |
| 🗜️ Gzip Compression | ✅ ~70% smaller |
| 🔒 Security Headers | ✅ Helmet |
| 🔄 Auto Retry | ✅ 3x + backoff |
| 💾 Response Caching | ✅ 5-60 min TTL |
| 📊 Health Check | ✅ /health |
| 🎯 Input Validation | ✅ Sanitized |
| 🚦 Graceful Shutdown | ✅ SIGTERM |
- Node.js 18+
- npm atau yarn
# Clone repository
git clone https://github.com/hndko/dramabox-rest-api-node.git
cd dramabox-rest-api-node
# Install dependencies
npm install
# Build CSS (optional)
npm run build:css
# Start development server
npm run devPORT=3000
NODE_ENV=development
DEFAULT_LANG=inLocal: http://localhost:3000
Production: https://dramabox-rest-api-node-eta.vercel.app
GET /api/search?keyword={keyword}&page={page}&size={size}&lang={lang}| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| keyword | string | ✅ | - | Kata kunci pencarian |
| page | number | ❌ | 1 | Halaman |
| size | number | ❌ | 20 | Jumlah per halaman |
| lang | string | ❌ | in | Bahasa (in/en/th) |
GET /api/home?page={page}&size={size}&lang={lang}GET /api/vip?lang={lang}GET /api/detail/{bookId}/v2?lang={lang}GET /api/chapters/{bookId}?lang={lang}GET /api/stream?bookId={bookId}&episode={episode}&lang={lang}| Parameter | Type | Required | Description |
|---|---|---|---|
| bookId | number | ✅ | ID drama |
| episode | number | ✅ | Nomor episode |
GET /download/{bookId}?lang={lang}
⚠️ Rate limit: 5 request/menit
GET /api/categories?lang={lang}
GET /api/category/{id}?page={page}&size={size}&lang={lang}GET /api/recommend?lang={lang}GET /health{
"success": true,
"data": [...],
"meta": {
"timestamp": "2024-01-01T00:00:00.000Z",
"pagination": {
"page": 1,
"size": 10,
"hasMore": true
}
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Parameter wajib: keyword"
},
"meta": {
"timestamp": "2024-01-01T00:00:00.000Z"
}
}| Code | HTTP | Description |
|---|---|---|
VALIDATION_ERROR |
400 | Input tidak valid |
NOT_FOUND |
404 | Data tidak ditemukan |
RATE_LIMIT_EXCEEDED |
429 | Terlalu banyak request |
REQUEST_TIMEOUT |
408 | Request timeout |
INTERNAL_ERROR |
500 | Server error |
dramabox-rest-api-node/
├── 📁 docs/
│ ├── 📁 api/ # API Documentation & Postman
│ ├── 📁 deployment/ # Deployment Guides
│ └── 📁 general/ # General Info
├── 📁 src/
│ ├── 📁 config/ # App Configuration
│ ├── 📁 controllers/ # Business Logic
│ ├── 📁 middlewares/ # Express Middlewares
│ ├── 📁 routes/ # API Routes
│ ├── 📁 services/ # Third-party Services
│ ├── 📁 utils/ # Utility Functions
│ ├── 📁 styles/ # Tailwind Source
│ └── 📄 app.js # App Assembly
├── 📁 public/
│ └── 📁 css/ # Compiled CSS
├── 📁 views/
│ └── 📄 docs.ejs # Documentation Page
├── 📄 server.js # Entry Point
├── 📄 tailwind.config.js
└── 📄 package.json
npm start # Production server
npm run dev # Development with hot reload
npm run build:css # Build Tailwind CSS
npm run watch:css # Watch Tailwind changesWe have prepared detailed guides for various platforms:
- Vercel (Recommended for Hobby)
- Shared Hosting (cPanel)
- VPS (Ubuntu/Debian)
- aaPanel
- Docker Guide (Coming Soon)
- ♻️ Refactor: Modular MVC Architecture
- 🌐 Feat: Full Multi-Language Support (
lang=in/en) - 🎨 UI: New polished language selector in docs
- 📚 Docs: Restructured documentation & added deployment guides
- ✅ Rate limiting (100 req/min)
- ✅ Gzip compression
- ✅ Helmet security headers
- ✅ Standardized response format
- ✅ Global error handling
- ✅ Graceful shutdown
- ✅ Health check endpoint
- ✅ Instance pooling
- ✅ Retry logic with exponential backoff
- ✅ Response caching (node-cache)
- ✅ Better error messages
- ✅ Tailwind CSS (local build)
- ✅ Modern documentation UI
- 🎉 Initial release
Handoko x Mari Partner
MIT License - feel free to use for personal or commercial projects.
⭐ Star this repo if you find it useful!
Made with ❤️ in Indonesia 🇮🇩