Important: Always run build and deploy commands from the project root directory:
cd /home/ishaglcy/public_html/yahudim.appTo build the frontend, use:
npm run buildTo deploy, use:
npm run deployIf deploying on a platform (e.g., Render), set the working directory to /home/ishaglcy/public_html/yahudim.app and the build command to npm run build.
Your index.html must be present in the project root for Vite to build successfully.
This guide explains how to deploy the Rise Yahudim application with the backend API.
- Frontend: React + Vite (served as static files)
- Backend: Node.js Express API (running on port 3001)
- Database: JSON file-based storage
-
Navigate to the API directory:
cd /home/ishaglcy/public_html/yahudim.app/api -
Create a
.envfile from the example:cp .env.example .env
-
Edit the
.envfile:PORT=3001 NODE_ENV=production CORS_ORIGIN=https://yahudim.app
-
Install dependencies (if not already done):
npm install
-
Start the backend server:
node server.js
Or use a process manager like PM2 for production:
pm2 start server.js --name rise-yahudim-api pm2 save pm2 startup
-
Navigate to the project root:
cd /home/ishaglcy/public_html/yahudim.app -
Install dependencies:
npm install
-
Build for production:
npm run build
-
The production files will be in the
distdirectory. Deploy these to your web server.
Add to your virtual host configuration:
<VirtualHost *:443>
ServerName yahudim.app
DocumentRoot /home/ishaglcy/public_html/yahudim.app/dist
# Proxy API requests to backend
ProxyPass /api http://localhost:3001/api
ProxyPassReverse /api http://localhost:3001/api
ProxyPass /health http://localhost:3001/health
ProxyPassReverse /health http://localhost:3001/health
# Serve React app for all other routes
<Directory /home/ishaglcy/public_html/yahudim.app/dist>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
# React Router support
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</Directory>
SSLEngine on
SSLCertificateFile /path/to/cert.pem
SSLCertificateKeyFile /path/to/key.pem
</VirtualHost>server {
listen 443 ssl http2;
server_name yahudim.app;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
root /home/ishaglcy/public_html/yahudim.app/dist;
index index.html;
# API proxy
location /api {
proxy_pass http://localhost:3001;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /health {
proxy_pass http://localhost:3001;
}
# React Router support
location / {
try_files $uri $uri/ /index.html;
}
}-
Check backend health:
curl http://localhost:3001/health
-
Test API endpoints:
curl http://localhost:3001/api/quiz/questions curl http://localhost:3001/api/notes
-
Visit the site:
https://yahudim.app
To run in development mode:
-
Start the backend:
cd api node server.js -
Start the frontend (in a new terminal):
npm run dev
The Vite dev server will proxy API requests to the backend automatically.