{"id":29717715,"url":"https://github.com/sadeeshaperera/nodejs-ansible-deploy","last_synced_at":"2026-04-29T16:09:01.848Z","repository":{"id":303119336,"uuid":"1014328560","full_name":"SadeeshaPerera/nodejs-ansible-deploy","owner":"SadeeshaPerera","description":" Ansible deployment automation, featuring advanced monitoring, security, and operational capabilities.","archived":false,"fork":false,"pushed_at":"2025-07-05T19:42:10.000Z","size":173,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-05T20:41:50.441Z","etag":null,"topics":["ansible","configuration-management","deployment","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SadeeshaPerera.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-05T13:57:29.000Z","updated_at":"2025-07-05T19:42:13.000Z","dependencies_parsed_at":"2025-07-05T20:42:00.726Z","dependency_job_id":"f11b1a8b-21d7-4e44-a385-390b5879150a","html_url":"https://github.com/SadeeshaPerera/nodejs-ansible-deploy","commit_stats":null,"previous_names":["sadeeshaperera/nodejs-ansible-deploy"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/SadeeshaPerera/nodejs-ansible-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadeeshaPerera%2Fnodejs-ansible-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadeeshaPerera%2Fnodejs-ansible-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadeeshaPerera%2Fnodejs-ansible-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadeeshaPerera%2Fnodejs-ansible-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SadeeshaPerera","download_url":"https://codeload.github.com/SadeeshaPerera/nodejs-ansible-deploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SadeeshaPerera%2Fnodejs-ansible-deploy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266813709,"owners_count":23988547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","configuration-management","deployment","nodejs"],"created_at":"2025-07-24T08:14:13.210Z","updated_at":"2025-10-29T07:20:38.125Z","avatar_url":"https://github.com/SadeeshaPerera.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Advanced Node.js Application with Ansible Deployment\n\nA comprehensive, production-ready Node.js application with enterprise-grade Ansible deployment automation, featuring advanced monitoring, security, and operational capabilities.\n\n## Project Structure\n\n```\n├── app.js                      # Main Node.js application with advanced features\n├── package.json               # NPM dependencies and scripts\n├── ecosystem.config.js        # PM2 process management configuration\n├── healthcheck.js             # Docker health check script\n├── Dockerfile                 # Multi-stage Docker build\n├── docker-compose.yml         # Docker compose for development\n├── jest.config.js             # Jest testing configuration\n├── jest.setup.js              # Jest setup file\n├── .eslintrc.js               # ESLint configuration\n├── .prettierrc.js             # Prettier code formatting\n├── .env.example               # Environment variables template\n├── deploy.sh                  # Automated deployment script\n├── public/                    # Static files and frontend assets\n│   └── index.html            # Modern responsive UI\n├── src/                       # Application source code\n│   ├── config/               # Configuration modules\n│   │   ├── database.js       # MongoDB connection and configuration\n│   │   └── redis.js          # Redis connection and configuration\n│   ├── middleware/           # Custom middleware\n│   │   ├── auth.js           # JWT authentication and API key validation\n│   │   ├── errorHandler.js   # Global error handling and logging\n│   │   └── requestLogger.js  # Request tracking and logging\n│   ├── routes/               # API route handlers\n│   │   ├── api.js            # General API endpoints\n│   │   ├── auth.js           # Authentication endpoints\n│   │   ├── metrics.js        # Prometheus metrics endpoints\n│   │   └── upload.js         # File upload and processing\n│   └── utils/                # Utility functions\n│       └── logger.js         # Winston logging configuration\n├── __tests__/                # Test suite\n│   ├── app.test.js           # Application tests\n│   └── api.test.js           # API endpoint tests\n├── ansible/                  # Ansible deployment automation\n│   ├── ansible.cfg           # Ansible configuration\n│   ├── inventory.ini         # Multi-environment server inventory\n│   ├── deploy.yml            # Main deployment playbook\n│   ├── monitor.yml           # Advanced monitoring playbook\n│   ├── rolling-update.yml    # Zero-downtime rolling updates\n│   ├── disaster-recovery.yml # Backup and recovery procedures\n│   └── templates/            # Jinja2 templates\n│       ├── .env.j2           # Environment configuration template\n│       ├── nodejs-app.service.j2  # Systemd service template\n│       ├── nginx-site.conf.j2     # Advanced Nginx configuration\n│       ├── nginx.conf.j2           # Nginx global configuration\n│       ├── monitor.sh.j2           # Monitoring script template\n│       ├── logrotate.j2            # Log rotation configuration\n│       ├── mongod.conf.j2          # MongoDB configuration\n│       └── redis.conf.j2           # Redis configuration\n└── README.md                 # This comprehensive documentation\n```\n\n## Advanced Features\n\n### 🚀 Node.js Application Features\n\n#### **Core Application**\n- **Express.js** framework with advanced middleware stack\n- **TypeScript-ready** codebase with modern ES6+ features\n- **Modular architecture** with separation of concerns\n- **Comprehensive error handling** with custom error classes\n- **Request tracking** with unique request IDs\n\n#### **Security \u0026 Authentication**\n- **JWT Authentication** with refresh token support\n- **API Key validation** for service-to-service communication\n- **Role-based access control** (RBAC)\n- **Security headers** with Helmet.js\n- **Rate limiting** with configurable thresholds\n- **Input validation** with express-validator and Joi\n- **CORS configuration** with whitelist support\n- **Password hashing** with bcrypt\n\n#### **Database \u0026 Caching**\n- **MongoDB integration** with Mongoose ODM\n- **Redis caching** for session management and performance\n- **Connection pooling** and automatic reconnection\n- **Database migrations** and seeding support\n- **Query optimization** and indexing strategies\n\n#### **File Handling \u0026 Processing**\n- **File upload** with multer and size/type validation\n- **Image processing** with Sharp (resize, compress, thumbnails)\n- **Secure file storage** with access controls\n- **File type detection** and virus scanning ready\n\n#### **Real-time Features**\n- **WebSocket support** with Socket.IO\n- **Real-time notifications** and live updates\n- **Room-based messaging** for multi-user features\n- **Connection management** and error handling\n\n#### **Monitoring \u0026 Observability**\n- **Prometheus metrics** collection and custom metrics\n- **Health check endpoints** (health, ready, live, detailed)\n- **Performance monitoring** with response time tracking\n- **Application metrics** (memory, CPU, uptime)\n- **Custom business metrics** tracking\n- **Distributed tracing** ready\n\n#### **Logging \u0026 Auditing**\n- **Structured logging** with Winston\n- **Log rotation** and archival\n- **Multiple log levels** and destinations\n- **Request/response logging** with Morgan\n- **Audit trail** for sensitive operations\n- **Error tracking** and alerting\n\n#### **Testing \u0026 Quality**\n- **Unit tests** with Jest and Supertest\n- **Integration tests** for API endpoints\n- **Code coverage** reporting\n- **Linting** with ESLint and Prettier\n- **Continuous integration** ready\n- **Test automation** with GitHub Actions support\n\n#### **Process Management**\n- **PM2 cluster mode** for multi-core utilization\n- **Graceful shutdowns** and zero-downtime restarts\n- **Process monitoring** and automatic restarts\n- **Memory leak detection** and prevention\n- **Load balancing** across multiple instances\n\n#### **API Documentation**\n- **Swagger/OpenAPI 3.0** documentation\n- **Interactive API explorer** with Swagger UI\n- **Request/response examples** and schemas\n- **Authentication documentation** and testing\n- **Version management** and deprecation notices\n\n### 🔧 Ansible Deployment Features\n\n#### **Multi-Environment Support**\n- **Production, Staging, Development** environment configurations\n- **Environment-specific variables** and settings\n- **Secure credential management** with Ansible Vault\n- **Infrastructure as Code** principles\n- **Configuration drift detection** and remediation\n\n#### **Advanced Deployment Strategies**\n- **Blue-Green deployments** for zero downtime\n- **Rolling updates** with configurable batch sizes\n- **Canary deployments** for risk mitigation\n- **Rollback capabilities** with automated triggers\n- **Health check validation** at each step\n\n#### **Infrastructure Automation**\n- **Server provisioning** and configuration\n- **Service discovery** and registration\n- **Load balancer management** with health checks\n- **SSL/TLS certificate** automation with Let's Encrypt\n- **DNS management** and failover configuration\n\n#### **Database \u0026 Cache Management**\n- **MongoDB cluster** setup and configuration\n- **Redis cluster** with sentinel for high availability\n- **Database migrations** and schema management\n- **Backup automation** with retention policies\n- **Point-in-time recovery** capabilities\n\n#### **Security Hardening**\n- **System security** with kernel parameter tuning\n- **Firewall configuration** with UFW\n- **SSH hardening** and key management\n- **User access controls** and privilege escalation\n- **Security scanning** and vulnerability assessment\n- **Intrusion detection** system integration\n\n#### **Performance Optimization**\n- **System tuning** for high-performance workloads\n- **Resource limits** and cgroup configuration\n- **Network optimization** and TCP tuning\n- **Memory management** and swap configuration\n- **I/O optimization** for database workloads\n\n#### **Monitoring \u0026 Alerting**\n- **Comprehensive health monitoring** with 20+ metrics\n- **Real-time alerting** via Slack, email, webhooks\n- **Performance benchmarking** and trend analysis\n- **Log aggregation** and centralized monitoring\n- **Metrics collection** with Prometheus integration\n- **Grafana dashboards** for visualization\n\n#### **Backup \u0026 Disaster Recovery**\n- **Automated backup schedules** with rotation\n- **Cross-region backup replication**\n- **Disaster recovery procedures** with RTO/RPO targets\n- **Backup validation** and restore testing\n- **Point-in-time recovery** capabilities\n- **Configuration backup** and versioning\n\n#### **Operational Excellence**\n- **Log rotation** and archival management\n- **Maintenance windows** and scheduling\n- **Capacity planning** and auto-scaling\n- **Cost optimization** and resource management\n- **Documentation generation** and runbooks\n\n## Prerequisites\n\n### Development Environment\n1. **Node.js 18+** and npm\n2. **Git** for version control\n3. **Docker** (optional, for containerized development)\n4. **Code editor** with ESLint and Prettier support\n\n### Deployment Environment\n1. **Ansible 4.0+** installed on control machine:\n   ```bash\n   # Ubuntu/Debian\n   sudo apt update \u0026\u0026 sudo apt install ansible python3-pip\n   pip3 install ansible\n\n   # macOS\n   brew install ansible\n\n   # Or using pip\n   pip install ansible ansible-lint\n   ```\n\n2. **Target servers** running Ubuntu 20.04+ or Debian 11+\n3. **SSH access** with sudo privileges\n4. **Domain name** (optional, for SSL/TLS)\n\n### System Requirements\n- **Minimum**: 2 CPU cores, 4GB RAM, 20GB storage\n- **Recommended**: 4 CPU cores, 8GB RAM, 50GB storage\n- **Production**: 8+ CPU cores, 16GB+ RAM, 100GB+ storage\n\n## Quick Start Guide\n\n### 1. Local Development Setup\n\n```bash\n# Clone the repository\ngit clone \u003crepository-url\u003e\ncd nodejs-ansible-deploy\n\n# Install dependencies\nnpm install\n\n# Copy environment template\ncp .env.example .env\n\n# Edit environment variables\nnano .env\n\n# Start development server\nnpm run dev\n\n# Or start with PM2\nnpm run pm2:start\n```\n\n### 2. Run Tests\n\n```bash\n# Run all tests\nnpm test\n\n# Run with coverage\nnpm run test:coverage\n\n# Run tests in watch mode\nnpm run test:watch\n\n# Lint code\nnpm run lint\n\n# Fix linting issues\nnpm run lint:fix\n```\n\n### 3. Docker Development (Optional)\n\n```bash\n# Build Docker image\nnpm run docker:build\n\n# Run with Docker\nnpm run docker:run\n\n# Or use Docker Compose\ndocker-compose up -d\n```\n\n### 4. Production Deployment\n\n#### Configure Inventory\nEdit `ansible/inventory.ini` with your server details:\n\n```ini\n[production]\nweb1 ansible_host=192.168.1.10 ansible_user=ubuntu\nweb2 ansible_host=192.168.1.11 ansible_user=ubuntu\ndb1 ansible_host=192.168.1.20 ansible_user=ubuntu\n\n[production:vars]\napp_environment=production\nssl_enabled=true\napp_domain=yourdomain.com\nuse_pm2=true\ninstall_mongodb=true\ninstall_redis=true\n```\n\n#### Deploy Application\n```bash\n# Check prerequisites\n./deploy.sh --check\n\n# Deploy to production\n./deploy.sh --deploy\n\n# Monitor deployment\n./deploy.sh --monitor\n\n# Or use Ansible directly\ncd ansible\nansible-playbook -i inventory.ini deploy.yml --limit production\n```\n\n#### Rolling Updates\n```bash\n# Zero-downtime rolling update\nansible-playbook -i inventory.ini rolling-update.yml\n```\n\n#### Disaster Recovery\n```bash\n# Restore from backup\nansible-playbook -i inventory.ini disaster-recovery.yml \\\n  -e backup_restore_path=/path/to/backup.tar.gz\n```\n\n## API Endpoints\n\n| Endpoint | Method | Description | Auth Required |\n|----------|--------|-------------|---------------|\n| `/` | GET | Application information | No |\n| `/health` | GET | Basic health check | No |\n| `/health/detailed` | GET | Detailed health status | No |\n| `/ready` | GET | Readiness probe | No |\n| `/live` | GET | Liveness probe | No |\n| `/metrics` | GET | Prometheus metrics | No* |\n| `/api-docs` | GET | Swagger documentation | No |\n| `/api/v1/status` | GET | API status | No |\n| `/api/v1/data` | GET | Sample data | API Key |\n| `/api/v1/secure` | GET | Secure endpoint | JWT |\n| `/api/v1/echo` | POST | Echo service | No |\n| `/api/v1/auth/login` | POST | User authentication | No |\n| `/api/v1/auth/register` | POST | User registration | No |\n| `/api/v1/upload/image` | POST | Image upload/processing | JWT |\n| `/api/v1/upload/files` | GET | List uploaded files | JWT |\n| `/api/v1/metrics/custom` | GET | Custom metrics | JWT |\n\n*Metrics endpoint restricted to internal networks\n\n## Environment Configuration\n\n### Core Settings\n```bash\n# Application\nNODE_ENV=production\nPORT=3000\nAPP_NAME=nodejs-ansible-deploy\n\n# Security\nJWT_SECRET=your-super-secure-jwt-secret\nAPI_KEY=your-api-key-here\nBCRYPT_ROUNDS=12\n\n# Database\nMONGODB_URI=mongodb://localhost:27017/nodejs-ansible-deploy\nREDIS_URL=redis://localhost:6379\n\n# Features\nFEATURE_WEBSOCKET_ENABLED=true\nFEATURE_FILE_UPLOAD_ENABLED=true\nFEATURE_METRICS_ENABLED=true\n```\n\n### Ansible Variables\n\n#### Global Variables\n```yaml\n# ansible/inventory.ini\nnodejs_version: 18\napp_port: 3000\napp_dir: /opt/nodejs-app\nuse_pm2: true\nssl_enabled: true\n```\n\n#### Environment-Specific\n```yaml\n# Production\napp_environment: production\ninstall_mongodb: true\ninstall_redis: true\nbackup_before_deploy: true\nrun_tests: true\n\n# Staging  \napp_environment: staging\ninstall_mongodb: false\ninstall_redis: false\nssl_enabled: false\n```\n\n## Advanced Deployment Features\n\n### Multi-Environment Management\n```bash\n# Deploy to specific environment\nansible-playbook -i inventory.ini deploy.yml --limit production\nansible-playbook -i inventory.ini deploy.yml --limit staging\n\n# Environment-specific variables\nansible-playbook -i inventory.ini deploy.yml -e app_environment=production\n```\n\n### Blue-Green Deployment\n```bash\n# Deploy to green environment\nansible-playbook -i inventory.ini deploy.yml --limit green\n\n# Switch traffic\nansible-playbook -i inventory.ini switch-traffic.yml\n\n# Rollback if needed\nansible-playbook -i inventory.ini rollback.yml\n```\n\n### Database Management\n```bash\n# Setup MongoDB cluster\nansible-playbook -i inventory.ini setup-mongodb.yml\n\n# Setup Redis cluster\nansible-playbook -i inventory.ini setup-redis.yml\n\n# Run database migrations\nansible-playbook -i inventory.ini migrate.yml\n```\n\n### SSL/TLS Management\n```bash\n# Setup SSL certificates\nansible-playbook -i inventory.ini ssl-setup.yml\n\n# Renew certificates\nansible-playbook -i inventory.ini ssl-renew.yml\n```\n\n## Monitoring \u0026 Operations\n\n### Health Monitoring\n```bash\n# Comprehensive monitoring\n./deploy.sh --monitor\n\n# Specific checks\nansible-playbook -i inventory.ini monitor.yml --tags health\nansible-playbook -i inventory.ini monitor.yml --tags performance\nansible-playbook -i inventory.ini monitor.yml --tags security\n```\n\n### Log Management\n```bash\n# View application logs\njournalctl -u nodejs-app -f\n\n# View Nginx logs\ntail -f /var/log/nginx/nodejs-ansible-deploy.access.log\n\n# Rotate logs manually\nlogrotate -f /etc/logrotate.d/nodejs-ansible-deploy\n```\n\n### Performance Tuning\n```bash\n# System optimization\nansible-playbook -i inventory.ini optimize.yml\n\n# Database optimization\nansible-playbook -i inventory.ini db-optimize.yml\n\n# Cache optimization\nansible-playbook -i inventory.ini cache-optimize.yml\n```\n\n### Backup Operations\n```bash\n# Create backup\nansible-playbook -i inventory.ini backup.yml\n\n# Restore from backup\nansible-playbook -i inventory.ini restore.yml \\\n  -e backup_file=/path/to/backup.tar.gz\n\n# List available backups\nansible-playbook -i inventory.ini list-backups.yml\n```\n\n## Security Features\n\n### Application Security\n- **Input validation** with sanitization\n- **SQL injection** prevention\n- **XSS protection** with CSP headers\n- **Rate limiting** by IP and user\n- **Authentication** with JWT tokens\n- **Authorization** with role-based access\n- **Session management** with secure cookies\n- **Audit logging** for sensitive operations\n\n### Infrastructure Security\n- **System hardening** with security benchmarks\n- **Firewall configuration** with minimal exposure\n- **SSH hardening** with key-based authentication\n- **SSL/TLS encryption** with modern ciphers\n- **Regular security updates** automation\n- **Intrusion detection** monitoring\n- **Vulnerability scanning** integration\n\n### Data Protection\n- **Encryption at rest** for sensitive data\n- **Encryption in transit** for all communications\n- **Data backup encryption**\n- **PII data handling** with GDPR compliance\n- **Data retention policies**\n- **Secure data deletion**\n\n## Performance Optimization\n\n### Application Performance\n- **Connection pooling** for databases\n- **Caching strategies** with Redis\n- **Compression** with gzip/brotli\n- **Static asset optimization**\n- **CDN integration** ready\n- **Load balancing** with session affinity\n- **Response time monitoring**\n\n### System Performance\n- **Kernel parameter tuning**\n- **Memory management optimization**\n- **I/O scheduler optimization**\n- **Network stack tuning**\n- **CPU scheduling optimization**\n- **Storage performance tuning**\n\n### Database Performance\n- **Index optimization**\n- **Query performance monitoring**\n- **Connection pool tuning**\n- **Read replicas** for scaling\n- **Sharding** for horizontal scaling\n- **Caching** at multiple levels\n\n## Troubleshooting Guide\n\n### Common Issues\n\n#### Application Won't Start\n```bash\n# Check service status\nsystemctl status nodejs-app\n\n# Check logs\njournalctl -u nodejs-app -n 50\n\n# Verify configuration\nnode -c app.js\n\n# Check dependencies\nnpm audit\n```\n\n#### High Memory Usage\n```bash\n# Monitor memory\nfree -h\nps aux --sort=-%mem | head\n\n# Check for memory leaks\nnode --inspect app.js\n\n# Restart with memory limit\nsystemctl restart nodejs-app\n```\n\n#### Database Connection Issues\n```bash\n# Check MongoDB\nsystemctl status mongod\nmongo --eval \"db.runCommand('ping')\"\n\n# Check Redis\nsystemctl status redis-server\nredis-cli ping\n\n# Check network connectivity\ntelnet localhost 27017\ntelnet localhost 6379\n```\n\n#### SSL Certificate Issues\n```bash\n# Check certificate status\ncertbot certificates\n\n# Renew certificates\ncertbot renew --dry-run\n\n# Test SSL configuration\nopenssl s_client -connect yourdomain.com:443\n```\n\n### Performance Issues\n```bash\n# Check system resources\ntop\nhtop\niotop\nnethogs\n\n# Application performance\npm2 monit\npm2 logs\n\n# Database performance\nmongostat\nredis-cli info stats\n```\n\n### Deployment Issues\n```bash\n# Ansible connectivity\nansible all -i inventory.ini -m ping\n\n# Playbook syntax check\nansible-playbook --syntax-check deploy.yml\n\n# Dry run deployment\nansible-playbook -i inventory.ini deploy.yml --check\n\n# Debug deployment\nansible-playbook -i inventory.ini deploy.yml -vvv\n```\n\n## Development Workflow\n\n### Code Quality\n1. **Write code** following project conventions\n2. **Run tests** to ensure functionality\n3. **Lint code** to maintain quality\n4. **Format code** with Prettier\n5. **Commit changes** with conventional commits\n6. **Push to repository** for CI/CD\n\n### Testing Strategy\n- **Unit tests** for individual functions\n- **Integration tests** for API endpoints\n- **End-to-end tests** for user workflows\n- **Performance tests** for scalability\n- **Security tests** for vulnerabilities\n- **Load tests** for reliability\n\n### CI/CD Pipeline\n```yaml\n# .github/workflows/ci.yml\nname: CI/CD Pipeline\non: [push, pull_request]\njobs:\n  test:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - uses: actions/setup-node@v2\n      - run: npm ci\n      - run: npm test\n      - run: npm run lint\n  \n  deploy:\n    needs: test\n    if: github.ref == 'refs/heads/main'\n    runs-on: ubuntu-latest\n    steps:\n      - run: ansible-playbook deploy.yml\n```\n\n## Architecture \u0026 Design\n\n### Application Architecture\n```\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Load Balancer │    │   Web Servers   │    │   Database      │\n│   (Nginx/HAProxy)│───▶│   (Node.js)     │───▶│   (MongoDB)     │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n                              │\n                       ┌─────────────────┐\n                       │   Cache         │\n                       │   (Redis)       │\n                       └─────────────────┘\n```\n\n### Deployment Architecture\n```\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Control Node  │    │   Target Nodes  │    │   Monitoring    │\n│   (Ansible)     │───▶│   (App Servers) │───▶│   (Prometheus)  │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n                              │\n                       ┌─────────────────┐\n                       │   Backup        │\n                       │   (Storage)     │\n                       └─────────────────┘\n```\n\n### Scaling Strategy\n- **Horizontal scaling** with multiple instances\n- **Vertical scaling** with resource optimization\n- **Database scaling** with read replicas\n- **Cache scaling** with cluster mode\n- **Load balancing** with health checks\n- **Auto-scaling** based on metrics\n\n## Contributing\n\n### Development Setup\n1. Fork the repository\n2. Create feature branch\n3. Install dependencies\n4. Run tests\n5. Submit pull request\n\n### Code Standards\n- Follow ESLint configuration\n- Write comprehensive tests\n- Document API changes\n- Update README for new features\n- Use conventional commit messages\n\n### Release Process\n1. Update version in package.json\n2. Update CHANGELOG.md\n3. Create release tag\n4. Deploy to staging\n5. Run integration tests\n6. Deploy to production\n7. Monitor deployment\n\n\n---\n\n🚀 **Ready for Production!** This setup provides enterprise-grade deployment automation with comprehensive monitoring, security, and operational features suitable for modern production environments.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadeeshaperera%2Fnodejs-ansible-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsadeeshaperera%2Fnodejs-ansible-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsadeeshaperera%2Fnodejs-ansible-deploy/lists"}