A SvelteKit rewrite of DramaBox, a short drama streaming platform.
src/
├── app.css # Global styles + Tailwind
├── app.html # HTML shell
├── lib/
│ ├── api.js # API helpers (apiFetch, subtitle utils)
│ └── MovieCard.svelte # Reusable drama card component
└── routes/
├── +layout.svelte # Nav + footer (shared across all pages)
├── +page.svelte # Home (hero + trending + latest)
├── +page.js # Home data loader
├── trending/
│ ├── +page.svelte # Trending page
│ └── +page.js
├── latest/
│ ├── +page.svelte # Latest/New Releases page
│ └── +page.js
├── search/
│ ├── +page.svelte # Search results page
│ └── +page.js
└── drama/[bookId]/
├── +page.svelte # Drama detail + video player
└── +page.js # Loads detail + episodes in parallel
| Old (vanilla JS) | New (SvelteKit) |
|---|---|
showView('home') |
/ |
showView('search') |
/search?q=... |
openDrama(bookId) |
/drama/[bookId] |
refreshCategory('/trending') |
/trending |
refreshCategory('/latest') |
/latest |
npm install
npm run dev
Then open http://localhost:5173.
npm run build
npm run preview
All API calls go to https://dramabox.sansekai.my.id/api/dramabox.
Endpoints used:
GET /trending – trending dramasGET /latest – new releasesGET /search?query= – searchGET /detail?bookId= – drama detailsGET /allepisode?bookId= – episode listWorks with any SvelteKit-compatible host:
@sveltejs/adapter-cloudflare@sveltejs/adapter-nodeChange svelte.config.js adapter to match your host.