{"id":36750349,"url":"https://github.com/octodemo/mono-multi-trigger-russel","last_synced_at":"2026-01-12T12:43:31.413Z","repository":{"id":310860585,"uuid":"1041469712","full_name":"octodemo/mono-multi-trigger-russel","owner":"octodemo","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-20T17:49:34.000Z","size":6664,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-20T18:32:25.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/octodemo.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-08-20T14:30:42.000Z","updated_at":"2025-08-20T17:12:05.000Z","dependencies_parsed_at":"2025-08-20T18:33:18.346Z","dependency_job_id":"54fe7b26-4fbf-4ad4-89e0-f172bb895de3","html_url":"https://github.com/octodemo/mono-multi-trigger-russel","commit_stats":null,"previous_names":["octodemo/mono-multi-trigger-russel"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/octodemo/mono-multi-trigger-russel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fmono-multi-trigger-russel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fmono-multi-trigger-russel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fmono-multi-trigger-russel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fmono-multi-trigger-russel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octodemo","download_url":"https://codeload.github.com/octodemo/mono-multi-trigger-russel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fmono-multi-trigger-russel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-12T12:43:30.818Z","updated_at":"2026-01-12T12:43:31.408Z","avatar_url":"https://github.com/octodemo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monorepo Multi-Service Deployment Demo\n\nThis repository demonstrates a monorepo setup with 5 microservices and GitHub Actions workflows that provide granular, manual control over testing and deployment to multiple environments.\n\n## 🏗️ Architecture Overview\n\nThis monorepo contains 5 microservices:\n\n- **Service A - User Management** (`services/service-a`) - Handles user registration, authentication, and profile management\n- **Service B - Product Catalog** (`services/service-b`) - Manages product inventory and catalog\n- **Service C - Order Management** (`services/service-c`) - Processes and tracks customer orders\n- **Service D - Payment Service** (`services/service-d`) - Handles payment processing and refunds\n- **Service E - Notification Service** (`services/service-e`) - Manages email, SMS, and push notifications\n\n## 🚀 Features\n\n### ✅ Automated Testing\n- **Comprehensive Test Suite**: Each service has its own unit tests\n- **CI/CD Integration**: Tests run automatically on push/PR\n- **Multi-Node Testing**: Tests run on Node.js 18.x and 20.x\n\n### 🎯 Granular Deployment Control\n- **Manual Deployment Triggers**: Choose exactly which services to deploy\n- **Multi-Environment Support**: Deploy to 5 different environments (dev, staging, test1, test2, prod)\n- **Selective Service Deployment**: Deploy one, some, or all services as needed\n- **Dry Run Support**: Test deployment workflows without actual deployment\n\n### 🔍 Change Detection\n- **Path-based Filtering**: Automatically detect which services have changed\n- **Optimized Testing**: Only run tests for services that have been modified\n\n## 📁 Project Structure\n\n```\nmono-multi-trigger-russel/\n├── .github/workflows/           # GitHub Actions workflows\n│   ├── test-all.yml            # Automated testing workflow\n│   └── deploy-manual.yml       # Manual deployment workflow\n├── services/                    # Microservices directory\n│   ├── service-a/              # User Management Service\n│   │   ├── src/index.js\n│   │   ├── __tests__/\n│   │   └── package.json\n│   ├── service-b/              # Product Catalog Service\n│   ├── service-c/              # Order Management Service\n│   ├── service-d/              # Payment Service\n│   └── service-e/              # Notification Service\n├── package.json                # Root package.json with workspace config\n└── README.md                   # This file\n```\n\n## 🛠️ Getting Started\n\n### Prerequisites\n- Node.js 18.x or 20.x\n- npm\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/octodemo/mono-multi-trigger-russel.git\ncd mono-multi-trigger-russel\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Run all tests:\n```bash\nnpm test\n```\n\n4. Run tests for a specific service:\n```bash\nnpm run test:service-a  # or service-b, service-c, service-d, service-e\n```\n\n5. Start a specific service:\n```bash\nnpm run start:service-a  # Starts on port 3001\nnpm run start:service-b  # Starts on port 3002\nnpm run start:service-c  # Starts on port 3003\nnpm run start:service-d  # Starts on port 3004\nnpm run start:service-e  # Starts on port 3005\n```\n\n## 🔄 Workflows\n\n### 1. Automated Testing (`test-all.yml`)\n\n**Triggers:**\n- Push to `main` or `develop` branches\n- Pull requests to `main` or `develop` branches\n\n**What it does:**\n- Runs all tests across all services\n- Tests on multiple Node.js versions (18.x, 20.x)\n- Detects which services have changed using path filters\n- Provides detailed test results\n\n### 2. Manual Deployment (`deploy-manual.yml`)\n\n**Trigger:** Manual workflow dispatch from GitHub Actions UI\n\n**Inputs:**\n- **Services**: Comma-separated list of services to deploy (e.g., `service-a,service-c`)\n- **Environment**: Target environment (`dev`, `staging`, `test1`, `test2`, `prod`)\n- **Version**: Version/tag to deploy (default: `latest`)\n- **Dry Run**: Whether to perform a dry run without actual deployment\n\n**What it does:**\n1. Validates input services against available services\n2. Runs full test suite to ensure code quality\n3. Deploys selected services to chosen environment in parallel\n4. Performs health checks and verification\n5. Provides comprehensive deployment summary\n\n## 🎮 How to Use Manual Deployment\n\n1. Go to the **Actions** tab in GitHub\n2. Select **Manual Deployment** workflow\n3. Click **Run workflow**\n4. Configure your deployment:\n   - **Services**: Choose which services to deploy (e.g., `service-a,service-b`)\n   - **Environment**: Select target environment\n   - **Version**: Specify version (optional)\n   - **Dry Run**: Check for testing without actual deployment\n5. Click **Run workflow**\n\n### Example Deployment Scenarios\n\n**Deploy all services to development:**\n- Services: `service-a,service-b,service-c,service-d,service-e`\n- Environment: `dev`\n\n**Deploy only user and payment services to staging:**\n- Services: `service-a,service-d`\n- Environment: `staging`\n\n**Test deployment workflow (dry run):**\n- Services: `service-c`\n- Environment: `test1`\n- Dry Run: ✅ (checked)\n\n## 🌐 Service APIs\n\n### Service A - User Management (Port 3001)\n- `GET /health` - Health check\n- `GET /users` - List all users\n- `GET /users/:id` - Get specific user\n- `POST /users` - Create new user\n- `PUT /users/:id` - Update user\n- `DELETE /users/:id` - Delete user\n\n### Service B - Product Catalog (Port 3002)\n- `GET /health` - Health check\n- `GET /products` - List products (supports `?category=` filter)\n- `GET /products/:id` - Get specific product\n- `POST /products` - Create new product\n- `PUT /products/:id` - Update product\n- `DELETE /products/:id` - Delete product\n\n### Service C - Order Management (Port 3003)\n- `GET /health` - Health check\n- `GET /orders` - List orders (supports `?userId=` and `?status=` filters)\n- `GET /orders/:id` - Get specific order\n- `POST /orders` - Create new order\n- `PUT /orders/:id/status` - Update order status\n\n### Service D - Payment Service (Port 3004)\n- `GET /health` - Health check\n- `GET /payments` - List payments (supports `?orderId=` and `?status=` filters)\n- `GET /payments/:id` - Get specific payment\n- `POST /payments` - Process new payment\n- `POST /payments/:id/refund` - Process refund\n\n### Service E - Notification Service (Port 3005)\n- `GET /health` - Health check\n- `GET /notifications` - List notifications (supports filters)\n- `GET /notifications/:id` - Get specific notification\n- `POST /notifications` - Create notification\n- `POST /notifications/:id/send` - Send notification\n- `GET /notifications/stats/summary` - Get notification statistics\n\n## 🧪 Testing\n\nEach service includes comprehensive unit tests covering:\n- Health endpoints\n- CRUD operations\n- Error handling\n- Input validation\n- Business logic\n\nRun tests using:\n```bash\n# All services\nnpm test\n\n# Individual services\nnpm run test:service-a\nnpm run test:service-b\nnpm run test:service-c\nnpm run test:service-d\nnpm run test:service-e\n```\n\n## 🚀 Deployment Environments\n\nThe system supports deployment to 5 different environments:\n\n- **dev** - Development environment for feature testing\n- **staging** - Pre-production environment for integration testing\n- **test1** - First test environment for QA\n- **test2** - Second test environment for performance testing\n- **prod** - Production environment\n\nEach environment can be configured with different:\n- Resource limits\n- Environment variables\n- Database connections\n- External service endpoints\n\n## 🔧 Configuration\n\n### Environment Variables\n\nEach service can be configured using environment variables:\n\n- `PORT` - Service port (defaults: 3001-3005)\n- `NODE_ENV` - Environment mode (development/production)\n- `LOG_LEVEL` - Logging level\n- Service-specific configuration variables\n\n### Workspace Configuration\n\nThe project uses npm workspaces for efficient dependency management:\n- Shared dependencies in root `package.json`\n- Service-specific dependencies in individual `package.json` files\n- Unified scripts for testing and starting services\n\n## 📊 Monitoring \u0026 Observability\n\nEach service provides:\n- Health check endpoints (`/health`)\n- Structured logging\n- Basic metrics and statistics\n- Error tracking and reporting\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Ensure all tests pass\n5. Submit a pull request\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n---\n\n**Demo Features Demonstrated:**\n✅ Monorepo with 5 microservices  \n✅ Unit tests for all services  \n✅ Automated testing on code changes  \n✅ Manual deployment control  \n✅ Granular service selection  \n✅ Multi-environment support  \n✅ Parallel deployment capabilities  \n✅ Dry run functionality  \n✅ Change detection and path filtering","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctodemo%2Fmono-multi-trigger-russel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctodemo%2Fmono-multi-trigger-russel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctodemo%2Fmono-multi-trigger-russel/lists"}