Starting the Development Server
Run the development server with Hot Module Replacement (HMR):http://localhost:5173 by default.
Vite’s HMR provides instant feedback when you save changes to your files.
Available Scripts
The project includes several npm scripts defined inpackage.json:
| Script | Command | Description |
|---|---|---|
dev | vite | Start development server with HMR |
start | vite | Alternative command to start dev server |
build | vite build | Build for production |
preview | vite preview | Preview production build locally |
lint | eslint . | Run ESLint on the entire codebase |
Building for Production
Create an optimized production build:dist/ directory.
Preview Production Build
Test the production build locally:Project Structure
Understand the organization of the source code:The project follows a feature-based structure with clear separation between components, pages, and utilities.
Hot Module Replacement (HMR)
Vite provides Fast Refresh for React components:Fast Refresh Best Practices
Single Component per File
Export only one component per file for optimal HMR
Named Exports
Use named exports for components when possible
Hooks at Top Level
Keep hooks at the top level of components
Avoid Anonymous Functions
Use named function components for better debugging
Code Quality with ESLint
Run linting to check code quality:ESLint Rules
The project enforces several important rules:- React Hooks Rules - Ensures hooks are used correctly
- React Refresh - Validates Fast Refresh compatibility
- No Unused Variables - With exception for uppercase/constant patterns
- ES2020+ Features - Modern JavaScript syntax allowed
ESLint runs on all
.js and .jsx files, ignoring the dist directory.Theme Development
The project includes dark/light theme support usingnext-themes:
Theme Colors
Tailwind is configured with neutral as the base color incomponents.json, using CSS variables for dynamic theme switching.
Internationalization Development
Add or modify translations in the locale files:Debugging Tips
React DevTools
Install React DevTools browser extension for component inspection
Vite Network Access
Use
--host flag to access dev server from other devicesClear Cache
Delete
node_modules/.vite to clear Vite’s dependency cacheSource Maps
Vite provides source maps automatically in development mode
Next Steps
Components
Explore available UI components
Deployment
Learn how to deploy your application