feat(sprint1-step6): polish, landing page, responsive, deploy config
- Landing.jsx : écran d'accueil "Entrer dans le Marais" sur / - Home.jsx : jeu sur /jeu, click animation float-up, sidebar responsive - formatNumber.ts : util partagé k/M/B/T (remplace 4 copies locales) - home.scss : rewrite classes (game-cover, click-zone, tadpole-sprite, game-sidebar) - Responsive : sidebar fixe desktop, drawer bottom mobile (<768px) - navbar : wildCoin → resource-counter, auth-nav stylé, dead code supprimé - GameSync.tsx : bridge useSaveSync ↔ Zustand (câblé dans App) - tadpole.svg : asset renommé (SantaClause-bag → tadpole) - deploy/ : Apache vhost SPA+proxy, deploy.sh, ecosystem.config.cjs PM2 - NavBarData : Jeu → /jeu - Cleanup : dead imports, commentaires legacy
This commit is contained in:
44
deploy/clickerz.tetardtek.com.conf
Normal file
44
deploy/clickerz.tetardtek.com.conf
Normal file
@@ -0,0 +1,44 @@
|
||||
# Apache vhost — clickerz.tetardtek.com
|
||||
# Frontend: static build served from /var/www/clickerz
|
||||
# Backend API: reverse proxy to pm2 on port 3310
|
||||
|
||||
<VirtualHost *:80>
|
||||
ServerName clickerz.tetardtek.com
|
||||
RewriteEngine On
|
||||
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:443>
|
||||
ServerName clickerz.tetardtek.com
|
||||
|
||||
# SSL (certbot)
|
||||
SSLEngine on
|
||||
SSLCertificateFile /etc/letsencrypt/live/clickerz.tetardtek.com/fullchain.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/clickerz.tetardtek.com/privkey.pem
|
||||
|
||||
# Frontend — SPA static files
|
||||
DocumentRoot /var/www/clickerz
|
||||
<Directory /var/www/clickerz>
|
||||
Options -Indexes +FollowSymLinks
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
|
||||
# SPA fallback — all non-file routes → index.html
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteRule . /index.html [L]
|
||||
</Directory>
|
||||
|
||||
# Backend API — reverse proxy
|
||||
ProxyPreserveHost On
|
||||
ProxyPass /api http://127.0.0.1:3310/api
|
||||
ProxyPassReverse /api http://127.0.0.1:3310/api
|
||||
|
||||
# Security headers
|
||||
Header always set X-Content-Type-Options "nosniff"
|
||||
Header always set X-Frame-Options "DENY"
|
||||
Header always set Referrer-Policy "strict-origin-when-cross-origin"
|
||||
</VirtualHost>
|
||||
39
deploy/deploy.sh
Executable file
39
deploy/deploy.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# deploy.sh — Build & deploy clickerz to VPS
|
||||
# Usage: ssh vps 'cd /opt/clickerz && bash deploy/deploy.sh'
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== Clickerz deploy ==="
|
||||
|
||||
# 1. Pull latest
|
||||
git pull --ff-only
|
||||
|
||||
# 2. Build frontend
|
||||
echo "--- Building frontend..."
|
||||
cd Frontend
|
||||
npm ci --production=false
|
||||
npm run build
|
||||
echo "--- Copying dist to /var/www/clickerz..."
|
||||
sudo rm -rf /var/www/clickerz
|
||||
sudo cp -r dist /var/www/clickerz
|
||||
cd ..
|
||||
|
||||
# 3. Backend deps
|
||||
echo "--- Installing backend deps..."
|
||||
cd Backend
|
||||
npm ci --production
|
||||
cd ..
|
||||
|
||||
# 4. Run migrations
|
||||
echo "--- Running DB migrations..."
|
||||
cd Backend
|
||||
npm run db:migrate
|
||||
cd ..
|
||||
|
||||
# 5. Restart pm2
|
||||
echo "--- Restarting pm2..."
|
||||
pm2 startOrRestart ecosystem.config.cjs --env production
|
||||
pm2 save
|
||||
|
||||
echo "=== Deploy complete ==="
|
||||
Reference in New Issue
Block a user