Local Development Setup
This guide walks you through setting up VozCraft for local development. VozCraft is built with React 19 and Vite, providing a fast, modern development environment with hot module replacement (HMR).Prerequisites
Before installing VozCraft, ensure you have the following installed:Node.js 18+
JavaScript runtime required for npm and build toolsDownload Node.js
Git
Version control system for cloning the repositoryDownload Git
Verify Installation
Check that Node.js and npm are installed:Recommended versions:
- Node.js: 18.x, 20.x, or 22.x LTS
- npm: 8.x or higher (comes with Node.js)
Installation Steps
Clone the repository
Clone the VozCraft source code from GitHub:Or if you’re working with a specific branch:
Replace
mateoRiosdev/vozcraft with the actual repository URL if different.Install dependencies
Install all required npm packages:This installs all dependencies listed in
package.json:package.json
Start the development server
Launch the Vite development server:You should see output similar to:
Vite uses port 5173 by default. If this port is busy, Vite will automatically try the next available port (5174, 5175, etc.).
Project Structure
Once installed, your VozCraft directory will look like this:Key Files
src/App.jsx - Main Application
src/App.jsx - Main Application
The primary React component containing all VozCraft functionality:
- Lines 1-53: Configuration constants (voices, moods, speeds)
- Lines 108-139: GenderToggle component
- Lines 141-209: Custom Select component
- Lines 211-269: RenameModal component
- Lines 271-373: AudioPlayer component
- Lines 375-490: HistoryItem component
- Lines 492-554: Audio generation function
- Lines 556-571: WAV encoding function
- Lines 610-1040+: Main VozCraft component
- Web Speech API integration
- Audio generation and download
- History management
- Multi-language support (Spanish/English)
- Dark/light theme
- 22 language variants
- 8 mood presets
- 2 gender options
src/main.jsx - Entry Point
src/main.jsx - Entry Point
React application initialization:
src/main.jsx
- Mounts React app to
#rootdiv - Enables StrictMode for development warnings
- Single-component architecture (entire app in App.jsx)
index.html - HTML Template
index.html - HTML Template
Base HTML file with PWA integration:
index.html
- Minimal HTML structure
- PWA manifest link
- Module script for Vite entry point
vite.config.js - Build Configuration
vite.config.js - Build Configuration
Vite build and development configuration:What this enables:
vite.config.js
- React Fast Refresh (HMR)
- JSX transformation
- Optimized production builds
- ES modules in development
This is the minimal Vite configuration. Additional options can be added for custom build behavior.
package.json - Project Configuration
package.json - Project Configuration
Project metadata and dependencies:Key details:
package.json
"type": "module": Enables ES modules in Node.js"private": true: Prevents accidental npm publish- Zero external runtime dependencies (only React)
Available Scripts
VozCraft includes several npm scripts for development and production:- npm run dev
- npm run build
- npm run preview
- npm run lint
Starts the development server with hot module replacement:What it does:
- Starts Vite dev server on http://localhost:5173
- Enables Hot Module Replacement (HMR)
- Provides source maps for debugging
- Watches for file changes
- Fast refresh for React components
Development Workflow
Making Changes
Edit source files
Modify
src/App.jsx or other source files. Changes are reflected immediately in the browser.Hot Module Replacement (HMR)
Vite provides instant updates without full page reload:src/App.jsx
Troubleshooting
Port 5173 already in use
Port 5173 already in use
Error:Solutions:
- Kill the process using port 5173:
- Or use a different port:
Module not found errors
Module not found errors
Error:Solution:
Reinstall dependencies:
Build fails with out of memory
Build fails with out of memory
Error:Solution:
Increase Node.js memory limit:Or add to
package.json:Hot reload not working
Hot reload not working
Possible causes:
- File watchers limit reached (Linux)
- Editor saving to temp file first
- Files outside src/ directory
- Increase file watchers (Linux):
- Configure editor to save directly:
- VS Code: Disable “Hot Exit”
- WebStorm: Enable “Safe Write”
Web Speech API not working
Web Speech API not working
Possible causes:
- Browser doesn’t support Web Speech API
- No system voices installed
- Microphone permission issues
- Check browser support:
- Check available voices:
- Try Chrome or Firefox (best support)
Environment Variables
Vite supports environment variables for configuration: Create.env.local:
.env.local
IDE Setup
VS Code
Recommended extensions:.vscode/extensions.json
.vscode/settings.json
WebStorm / IntelliJ IDEA
- Enable ESLint: Settings → Languages & Frameworks → JavaScript → Code Quality Tools → ESLint
- Set Node.js interpreter: Settings → Languages & Frameworks → Node.js
- Enable automatic imports: Settings → Editor → General → Auto Import
Next Steps
Building for Production
Learn how to build and optimize VozCraft
Deployment Guide
Deploy VozCraft to various hosting platforms
