Skip to content

Aditya24Kashyap/WatchAlong

Repository files navigation

WatchAlong 🎬

A modern, collaborative streaming companion application built with React, TypeScript, and Vite. Watch your favorite content together with synchronized playback, real-time features, and an intuitive user experience.


πŸ“‹ Table of Contents


🎯 Overview

WatchAlong is a collaborative media synchronization platform designed to bring people together for a shared viewing experience. Whether it's movies, shows, or live streams, WatchAlong ensures seamless synchronization across all participants with real-time updates, interactive features, and a modern, responsive UI.

Key Highlights

  • ⚑ Lightning-fast development with Vite
  • 🎨 Beautiful UI powered by Tailwind CSS & shadcn/ui
  • πŸ“± Fully responsive design for all devices
  • πŸ”„ Real-time synchronization capabilities
  • πŸ›‘οΈ Type-safe development with TypeScript
  • πŸš€ Production-ready with best practices

✨ Features

Current Features (MVP)

  • Modern React-based UI framework
  • TypeScript for type safety
  • Responsive design system
  • Component-driven architecture
  • Hot Module Replacement (HMR) for fast development

Planned Features (Coming Soon)

  • User authentication & authorization
  • Room/Session management
  • Synchronized media playback
  • Real-time chat integration
  • User presence indicators
  • Watch history tracking
  • Playlist creation & sharing
  • Dark mode support
  • Mobile app version
  • Premium features & subscriptions

πŸ› οΈ Tech Stack

Frontend

Technology Version Purpose
React Latest UI framework
TypeScript 5.x Type-safe JavaScript
Vite 5.x Ultra-fast build tool
Tailwind CSS 3.x Utility-first CSS framework
shadcn/ui Latest Component library
PostCSS Latest CSS processing
ESLint Latest Code quality & linting

Development Tools

Tool Purpose
Bun Fast JavaScript runtime & package manager
npm Package manager (fallback)
TypeScript Compiler Type checking
Vite Dev Server Local development & HMR

Styling

  • Tailwind CSS with custom theme extensions
  • PostCSS for advanced CSS processing
  • CSS Modules ready (via Tailwind)

πŸ“ Project Architecture

