Centralized collection of automation scripts for development, deployment, testing, and maintenance of the AquaChain IoT water quality monitoring system.
scripts/
├── core/ # Core build and deployment utilities
├── deployment/ # Deployment automation
├── setup/ # Environment setup and configuration
├── testing/ # Testing and validation
├── security/ # Security scanning and auditing
├── maintenance/ # System maintenance utilities
├── monitoring/ # Monitoring and cost tracking
├── performance/ # Performance testing
├── demo/ # Demo and presentation scripts
└── README.md # This file
# Windows
scripts\setup\quick-start.bat
# Linux/Mac
./scripts/setup/quick-start.sh# Start local development environment
scripts\setup\start-local.bat # Windows
./scripts/setup/start-local.sh # Linux/Mac# Deploy all stacks
scripts\deployment\deploy-all.bat # Windows
./scripts/deployment/deploy-all.sh # Linux/Mac# Comprehensive system test
scripts\testing\run-comprehensive-test.bat dev # Windows
./scripts/testing/run-comprehensive-test.sh dev # Linux/MacCore utilities used across multiple workflows.
Key Scripts:
build-lambda-packages.py- Package Lambda functions with dependencies
Usage:
python scripts/core/build-lambda-packages.pyDeployment automation for AWS infrastructure.
Key Scripts:
deploy-all.bat/.ps1/.sh- Deploy all CDK stacksdestroy-all-stacks.bat/.sh- Tear down all infrastructurerollback.py- Rollback to previous deployment
Usage:
# Deploy everything
scripts\deployment\deploy-all.bat
# Deploy specific environment
scripts\deployment\deploy-all.ps1 -Environment staging
# Rollback
python scripts/deployment/rollback.py --stack AquaChain-Core-devSee: deployment/README.md
Environment setup and initial configuration.
Key Scripts:
quick-start.bat/.sh- One-command setup for new developerssetup-local.bat/.sh- Configure local development environmentstart-local.bat/.sh- Start local dev serverscreate-admin-user.ps1- Create admin user in Cognito
Usage:
# First time setup
scripts\setup\quick-start.bat
# Start development
scripts\setup\start-local.batSee: setup/README.md
Comprehensive testing suite and validation scripts.
Key Scripts:
comprehensive-system-test.py- All-in-one test suite with detailed reportingrun-comprehensive-test.bat/.ps1- Test runner with HTML reportsproduction_readiness_validation.py- Pre-production validationtest-everything.bat- Quick test wrapper
Usage:
# Run comprehensive tests
scripts\testing\run-comprehensive-test.bat dev
# Production readiness check
python scripts/testing/production_readiness_validation.py --environment prodSee: testing/COMPREHENSIVE_TEST_README.md
Security scanning, vulnerability detection, and compliance tools.
Key Scripts:
dependency-security-scan.py- Scan dependencies for vulnerabilitiesgenerate-sbom.py- Generate Software Bill of Materialscompare-sboms.py- Compare SBOMs for changesvulnerability-report-generator.py- Generate security reportscheck-sensitive-data.py- Scan for hardcoded secretsremove-sensitive-data.ps1- Remove sensitive data from codebase
Usage:
# Security scan
python scripts/security/dependency-security-scan.py
# Generate SBOM
python scripts/security/generate-sbom.py
# Check for secrets
python scripts/security/check-sensitive-data.pySystem maintenance and optimization utilities.
Key Scripts:
disaster_recovery.py- Disaster recovery proceduresoptimize-lambda-memory.py- Optimize Lambda memory allocationreduce-log-retention.ps1- Reduce CloudWatch log retentioncheck_codebase.py- Codebase health check
Usage:
# Disaster recovery
python scripts/maintenance/disaster_recovery.py --action backup
# Optimize Lambda
python scripts/maintenance/optimize-lambda-memory.pyMonitoring, alerting, and cost tracking.
Key Scripts:
check-aws-costs.ps1- Check current AWS costscreate-payment-alarms.ps1- Create CloudWatch alarms
Usage:
# Check costs
.\scripts\monitoring\check-aws-costs.ps1
# Create alarms
.\scripts\monitoring\create-payment-alarms.ps1Performance testing and load testing.
Key Scripts:
run_load_tests.py- Run load tests against API
Usage:
python scripts/performance/run_load_tests.py --users 1000 --duration 300Demo scripts for presentations and showcases.
Key Scripts:
ml_model_demo.py- Interactive ML model demoml_model_demo_auto.py- Automated ML demorun-ml-demo.bat- Demo runner
Usage:
scripts\demo\run-ml-demo.batSee: demo/README.md
# 1. Build Lambda packages
python scripts/core/build-lambda-packages.py
# 2. Deploy to dev
scripts\deployment\deploy-all.bat
# 3. Run tests
scripts\testing\run-comprehensive-test.bat dev
# 4. Deploy to staging
scripts\deployment\deploy-all.ps1 -Environment staging# 1. Check system health
python scripts/testing/production_readiness_validation.py --environment prod
# 2. Check costs
.\scripts\monitoring\check-aws-costs.ps1
# 3. Review logs (use AWS Console or CloudWatch Insights)
# 4. Rollback if needed
python scripts/deployment/rollback.py --stack AquaChain-API-prod# 1. Scan dependencies
python scripts/security/dependency-security-scan.py
# 2. Check for secrets
python scripts/security/check-sensitive-data.py
# 3. Generate SBOM
python scripts/security/generate-sbom.py
# 4. Generate report
python scripts/security/vulnerability-report-generator.py# 1. Run load tests
python scripts/performance/run_load_tests.py --users 1000
# 2. Optimize Lambda memory
python scripts/maintenance/optimize-lambda-memory.py
# 3. Reduce log retention
.\scripts\maintenance\reduce-log-retention.ps1- Python 3.11+ - For Python scripts
- Node.js 18+ - For frontend development
- AWS CLI - Configured with appropriate credentials
- PowerShell 5.1+ - For Windows scripts
- Bash - For Linux/Mac scripts
pip install boto3 requests pytestEnsure AWS CLI is configured:
aws configure- Batch files (
.bat): Windows CMD scripts - PowerShell (
.ps1): Windows PowerShell scripts - Shell scripts (
.sh): Linux/Mac bash scripts - Python (
.py): Cross-platform Python scripts
- Never commit secrets - Use AWS Secrets Manager
- Review scripts before running - Especially in production
- Use least-privilege IAM - Scripts should have minimal permissions
- Audit script changes - Review all script modifications
- Test in dev first - Always test scripts in dev environment
# Windows: Enable script execution
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Linux/Mac: Make script executable
chmod +x scripts/setup/quick-start.sh# Check AWS configuration
aws sts get-caller-identity
# Reconfigure if needed
aws configure# Install dependencies
pip install -r requirements.txt# Windows: Run as Administrator
# Linux/Mac: Use sudo or check file permissionsWhen adding new scripts:
- Place in appropriate folder - Follow the directory structure
- Add documentation - Include usage examples
- Follow naming conventions - Use descriptive names
- Test thoroughly - Test in dev before committing
- Update README - Document new scripts here
For issues or questions:
- Check troubleshooting section above
- Review script-specific README files
- Consult main AquaChain documentation
- Contact engineering team
To remove old/redundant scripts:
# Run cleanup script (creates backup first)
.\scripts\cleanup-scripts.ps1Last Updated: March 2026
Maintained By: AquaChain Engineering Team