[Unit]
Description=Spanglish Frontend (Next.js)
Documentation=https://github.com/spanglish/Spanglish
After=network.target spanglish-backend.service

[Service]
Type=simple
User=spanglish
Group=spanglish
WorkingDirectory=/home/spanglish/Spanglish/frontend
Environment=NODE_ENV=production
Environment=PORT=3019
EnvironmentFile=/home/spanglish/Spanglish/frontend/.env
ExecStart=/usr/bin/npx next start -p 3019
Restart=on-failure
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=spanglish-frontend

# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=read-only

[Install]
WantedBy=multi-user.target