Architecture Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   WatchAlong App                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Pages      β”‚  β”‚  Components  β”‚  β”‚  Hooks   β”‚ β”‚
β”‚  β”‚              β”‚  β”‚              β”‚  β”‚          β”‚ β”‚
β”‚  β”‚ - Home       β”‚  β”‚ - Header     β”‚  β”‚ - useSyncβ”‚ β”‚
β”‚  β”‚ - Room       β”‚  β”‚ - Player     β”‚  β”‚ - useRoomβ”‚ β”‚
β”‚  β”‚ - Profile    β”‚  β”‚ - Chat       β”‚  β”‚ - useMen β”‚ β”‚
β”‚  β”‚ - Settings   β”‚  β”‚ - Controls   β”‚  β”‚ - Custom β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚         β”‚                β”‚                β”‚         β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚                          β”‚                          β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚              β”‚    App.tsx (Root)        β”‚           β”‚
β”‚              β”‚  (State Management)      β”‚           β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                          β”‚                          β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚              β”‚      Utilities (lib/)    β”‚           β”‚
β”‚              β”‚  - API helpers           β”‚           β”‚
β”‚              β”‚  - Constants             β”‚           β”‚
β”‚              β”‚  - Validators            β”‚           β”‚
β”‚              β”‚  - Formatters            β”‚           β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                          β”‚                          β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”‚
β”‚              β”‚    Styling (Tailwind)    β”‚           β”‚
β”‚              β”‚  - Global styles         β”‚           β”‚
β”‚              β”‚  - Theme colors          β”‚           β”‚
β”‚              β”‚  - Responsive breakpointsβ”‚           β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β”‚
β”‚                                                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Architectural Principles

  1. Component-Driven: Modular, reusable components
  2. Separation of Concerns: Pages, components, hooks, utilities
  3. Type Safety: Full TypeScript coverage
  4. DRY (Don't Repeat Yourself): Utilities & hooks for shared logic
  5. Responsive First: Mobile-first design approach
  6. Performance: Code splitting, lazy loading ready

πŸ“ Project Structure

WatchAlong/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/                    # Page-level components
β”‚   β”‚   β”œβ”€β”€ HomePage.tsx         # Landing/home page
β”‚   β”‚   β”œβ”€β”€ RoomPage.tsx         # Watch room
β”‚   β”‚   β”œβ”€β”€ ProfilePage.tsx      # User profile
β”‚   β”‚   └── SettingsPage.tsx     # Settings
β”‚   β”‚
β”‚   β”œβ”€β”€ components/               # Reusable components
β”‚   β”‚   β”œβ”€β”€ common/              # Shared components
β”‚   β”‚   β”‚   β”œβ”€β”€ Header.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.tsx
β”‚   β”‚   β”‚   └── Navigation.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ player/              # Media player components
β”‚   β”‚   β”‚   β”œβ”€β”€ MediaPlayer.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ Controls.tsx
β”‚   β”‚   β”‚   └── ProgressBar.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ room/                # Room-specific components
β”‚   β”‚   β”‚   β”œβ”€β”€ RoomHeader.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ RoomControls.tsx
β”‚   β”‚   β”‚   └── UserList.tsx
β”‚   β”‚   β”‚
β”‚   β”‚   └── chat/                # Chat components
β”‚   β”‚       β”œβ”€β”€ ChatBox.tsx
β”‚   β”‚       β”œβ”€β”€ MessageList.tsx
β”‚   β”‚       └── MessageInput.tsx
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/                    # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useSync.ts           # Synchronization logic
β”‚   β”‚   β”œβ”€β”€ useRoom.ts           # Room management
β”‚   β”‚   β”œβ”€β”€ useAuth.ts           # Authentication
β”‚   β”‚   β”œβ”€β”€ usePlayer.ts         # Media player control
β”‚   β”‚   └── useTheme.ts          # Theme management
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/                      # Utility functions & helpers
β”‚   β”‚   β”œβ”€β”€ api.ts               # API client
β”‚   β”‚   β”œβ”€β”€ constants.ts         # App constants
β”‚   β”‚   β”œβ”€β”€ validators.ts        # Input validation
β”‚   β”‚   β”œοΏ½οΏ½οΏ½β”€ formatters.ts        # Data formatting
β”‚   β”‚   └── storage.ts           # Local storage helpers
β”‚   β”‚
β”‚   β”œβ”€β”€ App.tsx                   # Root component
β”‚   β”œβ”€β”€ App.css                   # App-level styles
β”‚   β”œβ”€β”€ main.tsx                  # Entry point
β”‚   β”œβ”€β”€ index.css                 # Global styles
β”‚   └── vite-env.d.ts            # Vite environment types
β”‚
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”œβ”€β”€ images/
β”‚   └── fonts/
β”‚
β”œβ”€β”€ Configuration Files
β”‚   β”œβ”€β”€ package.json              # Dependencies & scripts
β”‚   β”œβ”€β”€ tailwind.config.ts        # Tailwind CSS theme
β”‚   β”œβ”€β”€ tsconfig.json             # TypeScript base config
β”‚   β”œβ”€β”€ tsconfig.app.json         # App TypeScript config
β”‚   β”œβ”€β”€ tsconfig.node.json        # Build tools TS config
β”‚   β”œβ”€β”€ vite.config.ts            # Vite build config
β”‚   β”œβ”€β”€ components.json           # shadcn/ui config
β”‚   β”œβ”€β”€ postcss.config.js         # PostCSS pipeline
β”‚   └── eslint.config.js          # ESLint rules
β”‚
β”œβ”€β”€ .gitignore                    # Git ignore rules
β”œβ”€β”€ index.html                    # HTML entry point
β”œβ”€β”€ package-lock.json             # npm lock file
β”œβ”€β”€ bun.lockb                     # Bun lock file
└── README.md                     # This file

βš™οΈ Configuration Files Explained

package.json

Defines project dependencies, scripts, and metadata.

{
  "name": "watchalong",
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "tsc -b && vite build",
    "preview": "vite preview",
    "lint": "eslint .",
    "lint:fix": "eslint . --fix"
  },
  "dependencies": {
    "react": "^18.x",
    "react-dom": "^18.x"
  },
  "devDependencies": {
    "@types/react": "^18.x",
    "typescript": "^5.x",
    "tailwindcss": "^3.x",
    "vite": "^5.x"
  }
}

