ViteReactStarter

smart-tv-starter — Vite Starter Template

By foridpathan

A Smart TV application starter template based on Vite and React. The README explains how to configure build outputs for Tizen and WebOS, and uses norigin-spatial-navigation for remote control directional key navigation.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

2 previews
Desktop homepage1 / 2
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 2

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-15View source

What stands out

A quick read of the recorded project description.

01

The README provides Vite + React project initialization steps and lists dependencies such as react-router-dom, @noriginmedia/norigin-spatial-navigation, and tailwindcss

02

Distinguishes Tizen, WebOS, and production builds via package.json scripts and the WEBPACK_MODE environment variable, with output directories build/tizen, build/webos/uhd, and build/production respectively

03

The vite.config.ts example shows setting outDir, esbuild target, and minification options per platform, and configuring the @ path alias

04

Implements focus navigation using norigin-spatial-navigation's init, useFocusable, and FocusContext, with examples including Home and ContentRow components

05

Routing uses createMemoryRouter to define paths such as home, movies, series, and sports

Template Details

The template's README presents a tutorial-style guide on creating a React project with Vite and adjusting the build configuration for Smart TV platforms. Core content includes: defining scripts such as copy:tizen, copy:webos, platform:tizen, and platform:webos in package.json, using the WEBPACK_MODE environment variable to distinguish between Tizen, WebOS, and regular production builds, with outputs to build/tizen, build/webos/uhd, or build/production directories; in vite.config.ts, selecting outDir based on the mode and setting esbuild options for Tizen/WebOS. The README also notes that platform configuration files (such as config.xml for Tizen and appinfo.json for WebOS) need to be created, but does not provide the full contents of these files. The navigation section uses react-router-dom's createMemoryRouter to define routes for home, movies, series, sports, etc., and uses @noriginmedia/norigin-spatial-navigation's init, useFocusable, and FocusContext to implement focus management and scrolling. The README does not state whether the template includes complete page implementations, styling details, test coverage, or production deployment processes, nor does it provide dependency version numbers.

ViteReactStarter

Is it right for your project?

Use Cases

  • Setting up a Vite + React build process for Tizen or WebOS TV applications
  • Implementing directional key-based focus navigation and horizontal content row scrolling on TV
  • Organizing a Smart TV application structure by referring to the routing and focus component examples in the README

Suitable For

  • React developers who need to configure Vite builds for Tizen or WebOS platforms
  • Frontend engineers who want to understand the basic usage of norigin-spatial-navigation on TV
  • Teams building Smart TV application prototypes starting from the README tutorial

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    The README uses npm create vite@latest to create a React project and installs react-router-dom, @noriginmedia/norigin-spatial-navigation, and tailwindcss

  2. 2

    Scripts such as copy:tizen, copy:webos, platform:tizen, platform:webos, platform:build, and build need to be added to package.json

  3. 3

    Replace vite.config.ts as per the README example and set the WEBPACK_MODE environment variable according to the platform

  4. 4

    On Windows, the README advises replacing export with set

  5. 5

    The README mentions creating platform configuration files such as config.xml for Tizen and appinfo.json for WebOS, but does not provide the full file contents

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license from the public repository; the free scope is the code of this version and does not imply that external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as-is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses; they cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
  • Windows users need to replace export with set in scripts; otherwise, environment variable setting commands will not work on Windows.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

> **Note:** if you use Windows then please use `set` intend of `export` becuase `export` will not working in windows

Original README
https://github.com/foridpathan/smart-tv-starter/blob/main/LICENSEhttps://github.com/foridpathan/smart-tv-starter/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-15. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 82 / 100
Technologies
Vite · React
Website type
Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2024-11-11
Screenshot last checked
2026-10-15

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Vite as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: codex-user-requested-batch-review-20261015 · 2026-10-15

Inspect the recorded source material

SHA-256: 2fa3cd704c8f07fd1b1d9c19a5da79570d140436864c51dde2304df8f2bda470

2026-10-15T04:21:59.333Z

Source file / repository

This guide is particularly focused on leveraging Vite’s configuration options to build for specific platforms like Tizen and WebOS and covers setting up navigation and routing within the app.

## Project Setup
Let’s start by setting up a new React project with Vite and tailoring the configuration to fit Smart TV specifications.

### Step 1: Create the Vite Project
**1. Initialize a Vite Project:**
Create a new Vite project with React support.
```
npm create vite@latest my-smart-tv-app - template react
cd my-smart-tv-app
```

**2. Install Dependencies:**
Install necessary packages
```
npm install react-router-dom @noriginmedia/norigin-spatial-navigation tailwindcss
```

### Step 2: Configuring Vite for Smart TV Platforms

This configuration step is essential for adapting the Vite build to meet the unique requirements of Smart TVs. Vite will be set up to output separate builds for Tizen and WebOS platforms, alongside a production build. We’ll also auto-configure platform-specific files, such as config.xml for Tizen and appinfo.json for WebOS.

