fix: TypeScript build errors and add production deployment

- Fix handle color type safety
- Fix RoundedBox args tuple type
- Remove invalid ellipseGeometry
- Add PM2 ecosystem config
- Add SSL setup automation script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu
2026-02-10 18:37:42 +00:00
parent b30e8d18d4
commit 32ed02c1f3
3 changed files with 153 additions and 19 deletions

View File

@@ -26,15 +26,15 @@ const HandleMaterial = ({ color }: { color: string }) => (
* Classic industrial style, common on steel pivot doors
*/
export function Beugelgreep({ finish, doorHeight, railDepth }: HandleProps) {
const color = {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
}[finish] || "#1a1a1a") as string;
const handleLength = Math.min(doorHeight * 0.35, 0.8); // Max 80cm
const barDiameter = 0.025; // 25mm diameter bar
const mountBlockSize = [0.04, 0.06, 0.03]; // Mount block dimensions
const mountBlockSize: [number, number, number] = [0.04, 0.06, 0.03]; // Mount block dimensions
return (
<group position={[0, 0, railDepth / 2 + 0.02]}>
@@ -83,11 +83,11 @@ export function Beugelgreep({ finish, doorHeight, railDepth }: HandleProps) {
* Minimalist flush-mount design
*/
export function Hoekgreep({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
}[finish] || "#1a1a1a") as string;
const horizontalLength = 0.15; // 15cm horizontal
const verticalLength = 0.12; // 12cm vertical
@@ -132,11 +132,11 @@ export function Hoekgreep({ finish, doorWidth, railDepth, stileWidth }: HandlePr
* Elegant curved design for flush doors
*/
export function Maangreep({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
}[finish] || "#1a1a1a") as string;
const curveRadius = 0.08; // 8cm radius
const handleDepth = 0.025; // 25mm deep recess
@@ -179,11 +179,11 @@ export function Maangreep({ finish, doorWidth, railDepth, stileWidth }: HandlePr
* Modern minimalist design
*/
export function Ovaalgreep({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
}[finish] || "#1a1a1a") as string;
// Create oval shape using THREE.Shape
const shape = new THREE.Shape();
@@ -217,12 +217,6 @@ export function Ovaalgreep({ finish, doorWidth, railDepth, stileWidth }: HandleP
<extrudeGeometry args={[shape, extrudeSettings]} />
<HandleMaterial color={color} />
</mesh>
{/* Inner void (make it a ring, not solid) */}
<mesh position={[0, 0, 0.01]}>
<ellipseGeometry args={[rx * 0.7, ry * 0.7, 32]} />
<meshBasicMaterial color="#fafafa" />
</mesh>
</group>
);
}
@@ -232,11 +226,11 @@ export function Ovaalgreep({ finish, doorWidth, railDepth, stileWidth }: HandleP
* Classic hinged door handle
*/
export function Klink({ finish, doorWidth, railDepth, stileWidth }: HandleProps) {
const color = {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
}[finish] || "#1a1a1a") as string;
const leverLength = 0.12; // 12cm lever
const leverThickness = 0.015; // 15mm thick
@@ -285,11 +279,11 @@ export function Klink({ finish, doorWidth, railDepth, stileWidth }: HandleProps)
* Straight vertical bar for pivot doors
*/
export function UGreep({ finish, railDepth }: HandleProps) {
const color = {
const color = ({
zwart: "#1a1a1a",
brons: "#8B6F47",
grijs: "#525252",
}[finish];
}[finish] || "#1a1a1a") as string;
return (
<RoundedBox

16
ecosystem.config.js Normal file
View File

@@ -0,0 +1,16 @@
module.exports = {
apps: [{
name: 'proinn-configurator',
script: 'node_modules/next/dist/bin/next',
args: 'start -p 3002',
cwd: '/home/anisy/projects/stalendeuren',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
PORT: 3002
}
}]
};

124
setup-ssl.sh Executable file
View File

@@ -0,0 +1,124 @@
#!/bin/bash
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
NC='\033[0m'
DOMAIN="proinn.youztech.nl"
TARGET_IP="141.95.17.59"
echo -e "${YELLOW}Checking DNS for $DOMAIN...${NC}"
# Check current DNS
CURRENT_IP=$(host $DOMAIN | grep "has address" | awk '{print $4}')
if [ "$CURRENT_IP" != "$TARGET_IP" ]; then
echo -e "${RED}DNS not updated yet!${NC}"
echo "Current IP: $CURRENT_IP"
echo "Target IP: $TARGET_IP"
echo ""
echo "Please update DNS first, then run this script again."
exit 1
fi
echo -e "${GREEN}✓ DNS is correct!${NC}"
echo ""
echo -e "${YELLOW}Requesting SSL certificate...${NC}"
# Request SSL certificate
sudo certbot certonly --webroot -w /var/www/html -d $DOMAIN \
--non-interactive --agree-tos --email admin@youztech.nl
if [ $? -ne 0 ]; then
echo -e "${RED}SSL certificate request failed!${NC}"
exit 1
fi
echo -e "${GREEN}✓ SSL certificate obtained!${NC}"
echo ""
echo -e "${YELLOW}Updating nginx configuration for HTTPS...${NC}"
# Update nginx config with SSL
sudo tee /etc/nginx/sites-available/$DOMAIN > /dev/null <<'EOF'
server {
listen 80;
listen [::]:80;
server_name proinn.youztech.nl;
location /.well-known/acme-challenge/ {
root /var/www/html;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name proinn.youztech.nl;
ssl_certificate /etc/letsencrypt/live/proinn.youztech.nl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/proinn.youztech.nl/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
location / {
proxy_pass http://127.0.0.1:3002;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
proxy_read_timeout 300s;
proxy_connect_timeout 75s;
}
# Optimize for Next.js static assets
location /_next/static {
proxy_pass http://127.0.0.1:3002;
proxy_cache_valid 60m;
add_header Cache-Control "public, immutable, max-age=31536000";
}
# Optimize for images
location ~* \.(jpg|jpeg|png|gif|ico|svg|webp)$ {
proxy_pass http://127.0.0.1:3002;
expires 30d;
add_header Cache-Control "public, immutable";
}
}
EOF
# Test nginx config
sudo nginx -t
if [ $? -ne 0 ]; then
echo -e "${RED}Nginx configuration test failed!${NC}"
exit 1
fi
# Reload nginx
sudo systemctl reload nginx
echo -e "${GREEN}✓ Nginx reloaded with HTTPS!${NC}"
echo ""
echo -e "${GREEN}═══════════════════════════════════════════${NC}"
echo -e "${GREEN} 🎉 DEPLOYMENT COMPLETE! 🎉${NC}"
echo -e "${GREEN}═══════════════════════════════════════════${NC}"
echo ""
echo -e "Your site is now live at:"
echo -e "${GREEN}https://proinn.youztech.nl/offerte${NC}"
echo ""
echo "SSL certificate will auto-renew via certbot."