-
-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment Guide
This guide explains how to deploy SecureAuth in production environments.
SecureAuth supports deployment on VPS servers, Docker environments, and cloud platforms.
Recommended setup for production:
Component | Recommended -- | -- OS | Ubuntu 22.04+ Reverse Proxy | Nginx Process Manager | PM2 SSL | Let's Encrypt Runtime | Node.js 18+git clone https://github.com/AmitDas4321/SecureAuth.git
cd SecureAuth
npm install
Create .env
Example:
APP_NAME="SecureAuth"
APP_URL="https://yourdomain.com"
PORT=3000
TEXTSNAP_INSTANCE_ID="YOUR_INSTANCE_ID"
TEXTSNAP_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
FIREBASE_DATABASE_URL="YOUR_DATABASE_URL"
FIREBASE_DATABASE_SECRET="YOUR_DATABASE_SECRET"
JWT_SECRET="YOUR_SECRET"
ENCRYPTION_KEY="YOUR_ENCRYPTION_KEY"
Build frontend assets.
npm run build
npm start
PM2 is recommended for production process management.
npm install -g pm2
pm2 start npm --name secureauth -- start
pm2 save
pm2 startup
Install Nginx:
sudo apt install nginx -y
server {
listen 80;
server_name yourdomain.com;
location / {
proxy_pass http://127.0.0.1:3000;
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_http_version 1.1;
}
}
sudo ln -s /etc/nginx/sites-available/secureauth /etc/nginx/sites-enabled/
sudo systemctl restart nginx
Install Certbot:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d yourdomain.com
docker build -t secureauth .
docker run -d
-p 3000:3000
--env-file .env
--name secureauth-app
secureauth
SecureAuth can be deployed on:
Ubuntu VPS
Oracle Cloud
Render
Docker
aaPanel
Coolify
CapRover
Allow required ports.
Example:
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 22
For proper PWA support:
Use HTTPS
Configure correct
APP_URLEnsure icons are accessible
For production environments:
Use HTTPS only
Use strong secrets
Restrict server access
Rotate credentials regularly
Enable firewall protection
Client
β
Nginx Reverse Proxy
β
SecureAuth Backend
β
Authentication Validation
β
Firebase Storage
Check port usage:
lsof -i :3000
Check logs:
pm2 logs
Ensure backend is running.
Test:
Update vite.config.ts
server: {
allowedHosts: ['yourdomain.com']
}
Check application:
Continue with:
SecureAuth
Secure β’ Fast β’ Modern β‘