Prerequisites
- Node.js (version 18 or higher recommended)
- npm, yarn, or pnpm package manager
Installation
Available Scripts
Development
Start the Vite development server with hot module replacement:http://localhost:8080/ (configured in vite.config.ts).
Build
Create a production build with TypeScript type checking:- Runs TypeScript compiler in build mode (
tsc -b) - Builds optimized production bundle with Vite
- Outputs to
dist/directory
Preview
Preview the production build locally:Linting
Run ESLint to check code quality:Testing
Run tests in watch mode (interactive):Development Configuration
Vite Configuration
The development server is configured invite.config.ts:
- React SWC plugin: Fast refresh and JSX transformation
- Path alias:
@/maps tosrc/for cleaner imports - Dev server port: 8080
Tailwind Configuration
Tailwind is configured to scan HTML and source files:Project Conventions
Styling Rules
- Tailwind utilities for layout, spacing, and typography structure
- CSS variables (from
index.css) for colors/fonts via inlinestylewhen dynamic or unavailable as utilities - No hardcoded hex colors - add/modify variables in
index.cssinstead - Animations defined in
index.css, applied via utility classes
Import Paths
Always use the@/ path alias for internal imports:
Component Organization
- Keep components focused and single-purpose
- Colocate related utilities with components when appropriate
- Use TypeScript interfaces for all component props
- Export types alongside components when reusable
Debugging Tips
Web Worker Debugging
To debug the split worker in Chrome/Edge DevTools:- Open DevTools (
F12) - Go to Sources tab
- Look for
splitWorker.tsunder “Threads” - Set breakpoints as needed
Theme Debugging
The theme state is stored inlocalStorage:
Development Tools
- React DevTools: Browser extension for component inspection
- Vite DevTools: Built-in HMR overlay for errors
- TypeScript: Inline errors in your IDE (VS Code recommended)
Common Issues
Port Already in Use
If port 8080 is already taken, you can change it invite.config.ts or set the PORT environment variable: