-
-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
This guide explains how to properly install and configure SecureAuth for development or production environments.
Before installing SecureAuth, ensure your system meets the following requirements.
Requirement | Recommended -- | -- Node.js | v18+ npm | Latest RAM | 2 GB Recommended OS | Ubuntu / Linux Recommendedgit clone https://github.com/AmitDas4321/SecureAuth.git
cd SecureAuth
Install all required packages.
npm install
Create a .env file in the project root directory.
Example configuration:
# ===============================================
SecureAuth Environment Configuration
===============================================
APP_NAME="SecureAuth"
APP_URL="http://localhost:3000"
===============================================
TEXTSNAP CONFIGURATION
===============================================
TEXTSNAP_INSTANCE_ID="YOUR_INSTANCE_ID"
TEXTSNAP_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
===============================================
FIREBASE CONFIGURATION
===============================================
FIREBASE_DATABASE_URL="YOUR_FIREBASE_DATABASE_URL"
FIREBASE_DATABASE_SECRET="YOUR_FIREBASE_DATABASE_SECRET"
===============================================
SECURITY CONFIGURATION
===============================================
JWT_SECRET="YOUR_SUPER_SECRET_KEY"
ENCRYPTION_KEY="YOUR_ENCRYPTION_KEY"
Run the application in development mode.
npm run dev
Application will be available at:
Generate production build files.
npm run build
Run SecureAuth in production mode.
npm start
SecureAuth
├── public/
├── src/
├── server.ts
├── package.json
├── vite.config.ts
├── tsconfig.json
├── .env
└── README.md
Install PM2 globally:
npm install -g pm2
Start application:
pm2 start npm --name secureauth -- start
Save PM2 process:
pm2 save
Enable startup:
pm2 startup
Example Nginx configuration:
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;
}
}
Build Docker image:
docker build -t secureauth .
Run container:
docker run -d -p 3000:3000
--env-file .env
--name secureauth-app
secureauth
For production deployments:
Use HTTPS
Enable firewall protection
Use strong JWT secrets
Rotate credentials regularly
Restrict server access
Monitor logs continuously
Check port usage:
lsof -i :3000
Kill process:
kill -9 PID
Update vite.config.ts
server: {
allowedHosts: ['yourdomain.com']
}
Reinstall dependencies:
rm -rf node_modules package-lock.json
npm install
Continue with:
SecureAuth
Secure • Fast • Modern ⚡