Skip to main content

Deployment Guide

VozCraft is a static web application that can be deployed to any static hosting platform. This guide covers deployment to popular hosting services including GitHub Pages, Vercel, Netlify, and traditional web servers.

Prerequisites

Before deploying, ensure you have:
1

Build the application

This creates the dist/ directory with production-ready files.
2

Test the build locally

Verify everything works at http://localhost:4173
3

Verify build output

Check that dist/ contains:
  • index.html
  • manifest.json
  • assets/ directory with JS bundles
  • Images (logo.png, logotipo.png)
Build size: The complete VozCraft build is typically 400-800 KB (150-200 KB gzipped), making it fast to deploy and serve.

Vercel Deployment

Vercel provides zero-configuration deployment with automatic builds and global CDN.

Method 1: Vercel CLI

1

Install Vercel CLI

2

Login to Vercel

Follow the authentication prompts.
3

Deploy

Vercel will:
  • Detect the project as a Vite application
  • Build automatically
  • Deploy to a preview URL
4

Deploy to production

Deploys to your production domain.

Method 2: Vercel Dashboard

1

Connect repository

  1. Go to vercel.com
  2. Click “Add New” → “Project”
  3. Import your GitHub/GitLab/Bitbucket repository
2

Configure build settings

Vercel auto-detects Vite projects. Verify settings:
  • Framework Preset: Vite
  • Build Command: npm run build
  • Output Directory: dist
  • Install Command: npm install
3

Deploy

Click “Deploy” to start the build and deployment.
Create vercel.json for custom configuration:
vercel.json
The rewrites rule ensures all routes serve index.html for SPA routing (if you add React Router later).
Vercel features:
  • ✅ Automatic builds on git push
  • ✅ Preview deployments for PRs
  • ✅ Global CDN (Edge Network)
  • ✅ Automatic HTTPS
  • ✅ Zero configuration
  • ✅ Free tier available

Netlify Deployment

Netlify offers similar features to Vercel with easy drag-and-drop deployment.

Method 1: Netlify CLI

1

Install Netlify CLI

2

Login to Netlify

3

Initialize site

Follow the prompts to create a new site or link existing one.
4

Deploy

Or for a draft deploy:

Method 2: Netlify Dashboard

1

Connect repository

  1. Go to netlify.com
  2. Click “Add new site” → “Import an existing project”
  3. Connect your Git provider and select repository
2

Configure build

Set build configuration:
  • Base directory: (leave empty)
  • Build command: npm run build
  • Publish directory: dist
3

Deploy

Click “Deploy site” to start the build.

Method 3: Drag and Drop

1

Build locally

2

Upload dist folder

  1. Go to Netlify Dashboard
  2. Drag and drop the dist/ folder onto the upload area
  3. Netlify deploys instantly
Create netlify.toml for custom configuration:
netlify.toml
Netlify features:
  • ✅ Automatic builds on git push
  • ✅ Deploy previews for PRs
  • ✅ Global CDN
  • ✅ Automatic HTTPS
  • ✅ Form handling
  • ✅ Serverless functions
  • ✅ Free tier available

GitHub Pages Deployment

Deploy VozCraft directly from your GitHub repository. Create .github/workflows/deploy.yml:
.github/workflows/deploy.yml
1

Enable GitHub Pages

  1. Go to repository Settings → Pages
  2. Source: “GitHub Actions”
2

Push workflow file

3

Wait for deployment

GitHub Actions will automatically build and deploy.View progress: Actions tab in your repository
4

Access deployed site

Your site will be available at:
Base URL configuration:If deploying to a repository page (not user/org page), update vite.config.js:
vite.config.js
This ensures assets load correctly from the subdirectory.

Method 2: gh-pages Package

1

Install gh-pages

2

Add deploy script

Update package.json:
package.json
3

Deploy

This builds and pushes to the gh-pages branch.
4

Configure GitHub Pages

  1. Go to Settings → Pages
  2. Source: “Deploy from a branch”
  3. Branch: gh-pages/ (root)
  4. Save

Traditional Web Server Deployment

Nginx

Configuration for serving VozCraft on Nginx:
/etc/nginx/sites-available/vozcraft
1

Upload build files

Or use rsync:
2

Configure Nginx

3

Set up SSL (Let's Encrypt)

Apache

Configuration for Apache web server:
/etc/apache2/sites-available/vozcraft.conf
1

Enable required modules

2

Enable site

Cloud Storage Deployment

AWS S3 + CloudFront

1

Create S3 bucket

2

Enable static website hosting

3

Upload build

4

Set up CloudFront

  1. Create CloudFront distribution
  2. Origin: S3 bucket
  3. Default root object: index.html
  4. Custom error responses: 404 → /index.html (200)
5

Configure custom domain (optional)

  1. Create SSL certificate in ACM
  2. Add CNAME to CloudFront distribution
  3. Update Route 53 DNS

Deployment Checklist

1

Pre-deployment checks

☐ Run npm run build successfully☐ Test with npm run preview☐ Verify all features work☐ Check browser console for errors☐ Test on mobile devices☐ Run Lighthouse audit
2

Configuration

☐ Set correct base URL in vite.config.js☐ Update environment variables if needed☐ Configure caching headers☐ Set up SSL/HTTPS☐ Configure SPA routing fallback
3

Post-deployment

☐ Verify site loads correctly☐ Test PWA installation☐ Check all API features (speech synthesis, audio download)☐ Verify analytics (if configured)☐ Test from different browsers and devices☐ Check performance metrics

Performance Optimization

CDN Configuration

Optimal cache headers for different file types:

Compression

Enable gzip and Brotli compression:

Security Headers

Monitoring

Error Tracking

Integrate error tracking (optional):
src/main.jsx

Analytics

Add analytics tracking:
index.html

Rollback Strategy

Always maintain ability to rollback:

Vercel/Netlify

  • Automatic deployment history
  • Instant rollback via dashboard
  • Pin deployments to specific commits

Manual Deployments

Common Deployment Issues

Cause: Server not configured for SPA routing.Solution: Configure fallback to index.html:
Cause: Incorrect base URL.Solution: Update vite.config.js:
Cause: Missing CORS headers.Solution: Add CORS headers:

Next Steps

PWA Setup

Optimize PWA installation experience

Web Speech API

Understand the core technology