Deployment & Operations

Enterprise and Military Grade Identity Verification Platform

SST deployment, backup strategies, disaster recovery, and operational procedures

Quick Start Deployment

Prerequisites
  • Node.js: v22.22.2 or higher
  • pnpm: 10.33.0 or higher
  • SST: v3.17.23
  • AWS CLI: Configured with credentials
  • AWS Account: With appropriate permissions
# Install dependencies
pnpm install

# Verify versions
node --version  # v22.22.2
pnpm --version  # 10.33.0
sst version     # 3.17.23
Deploy Commands
# Development deployment
pnpm sst deploy --stage dev

# Production deployment
pnpm sst deploy --stage prod

# Deploy with logging
./scripts/deploy-with-logging.sh

# Remove deployment
pnpm sst remove --stage dev
Warning: Never use removal: "remove" on production. Always use removal: "retain"

Current Deployment Status

Dashboard URL

https://gateguardian.dasluzes.com.br

Widget CDN

https://cdn.gateguardian.dasluzes.com.br

API Endpoint

https://80k9nkbtfb.execute-api.us-east-1.amazonaws.com

Cognito Pool

us-east-1_FLDosiGxG

Region

us-east-1

Deployment Date

2026-03-30

✅ All 8 Stacks Deployed
  • ✅ AuthStack (Cognito)
  • ✅ DatabaseStack (7 DynamoDB tables)
  • ✅ StorageStack (3 S3 buckets)
  • ✅ PackagesStack (Plan tiers)
  • ✅ FraudStack (SQS + Lambda)
  • ✅ EventStack (EventBridge)
  • ✅ ApiStack (47 routes, 59 Lambdas)
  • ✅ WebStack (CloudFront + Dashboard)

Backup Strategy

Two-Tier Backup System: Local project backups + AWS infrastructure backups
Local Project Backup

Purpose: Development files (excludes node_modules)

# Run backup
pnpm backup

# Or directly
./scripts/backup-project.sh
What Gets Backed Up:
  • ✅ All source code
  • ✅ Configuration files
  • ✅ Documentation
  • ✅ Scripts
  • ✅ .sst/outputs.json
  • ❌ node_modules (excluded)
  • ❌ Build artifacts (excluded)

Location: /Volumes/HLUZWINBAC/BAC/GATEGUARDIAN/gate-guardian_devlocal_TIMESTAMP/

AWS Infrastructure Backup

Purpose: All deployed AWS resources

# Run AWS backup
pnpm backup:aws

# Or directly
./scripts/disaster-recovery-backup.sh
What Gets Backed Up:
  • ✅ 7 DynamoDB tables (schema + data)
  • ✅ 59 Lambda functions (config + policies)
  • ✅ 3 S3 buckets (full sync)
  • ✅ Cognito User Pool (config + users)
  • ✅ API Gateway (all routes)
  • ✅ CloudFront distribution
  • ✅ SQS queues + EventBridge rules
  • ✅ Git repository bundle

Location: /Volumes/HLUZWINBAC/BAC/GATEGUARDIAN/disaster-recovery-TIMESTAMP/

Backup Frequency
Local Backup
  • Recommended: Daily during active development
  • Minimum: Before major changes or deployments
  • Critical: Before any destructive operations
AWS Backup
  • Recommended: Weekly
  • Critical: Before production deployments
  • After: Major data changes or user registrations

Disaster Recovery

RTO: 4 hours | RPO: 1 hour
Recovery Procedure
Step 1: Restore Git Repository
cd /path/to/recovery/location
git clone /Volumes/HLUZWINBAC/BAC/GATEGUARDIAN/disaster-recovery-TIMESTAMP/gate-guardian-repo-TIMESTAMP.bundle gate-guardian-recovered
cd gate-guardian-recovered
Step 2: Install Dependencies
pnpm install
Step 3: Restore DynamoDB Tables
# For each table (7 tables total)
aws dynamodb create-table --cli-input-json file://schema--TIMESTAMP.json --region us-east-1

# Wait for table to be active, then restore data
aws dynamodb batch-write-item --request-items file://data--TIMESTAMP.json --region us-east-1
Step 4: Deploy Infrastructure
pnpm sst deploy --stage dev
Step 5: Restore S3 Bucket Contents
# Get new bucket names from SST outputs
cat .sst/outputs.json

# Sync biometrics
aws s3 sync /Volumes/HLUZWINBAC/BAC/GATEGUARDIAN/disaster-recovery-TIMESTAMP/s3-sync/biometrics-bucket s3:// --region us-east-1

# Sync documents
aws s3 sync /Volumes/HLUZWINBAC/BAC/GATEGUARDIAN/disaster-recovery-TIMESTAMP/s3-sync/documents-bucket s3:// --region us-east-1

# Sync voiceprints
aws s3 sync /Volumes/HLUZWINBAC/BAC/GATEGUARDIAN/disaster-recovery-TIMESTAMP/s3-sync/voiceprints-bucket s3:// --region us-east-1
Step 6: Verify All Services
# Test API Gateway
curl https:///health

# Test Dashboard
open https://

# Test authentication flow
# Test all 6 verification factors
# Test fraud detection
# Test tenant isolation

Monitoring & Observability

CloudWatch Metrics
Lambda:
  • Invocations
  • Duration
  • Errors
  • Throttles
DynamoDB:
  • ConsumedReadCapacityUnits
  • ConsumedWriteCapacityUnits
  • UserErrors
  • SystemErrors
API Gateway:
  • Count
  • Latency
  • 4XXError
  • 5XXError
Audit Logs

Every security event logged to gg-audit-logs:

  • Login attempts (success/failure)
  • Factor verifications
  • Fraud detections
  • Admin overrides
  • IP blocks
Queryable via GSI:
  • TenantIndex: By tenant
  • TimestampIndex: By time
DEEPTRASH Logging

Automatic deployment error capture:

# View errors
cat DEEPTRASH.md

# Deploy with logging
./scripts/deploy-with-logging.sh
  • Location: Project root
  • Format: Markdown with timestamps
  • GitHub: Excluded (.gitignore)
  • Backups: Included in both backup types

Production Deployment Checklist

Pre-Deployment
  • ☑️ All tests passing
  • ☑️ Security audit complete
  • ☑️ Backup completed (local + AWS)
  • ☑️ isDev bypass removed (Phase F.1)
  • ☑️ Environment variables verified
  • ☑️ Custom domain configured
  • ☑️ SSL certificates active
Post-Deployment
  • ☑️ All 8 stacks deployed successfully
  • ☑️ API Gateway responding
  • ☑️ Dashboard accessible
  • ☑️ Cognito authentication working
  • ☑️ All 6 verification factors tested
  • ☑️ Fraud detection operational
  • ☑️ CloudWatch alarms configured