A modern, high-performance Video-on-Demand (VOD) streaming platform built with SvelteKit 5, featuring a beautiful UI and seamless video playback experience.
# Clone the repository
git clone <repository-url>
cd vod-web
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env
# Edit .env and add your PUBLIC_BASE_URL
Create a .env file in the root directory:
PUBLIC_BASE_URL=your_api_base_url
Start the development server:
npm run dev
# Or open in browser automatically
npm run dev -- --open
The app will be available at http://localhost:5173
Create a production build:
npm run build
Preview the production build:
npm run preview
npm run dev - Start development servernpm run build - Build for productionnpm run preview - Preview production buildnpm run check - Run Svelte type checkingnpm run check:watch - Run type checking in watch modenpm run format - Format code with Prettiernpm run lint - Lint code with Prettiervod-web/
āāā src/
ā āāā lib/
ā ā āāā components/
ā ā ā āāā Header.svelte # Navigation header
ā ā ā āāā Hero.svelte # Landing hero section
ā ā ā āāā MovieCard.svelte # Movie card component
ā ā ā āāā MovieSection.svelte # Movie grid with infinite scroll
ā ā āāā assets/ # Static assets
ā āāā routes/
ā ā āāā +page.svelte # Home page
ā ā āāā +layout.svelte # Root layout
ā ā āāā vod/
ā ā āāā [id]/
ā ā āāā +page.svelte # Movie detail page
ā āāā app.css # Global styles
ā āāā app.html # HTML template
āāā static/ # Static files
āāā svelte.config.js # SvelteKit configuration
āāā tailwind.config.js # Tailwind configuration
āāā tsconfig.json # TypeScript configuration
āāā vite.config.ts # Vite configuration
The app connects to a backend API with the following endpoints:
GET /vod/list - Fetch movies with pagination, search, and sortinglimit, page, q (search), order_by, order_dirGET /vod/detail/:id - Fetch movie details including streaming URLsThe app is configured for deployment on Vercel with Edge Runtime (You can change it as you wish):
// svelte.config.js
adapter: adapter({
runtime: 'edge',
regions: ['sin1'], // Singapore region
})
Deploy to Vercel:
# Install Vercel CLI
npm i -g vercel
# Deploy
vercel
Windows desktop applications are available:
Built with ā¤ļø using SvelteKit 5