The React client is built with Vite 7 and React 19, and can be deployed to Netlify with automatic builds and deployments.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/aluxey/E-Commerce/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Netlify account
- GitHub repository connected to Netlify
- Environment variables configured in Netlify dashboard
Deployment Steps
Configure Environment Variables
Navigate to your Netlify site settings and add the following environment variables:
Review Build Configuration
The project includes a This configuration:
netlify.toml file that configures the build settings:netlify.toml
- Sets the base directory to
client/ - Runs
npm install && npm run buildfor builds - Publishes the
dist/directory - Allows Vite environment variables in secrets scanning
Deploy via Git Push
Netlify automatically deploys when you push to your connected branch:Netlify will:
- Detect the push
- Run the build command
- Deploy the
dist/folder - Provide a preview URL and production URL
Manual Deployment
Build Scripts
Theclient/package.json includes these build-related scripts:
package.json
| Script | Purpose |
|---|---|
dev | Run development server on port 5173 |
build | Create production build in dist/ |
preview | Preview production build locally |
lint | Run ESLint for code quality |
Vite Configuration
The Vite configuration atclient/vite.config.js includes:
vite.config.js
Troubleshooting
Build fails with environment variable errors
Build fails with environment variable errors
Solution: Ensure all
VITE_* variables are set in Netlify’s environment variables section, not in a .env file.Navigate to: Site settings → Environment variables → Add a variableBlank page after deployment
Blank page after deployment
Possible causes:
- Check browser console for API connection errors
- Verify
VITE_API_URLpoints to the correct backend - Ensure Supabase credentials are correct
Assets not loading (404 errors)
Assets not loading (404 errors)
Solution: Verify the
publish directory in netlify.toml is set to dist (not build or public).The Vite default output directory is dist/.Production Checklist
- All environment variables configured in Netlify
- API URL points to production backend
- Stripe publishable key is for live mode
- Supabase project is in production mode
- Custom domain configured (optional)
- HTTPS enabled (automatic on Netlify)
- Build logs show no errors
- Test user flows: catalog, cart, checkout
Next Steps
Deploy Backend
Set up the Express API server for production
Database Migrations
Run database migrations on Supabase