To simplify the build process, we define several custom scripts in `package.json`
```JSON
"scripts": {    
    "copy:tizen": "node config/index.cjs tizen && node --experimental-modules config/tizen-script.cjs",
    "copy:webos": "node config/index.cjs webos && node --experimental-modules config/webos-script.cjs && node config/fhd-script.cjs",
    "platform:tizen": "export WEBPACK_MODE=tizen tsc && vite build && npm run copy:tizen",
    "platform:webos": "export WEBPACK_MODE=webos tsc && vite build && npm run copy:webos",
    "platform:build": "tsc && vite build",
    "build": "npm-run-all --sequential platform:*",
    ...
}
...
```
 - **Copy Scripts (copy:tizen and copy:webos):** These scripts copy the configuration files for each platform to their respective directories.
 - **Platform Build Scripts (platform:tizen and platform:webos):** These scripts set the appropriate WEBPACK_MODE and execute the build for the specified platform.
 - **Build Command:** Runs the platform build scripts in sequence to produce builds for both Tizen and WebOS.

> **Note:** if you use Windows then please use `set` intend of `export` becuase `export` will not working in windows

In your `vite.config.ts`, replace the content with the following configuration:
```js
import react from "@vitejs/plugin-react";
import browserslist from "browserslist";
import { resolveToEsbuildTarget } from "esbuild-plugin-browserslist";
import path from "path";
import tailwindcss from "tailwindcss";
import { defineConfig, loadEnv } from "vite";

// https://vitejs.dev/config/
export default defineConfig(() => {
  const WEBPACK_MODE = process.env.WEBPACK_MODE?.trim() || "";
  // File config for specific platform
  const tizen = "tizen";
  const webos = "webos";

  const tizenBuild = "build/tizen";
  const webosBuild = "build/webos/uhd"; // WebOS have two app on UHD & FSD

  // Determine the output directory based on the mode
  const isTizen = WEBPACK_MODE === tizen;
  const isWebOS = WEBPACK_MODE === webos;
  const outDir = isTizen ? tizenBuild : isWebOS ? webosBuild : "build/production";
  const env = loadEnv(WEBPACK_MODE, process.cwd(), "");

  function getBuildTarget(browsers) {
    return resolveToEsbuildTarget(browserslist(browsers), {
      printUnknownTargets: false,
    });
  }

  const baseConfig: any = {
    plugins: [react(), tailwindcss()],
    define: {
      "process.env": env || {},
    },
    resolve: {
      alias: {
        "@": path.resolve(__dirname, "./src"),
      },
    },
    base: "./",
    build: {
      minify: "terser",
      target: getBuildTarget([
        ">0.1% and supports es6-module and not ios < 12 and not opera > 0",
        "node >= 18.13.0",
      ]),
      outDir,
      rollupOptions: {
        input: {
          app: path.resolve(__dirname, "index.html"),
        },
        output: {
          manualChunks: undefined,
        },
      },
      terserOptions: {
        compress: {
          drop_console: true,
        },
        format: {
          comments: false,
        },
      },
    },
    test: {
      globals: true,
      environment: "jsdom",
      setupFiles: "./src/__tests__/setup.ts",
      css: true,
    },
  };

  if (isTizen || isWebOS) {
    baseConfig.esbuild = {
      minifyIdentifiers: false,
      legalComments: "none",
      target: "es6",
      include: /\.(ts|jsx|tsx)$/,
      define: {
        "import.meta.url": JSON.stringify(""),
      },
    };
  }
  return baseConfig;
});
```

### Platform Configuration Files

> To streamline the configuration process, create the following configuration files to handle platform-specific tweaks. All configuration file ander config folder:

In the main `App.js` wrap the app in a SpatialNavigation provider:
```js
import Layout from "@/components/layout";
import { NavigationProvider } from "@/context";
import Home from "@/pages/home";
import Movies from "@/pages/movies";
import Series from "@/pages/series";
import Sports from "@/pages/sports";
import { init } from "@noriginmedia/norigin-spatial-navigation";
import { createMemoryRouter, RouterProvider } from "react-router-dom";

init({
  debug: false,
  visualDebug: false,
  distanceCalculationMethod: "center",
});
const Providers = () => {
  return (
    <NavigationProvider>
      <Layout />
    </NavigationProvider>
  )
}
const route = [{
  path: "/",
  Component: Providers,
  children: [
    {
      index: true,
      Component: Home,
    },
    {
      path: "movies",
      Component: Movies,
    },
    {
      path: "series",
      Component: Series,
    },
    {
      path: "sports",
      Component: Sports,
    },
  ],
}];
const router = createMemoryRouter(route);

export default function App() {
  return (
    <RouterProvider router={router} fallbackElement={<Fallback />} />
  );
}
export function Fallback() {
  return <>Loading</>;
}
```