vite.config.ts

Configures Vite for development and production builds with React plugin support.

tailwind.config.ts

Extended Tailwind theme with custom colors, spacing, typography, and animations for WatchAlong branding.

tsconfig.json

TypeScript configuration for strict type checking and ES modules.

eslint.config.js

Code quality rules for consistent coding standards across the project.


πŸš€ Installation

Prerequisites

  • Node.js 18.x or higher
  • Bun 1.x (recommended) OR npm 9.x+
  • Git

Step 1: Clone the Repository

git clone https://github.com/Aditya24Kashyap/WatchAlong.git
cd WatchAlong

Step 2: Install Dependencies

Using Bun (Recommended - Faster)

bun install

Using npm (Alternative)

npm install

Step 3: Verify Installation

npm run lint

πŸ’» Development

Start Development Server

npm run dev

The application will be available at http://localhost:5173

Features

  • πŸ”₯ Hot Module Replacement (HMR): Changes reflect instantly
  • πŸ“Š Fast Refresh: Preserves component state
  • πŸ› Source Maps: Easy debugging

Code Quality

Run ESLint

npm run lint

Fix Linting Issues

npm run lint:fix

Type Check

npx tsc --noEmit

Adding New Components

1. Create Component File

# Create a new component in src/components/
touch src/components/MyComponent.tsx

2. Component Template

import { FC } from 'react';

interface MyComponentProps {
  title: string;
  onClick?: () => void;
}

const MyComponent: FC<MyComponentProps> = ({ title, onClick }) => {
  return (
    <div className="p-4 bg-white rounded-lg shadow">
      <h2 className="text-xl font-bold">{title}</h2>
      <button onClick={onClick} className="mt-4 px-4 py-2 bg-blue-500 text-white rounded">
        Click me
      </button>
    </div>
  );
};

export default MyComponent;

3. Import & Use

import MyComponent from '@/components/MyComponent';

export default function App() {
  return <MyComponent title="Hello World" />;
}

Adding Custom Hooks

touch src/hooks/useMyHook.ts
import { useState, useCallback } from 'react';

export const useMyHook = (initialValue: string) => {
  const [value, setValue] = useState(initialValue);

  const reset = useCallback(() => {
    setValue(initialValue);
  }, [initialValue]);

  return { value, setValue, reset };
};

πŸ—οΈ Build & Deployment

Build for Production

npm run build

Output will be in the dist/ directory.

Build Process

  1. TypeScript compilation & type checking
  2. Vite builds optimized bundles
  3. CSS is minified & tree-shaken
  4. JavaScript is minified & code-split

Preview Production Build

npm run preview

Deployment Options

Vercel (Recommended)

# Install Vercel CLI
npm i -g vercel

# Deploy
vercel

Netlify

  1. Connect your GitHub repository
  2. Set build command: npm run build
  3. Set publish directory: dist

Docker

FROM node:18-alpine
WORKDIR /app
COPY package.json bun.lockb ./
RUN npm install
COPY . .
RUN npm run build
EXPOSE 5173
CMD ["npm", "run", "preview"]

Traditional Hosting

npm run build
# Upload dist/ folder to your hosting provider

πŸ“¦ Dependencies Overview

Core Dependencies

  • react: UI library
  • react-dom: React rendering engine

UI & Styling

  • tailwindcss: Utility-first CSS
  • postcss: CSS processing
  • shadcn/ui: Pre-built components

