OpenWatch is a modern Watch streaming platform built with Next.js. It focuses on Watch discovery, playback, authenticated Watch progress, user profiles, XP-based gamification, leaderboards, and a scalable domain plugin architecture.
Author: Nikhil Mathew
OpenWatch is currently Watch-first. Comics have been removed from the active application codebase, routes, dashboard, profile data, and documentation.
The main user flow is:
- Open
/for the public landing/discovery entry. - Browse Watch from
/watchor/home. - Search Watch from
/watch/searchor/search. - View Watch details at
/watch/[id]. - Watch episodes at
/watch/[id]/watch. - Track Watch progress from Watch pages and the user dashboard.
- Earn XP and level progress as episodes are updated.
- View profile, history, stats, and leaderboard progress from
/user,/profile/[username], and/leaderboard.
The app is moving toward a factory/plugin architecture so shared layouts and UI components do not need to change whenever a new content domain is added.
Core layers:
src/appcontains thin route entry points and Next.js App Router files.src/components/uicontains shared UI primitives such as buttons, cards, loaders, badges, inputs, progress bars, skeletons, and carousel utilities.src/components/layoutcontains shared app shell pieces such as header, footer, page containers, and domain shell wrappers.src/configexposes domain configuration lookup used by shared UI.src/pluginscontains the domain plugin factory and registries.src/features/watchcontains the Watch domain plugin, config, pages, API adapter, and hooks.src/features/progresscontains progress tracking API/hook utilities.src/contextcontains app-level providers such as authentication.src/libcontains shared backend/client infrastructure such as MongoDB, JWT, and API client utilities.
New domains should be added through the plugin layer, not by modifying shared layouts or core components.
Current Watch plugin files:
src/features/WATC./watch.config.jssrc/features/watch/plugin.jssrc/features/WATC./pages/watchHomePage.jsxsrc/features/watch/api/watch.api.jssrc/features/watch/hooks/useWatchQueries.js
Shared plugin infrastructure:
src/plugins/createDomainPlugin.jssrc/plugins/domainRegistry.jssrc/plugins/domainConfigRegistry.js
Route entry points can resolve domain pages through the registry:
import { createRegisteredDomainPage } from "@/plugins/domainRegistry";
export default createRegisteredDomainPage("watch", "home");The goal is that a future domain, such as Drama, can be implemented by creating src/features/drama, registering its config/plugin, and adding thin route files. Shared layout, UI primitives, authentication, loaders, and API client behavior should remain unchanged.
OpenWatch uses a pure black foundation with semantic tokens and domain accents.
- Global background: black or near-black.
- Shared surfaces: charcoal panels and cards.
- Text: white primary text and muted gray secondary text.
- Watch accent: orange.
- Future domain accents should be registered in domain config only.
Shared UI should consume semantic variables such as accent, surface, border, foreground, and muted text rather than hardcoding domain colors in individual components.
- Watch data is fetched through the Watch API service adapter in
src/features/watch/api/watch.api.js. - Tenrai provider details should stay inside the Watch API layer.
- Auth, profile, progress, settings, and leaderboard data are handled by internal Next.js API routes under
src/app/api. - MongoDB is used for user data and progress persistence.
OpenWatch supports authenticated user flows:
- Register and login.
- Remembered sessions using secure cookies.
- User dashboard and public profile pages.
- Watch progress tracking.
- Watchlist status management.
- XP and level calculation.
- Leaderboard integration.
Progress behavior should remain stable:
- Episode progress updates are synchronized with the server.
- User XP/level state updates through authenticated progress actions.
- Dashboard and profile pages read progress from internal user APIs.
/- Landing/discovery page./home- Watch home alias./watch- Watch homepage/discovery./watch/[id]- Watch detail page./watch/[id]/watch- Watch Watch/player page./watch/search- Watch search./watch/genres- Watch genre discovery./watch/schedule- Watch weekly schedule./watch/rankings- Watch rankings./search- Global Watch search entry./login- Login page./register- Register page./user- Authenticated user dashboard./user/setting- User settings./profile/[username]- Public profile page./leaderboard- Leaderboard page.
Undefined routes should fall through to the app's 404 page.
This repository uses three branch prefixes/types:
feat/*for feature work.fix/*for bug fixes.release/*for stable release branches.
Stable release flow:
- Build feature work on a
feat/*branch. - Merge completed feature work into a
release/*branch, such asrelease/1.0. - Merge the stable release branch into
master. - Keep
masteras the latest stable code.
Current release path:
feat/openWatch-initial -> release/1.0 -> masterInstall dependencies:
pnpm installCreate an environment file:
MONGODB_URI=mongodb://localhost:27017/openWatch
PROVIDER_API_URL=https://api.tenrai.org/v1Run the development server:
pnpm devBuild for production:
pnpm build
pnpm startLint:
pnpm lint- Use
pnpmfor this project. - Do not commit
.env. - Keep route files thin where possible.
- Keep provider-specific API logic inside feature API adapters.
- Keep new domain functionality inside the domain plugin layer.
- Avoid reintroducing Comics routes or manga/chapter progress unless that domain is intentionally rebuilt as a new plugin.