**Define Focusable Components:**
Use the Focusable component to make elements navigable. Here’s an example:

`home.tsx`
```js
import ContentRow from "@/components/ContentRow";
import SelectedRow from "@/components/SelectedRow";
import { FocusContext, useFocusable } from "@noriginmedia/norigin-spatial-navigation";
import { useCallback, useEffect, useState } from "react";

const Home = () => {
    const { ref, focusKey, focusSelf } = useFocusable({ focusKey: "CONTENT" });
    const [selectedAsset, setSelectedAsset] = useState(null);
    
    useEffect(() => {
        focusSelf();
    }, [focusSelf]);

    const onAssetPress = useCallback((asset) => {
        setSelectedAsset(asset);
    }, []);

    const onRowFocus = useCallback(
        ({ y }: { y: number }) => {
            ref.current.scrollTo({
                top: y,
                behavior: 'smooth'
            });
        },
        [ref]
    );

    return (
        <FocusContext.Provider value={focusKey}>
            <div className="flex flex-col h-full w-full">
                <SelectedRow selectedAsset={selectedAsset} />
                <div className="overflow-y-auto flex-1" ref={ref}>
                    <div className="space-y-5">
                        {rows.map(({ title }) => (
                            <ContentRow
                                key={title}
                                title={title}
                                onAssetPress={onAssetPress}
                                onFocus={onRowFocus}
                            />
                        ))}
                    </div>
                </div>
            </div>
        </FocusContext.Provider>
    );
};

export default Home;
```

`ContentRow.tsx` component
```js
import { FocusContext, useFocusable } from "@noriginmedia/norigin-spatial-navigation";
import { useCallback, useRef } from "react";
import Asset from "./Asset";
const ContentRow = ({ title, onAssetPress, onFocus }) => {
    const { ref, focusKey } = useFocusable({
        onFocus
    });
    const scrollingRef = useRef(null);
    const onAssetFocus = useCallback(
        ({ x }: { x: number }) => {
            scrollingRef.current.scrollTo({
                left: x,
                behavior: 'smooth'
            });
        },
        [scrollingRef]
    );

    return (
        <FocusContext.Provider value={focusKey}>
            <div
                ref={ref}
            >
                <div className="text-2xl font-medium text-white pb-4 ">{title}</div>
                <div className="overflow-x-auto overflow-y-hidden" ref={scrollingRef}>
                    <div className="flex gap-2">
                        {assets.map(({ title, color }) => (
                            <Asset
                                key={title}
                                title={title}
                                color={color}
                                onEnterPress={onAssetPress}
                                onFocus={onAssetFocus}
                            />
                        ))}
                    </div>
                </div>
            </div>
        </FocusContext.Provider>
    )
}
export default ContentRow
```
This setup provides a solid foundation for navigation in your Smart TV app. Focus states and navigation paths are handled automatically by the spatial navigation library, enhancing the user experience on TV devices.

**Start the Development Server:**
```bash
npm run dev
```
**Build for Production:**
To create platform-specific builds, set the WEBPACK_MODE environment variable and build:
```bash
npm run build
```
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.

cove

cove

Cove is a minimal TanStack Start starter template maintained by mugnavo, integrating React, TanStack Router/Query, Tailwind CSS, shadcn/ui, Drizzle ORM with PostgreSQL, Better Auth, Vite Plus, and Nitro.

Vite · SaaS

vite-react-boilerplate

vite-react-boilerplate

A production-ready Vite + React starter template with TypeScript, Tailwind CSS, TanStack Router/Query/Table, Storybook, React Hook Form + Zod, Vitest and Playwright testing, plus Husky/Commitizen/Commitlint commit conventions.

Vite · Starter

vital

vital

Vital is a Vite-based React starter template using TypeScript and Tailwind CSS, with an Atomic Design component directory, path aliases and Hero Icons.

Vite · Starter

react-vite-admin

react-vite-admin

A backend management starter built on Vite and React, integrating Recoil, React Query, TypeScript, and Axios, with Ant Design-style interface screenshots. Suitable as a starting point for management-side projects, licensed under MIT, with Chinese documentation and common scripts.

Vite · Admin dashboard

typescript-react_best_practices-vite_template

typescript-react_best_practices-vite_template

A Vite + React + TypeScript starter template by CodelyTV, preconfigured with Jest and React Testing Library unit tests, Cypress end-to-end tests, ESLint and Prettier using Codely's shared configuration, GitHub Actions workflows, a Makefile, and Sass.

Vite · Starter

cloudflare-starter-kit

cloudflare-starter-kit

A Cloudflare Workers project scaffolding template maintained by kriasoft, using Vite and TypeScript, with three built-in workspaces: api, app, and edge, and preconfigured local testing, multiple environments, and a GitHub Actions deployment workflow.

Vite · Starter