Development

  • typescript: Type safety
  • vite: Build tool
  • eslint: Code quality
  • @types/react: TypeScript definitions

Optional (To Add)

{
  "react-router-dom": "^6.x",     // Routing
  "zustand": "^4.x",              // State management
  "axios": "^1.x",                // HTTP client
  "socket.io-client": "^4.x",     // Real-time communication
  "date-fns": "^2.x",             // Date utilities
  "zod": "^3.x"                   // Schema validation
}

🎨 Styling Guide

Tailwind CSS Utilities

// Colors
<div className="bg-blue-500 text-white">

// Spacing
<div className="p-4 m-2 mt-8">

// Layout
<div className="flex justify-center items-center">

// Responsive
<div className="text-sm md:text-base lg:text-lg">

// Dark Mode
<div className="dark:bg-gray-800 dark:text-white">

Custom Theme Configuration

Edit tailwind.config.ts to customize:

  • Color palette
  • Typography
  • Spacing scale
  • Breakpoints
  • Animations

πŸ” Environment Variables

Create a .env.local file in the root directory:

# API Configuration
VITE_API_URL=http://localhost:3000
VITE_API_TIMEOUT=10000

# Feature Flags
VITE_ENABLE_ANALYTICS=true
VITE_ENABLE_NOTIFICATIONS=true

# Third-party Services
VITE_SOCKET_IO_URL=http://localhost:3001

Access in your code:

const apiUrl = import.meta.env.VITE_API_URL;

πŸ§ͺ Testing (Ready to Implement)

Recommended Testing Stack

npm install --save-dev @testing-library/react @testing-library/jest-dom vitest

Example Test

import { render, screen } from '@testing-library/react';
import MyComponent from '@/components/MyComponent';

describe('MyComponent', () => {
  it('renders with title', () => {
    render(<MyComponent title="Test" />);
    expect(screen.getByText('Test')).toBeInTheDocument();
  });
});

Run Tests

npm run test

πŸ› Debugging

Browser DevTools

  • React Developer Tools (Chrome Extension)
  • Redux DevTools (if using Redux)
  • Network tab for API debugging

VS Code Extensions

{
  "recommendations": [
    "dbaeumer.vscode-eslint",
    "esbenp.prettier-vscode",
    "bradlc.vscode-tailwindcss",
    "dsznajder.es7-react-js-snippets",
    "wix.vscode-import-cost"
  ]
}

🀝 Contributing

Getting Started

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Contribution Guidelines

  • Follow the existing code style
  • Add tests for new features
  • Update documentation
  • Keep commits atomic and descriptive
  • Reference issues in commit messages

Code Standards

  • TypeScript: Strict mode enabled
  • Formatting: Use Prettier
  • Linting: Pass ESLint
  • Comments: JSDoc for public APIs
  • Testing: Minimum 80% coverage goal

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ€– Maintenance

Regular Tasks

  • Weekly: Check for security updates
  • Monthly: Update dependencies
  • Quarterly: Review architecture
  • Annually: Plan new features

Performance Monitoring

  • Monitor Core Web Vitals
  • Track error rates
  • Analyze user behavior
  • Optimize bundle size

Community

  • ⭐ Star the repository
  • 🐦 Follow on Twitter
  • πŸ’Ό Connect on LinkedIn

πŸ“Š Project Statistics

Metric Value
Language TypeScript (97.4%)
Repository Size 376 KB
Last Updated Recently
Node Version 18.x+
Package Manager Bun/npm

πŸŽ“ Learning Resources

TypeScript

React

Tailwind CSS

Vite


🎯 Quick Reference

Useful Commands

# Development
npm run dev              # Start dev server
npm run build            # Build for production
npm run preview          # Preview production build
npm run lint             # Check code quality
npm run lint:fix         # Fix linting issues

# Type Checking
npx tsc --noEmit         # Type check without emitting
npx tsc --watch          # Watch mode

# Dependencies
npm outdated             # Check for updates
npm audit                # Security audit
npm update               # Update dependencies

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages