{"id":36750334,"url":"https://github.com/octodemo/java-springboot-demo","last_synced_at":"2026-01-12T12:43:30.981Z","repository":{"id":150808048,"uuid":"623543731","full_name":"octodemo/java-springboot-demo","owner":"octodemo","description":"This is a Java demo App created by @tsviz","archived":false,"fork":false,"pushed_at":"2025-12-22T04:08:17.000Z","size":840,"stargazers_count":7,"open_issues_count":7,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-23T11:35:12.554Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","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":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-04-04T15:23:34.000Z","updated_at":"2025-12-22T01:17:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"3c879c9c-dc6a-408b-80f6-0d9809ef498c","html_url":"https://github.com/octodemo/java-springboot-demo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/octodemo/java-springboot-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fjava-springboot-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fjava-springboot-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fjava-springboot-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fjava-springboot-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/octodemo","download_url":"https://codeload.github.com/octodemo/java-springboot-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/octodemo%2Fjava-springboot-demo/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.114Z","updated_at":"2026-01-12T12:43:30.976Z","avatar_url":"https://github.com/octodemo.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Spring Boot Demo App - Inventory Records Manager\n\n## Application UI Examples\n\n### Blue/Green Deployment with Feature Flags\n\nThe application demonstrates both **Blue/Green deployment** strategies and **Feature Flag** implementations through a modern, responsive web interface.\n\n#### Green Environment (Feature Enabled)\n\u003cdetails\u003e\n\u003csummary\u003e🟢 Click to view Green Environment Screenshot\u003c/summary\u003e\n\n![Green Environment - With Search Feature](docs/images/green_env.png)\n*Green-themed UI with search functionality enabled, export/import features, and enhanced user experience*\n\n**Features visible:**\n- Search functionality with search box and button\n- Export to CSV and Import from CSV buttons  \n- Green color scheme indicating feature environment\n- Full inventory management capabilities\n\u003c/details\u003e\n\n#### Blue Environment (Stable)\n\u003cdetails\u003e\n\u003csummary\u003e🔵 Click to view Blue Environment Screenshot\u003c/summary\u003e\n\n![Blue Environment - Stable Version](docs/images/blue_env.png) \n*Blue-themed stable environment with core inventory management features*\n\n**Features visible:**\n- No search functionality (feature disabled)\n- Export/Import capabilities maintained\n- Blue color scheme indicating stable environment  \n- Core inventory operations available\n\u003c/details\u003e\n\n## About This Application\n\nThis **Inventory Records Manager** is a comprehensive Spring Boot web application that demonstrates modern software development practices including:\n\n- **🚀 Deployment Strategies**: Blue/Green deployments with zero-downtime releases\n- **🎯 Feature Management**: Runtime feature toggles and gradual rollouts  \n- **🏗️ Cloud-Native Architecture**: Kubernetes-ready with Helm charts\n- **🔄 CI/CD Pipeline**: Automated testing, security scanning, and deployment\n- **📊 Monitoring \u0026 Observability**: Health checks, metrics, and resource monitoring\n\n### Key Features\n\n- **Inventory Management**: Add, edit, delete, and search inventory items\n- **Export/Import**: CSV data export and import functionality\n- **User Authentication**: Secure login and session management\n- **Responsive Design**: Modern UI that works across devices\n- **Feature Flags**: Dynamic feature enabling/disabling without deployments\n- **Database Integration**: PostgreSQL with Liquibase migrations\n- **Caching**: Redis integration for improved performance\n\n## Overview\n\nThis is a comprehensive Sales Manager Java App that stores inventory items in a PostgreSQL database and presents them through a modern web interface. This demo repository is designed to help understand **CI/CD** ([Continuous Integration](https://docs.github.com/en/enterprise-cloud@latest/actions/automating-builds-and-tests/about-continuous-integration)/[Continuous Delivery](https://docs.github.com/en/enterprise-cloud@latest/actions/deployment/about-deployments/about-continuous-deployment)) principles, deployment strategies, and modern DevOps practices.\n\n## Technology Stack\n\n- **Backend:** Java 17+ with Spring Boot 2.7+\n- **Frontend:** Thymeleaf templates with Bootstrap 5 and modern CSS\n- **Database:** [PostgreSQL 10.4+](https://www.postgresql.org/docs/10/release-10-4.html) with Liquibase migrations\n- **Caching:** Redis for session management and performance optimization\n- **Container Platform:** Docker \u0026 Kubernetes with Helm charts\n- **Monitoring:** Spring Boot Actuator with health checks and metrics\n- **Security:** Spring Security with authentication and authorization\n- **Design Patterns:** MVC (Model View Controller), Repository Pattern, and OOP\n- **CI/CD Pipeline:** [GitHub Actions](https://docs.github.com/en/enterprise-cloud@latest/actions) with automated testing and deployment\n\n### Architecture Components\n\n- **Application Server**: Spring Boot with embedded Tomcat\n- **Database Layer**: PostgreSQL with connection pooling\n- **Caching Layer**: Redis cluster for improved performance  \n- **Load Balancer**: Kubernetes Services with traffic distribution\n- **Feature Management**: Runtime configuration via ConfigMaps\n- **Deployment Strategy**: Blue/Green with Helm-based releases\n\n## CI/CD Pipeline\n\nThe pipeline is optimized using various tools. See the `.github/workflows/ci.yml` and `.github/workflows/cd.yml` for more detailed configuration.\n\n### Continuous Integration\n\n- [Caching Dependencies to Speed Up Workflows](https://docs.github.com/en/enterprise-cloud@latest/actions/using-workflows/caching-dependencies-to-speed-up-workflows)\n- Docker Layer Caching with [action-docker-layer-caching](https://github.com/satackey/action-docker-layer-caching) or [build-push-action](https://github.com/docker/build-push-action) actions.\n- [Metrix Strategy](https://docs.github.com/en/enterprise-cloud@latest/actions/using-jobs/using-a-matrix-for-your-jobs) for parallel unit testing.\n- [Split Test Action](https://github.com/marketplace/actions/split-tests) for splitting tests across multiple runners.\n- [GitHub Advanced Security](https://docs.github.com/en/enterprise-cloud@latest/get-started/learning-about-github/about-github-advanced-security) with [CodeQL analysis](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages).\n- [Liquibase Quality Checks](https://www.liquibase.com/quality-checks) for enforcing database schema changes best practices.\n\n### Continuous Delivery/Deployment\n\n- [Environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment) with an [approval step review](https://docs.github.com/en/actions/managing-workflow-runs/reviewing-deployments) prior to [deployments](https://docs.github.com/en/actions/deployment/about-deployments)\n- [azure/login action](https://github.com/marketplace/actions/azure-login) for [OIDC (OpenID Connect)](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) functionality.\n- [Canary or Blue-Green deployments](https://github.com/Azure-Samples/aks-bluegreen-canary) in an AKS (Azure Kubernetes) Cluster.\n\n## CI/CD Diagram\n\n```mermaid\nstateDiagram\n    state Developer-Workflow {\n    Commits --\u003e PR: Developers Commit new changes in a Pull Request\n    PR --\u003e Build: Build \u0026 Unit Test Suite\n    }\n    \n    state Continuous-Integration {\n        state Security-Scans {\n        Build --\u003e App: CodeQL Analysis\n        Build --\u003e Database: Liquibase Quality Checks\n        Build --\u003e Package: Compile\n        }\n        Build --\u003e JunitTests: Storing Artifacts\n        state Parallel-Testing {\n        JunitTests --\u003e JunitTest1: Each test runs in \\na containerized environment\n        JunitTests --\u003e JunitTest2\n        JunitTests --\u003e JunitTest3\n        JunitTests --\u003e JunitTest4\n        JunitTests --\u003e JunitTest..N\n        }\n        JunitTests --\u003e Publish: If CI passes, \\nmerging to main branch \\nand publishing Containerised\\n App to GitHub\\n Container Registry\n    }\n\n    state Continuous-Delivery {\n    Publish --\u003e SystemTesting: Pulling Image from GHCR\n    SystemTesting --\u003e IntegrationTesting: [staging]\n    IntegrationTesting --\u003e AccepetanceTesting: [staging]\n    }\n    AccepetanceTesting --\u003e Deploy: Login with OpenID Connect and \\nDeploy the app to K8s\n    Deploy --\u003e [ProdInstance1]: Blue\n    Deploy --\u003e [ProdInstance2]: Green\n```\n## Blue-Green Deployment Strategy Diagram\n\n```mermaid\nsequenceDiagram\n    participant C as Commit\n    participant G as GitHub Actions\n    participant H as Helm\n    participant K as Kubernetes\n    C-\u003e\u003eG: Developer pushes a commit\n    G-\u003e\u003eG: GitHub Actions extracts the commit message\n    Note over G: GitHub Actions checks if the commit message starts with [v1]\n    alt Commit message starts with [v1]\n        G-\u003e\u003eH: GitHub Actions tells Helm to update the app without changing the v2 image\n        Note over G: The v2 image remains the same\n    else Commit message does not start with [v1]\n        G-\u003e\u003eH: GitHub Actions tells Helm to update the app and change the v2 image\n        Note over G: The v2 image is updated to the new version\n    end\n    H-\u003e\u003eK: Helm deploys or updates the Kubernetes resources\n    G-\u003e\u003eK: GitHub Actions checks the status of the deployments\n```\n## App deployment flow - in this diagram\n## User Request Flow\n1. User sends a request to the Load Balancer.\n2. Load Balancer routes the request to the Kubernetes Service.\n3. Kubernetes Service routes the request to the Spring Boot App.\n4. Spring Boot App queries the Database.\n5. Database returns data to the Spring Boot App.\n6. Spring Boot App checks the Feature Flag.\n7. Feature Flag returns the flag status to the Spring Boot App.\n8. Spring Boot App checks the Redis Cache.\n9. Redis Cache returns the session data to the Spring Boot App.\n10. Spring Boot App returns the response to the User.\n\n## Deployment Process\n1. App Startup deploys the Database.\n2. Canary Deployment spins up new pods.\n3. Rollback triggers a Canary Deployment.\n4. Canary Deployment deploys the previous stable Docker image.\n5. Canary Deployment reverts database changes.\n6. Promote deploys to all pods.\n\n## Monitoring and Issue Resolution\n1. Monitoring alerts the Ops Team.\n2. Ops Team fixes issues.\n3. Rollback/Canary Deployment deploys the fix.\n4. New Pods verifies the fix.\n5. Monitoring verifies the fix.\n\n```mermaid\ngraph LR\n    A[User] --\u003e|Sends Request| B[Load Balancer]\n    B --\u003e|Routes Request| C[Kubernetes Service]\n    C --\u003e|Routes to Pod| D[Spring Boot App]\n    D --\u003e|Queries| E[Database]\n    E --\u003e|Returns Data| D\n    D --\u003e|Checks| F[Feature Flag]\n    F --\u003e|Returns Flag Status| D\n    D --\u003e|Checks| G[Redis Cache]\n    G --\u003e|Returns Session Data| D\n    D --\u003e|Returns Response| A\n    H[App Startup] --\u003e|Deploys Database| E\n    I[Canary Deployment] --\u003e|Spins Up New Pods| C\n    J[Rollback] --\u003e|Triggers Canary Deployment| K[Canary Deployment]\n    K --\u003e|Deploys Previous Stable Docker Image| L[New Pods]\n    K --\u003e|Reverts Database Changes| M[Database Deployment]\n    N[Promote] --\u003e|Deploys to All Pods| C\n    O[Monitoring] --\u003e|Alerts| P[Ops Team]\n    P --\u003e|Fixes Issues| Q[Rollback/Canary Deployment]\n    Q --\u003e|Deploys Fix| R[New Pods]\n    R --\u003e|Verifies Fix| S[Monitoring]\n    style A fill:#f9d,stroke:#333,stroke-width:4px\n    style B fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style C fill:#ff9,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style D fill:#9f6,stroke:#333,stroke-width:2px,stroke-dasharray: 5, 5\n    style E fill:#9f6,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style F fill:#cfc,stroke:#333,stroke-width:2px\n    style G fill:#6cf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style H fill:#f6c,stroke:#333,stroke-width:2px\n    style I fill:#6fc,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style J fill:#cf6,stroke:#333,stroke-width:2px\n    style K fill:#6cf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style L fill:#f6c,stroke:#333,stroke-width:2px\n    style M fill:#6fc,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style N fill:#cf6,stroke:#333,stroke-width:2px\n    style O fill:#6cf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style P fill:#f6c,stroke:#333,stroke-width:2px\n    style Q fill:#6fc,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n    style R fill:#cf6,stroke:#333,stroke-width:2px\n    style S fill:#6cf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n```\n\n## GitFlow Diagram\n```mermaid\ngraph TB\n  A[Local Branch] --\u003e|pull request| B((Main Branch))\n  B --\u003e C{GitHub Actions Workflow}\n  C --\u003e|Build| D[GitHub Artifacts/Container Registry]\n  C --\u003e|Infrastructure Build| E[K8s Configuration]\n  D --\u003e F{GitHub Actions Test Job}\n  E --\u003e F\n  F --\u003e|tests pass| G[Unit Tests]\n  G --\u003e|tests pass| H[Merge to Main Branch]\n  H --\u003e I[Deployment Approval]\n  I --\u003e J[Canary Deployment]\n  J --\u003e|monitoring| K{Decision Point}\n  K --\u003e|rollback| L[Revert Commit]\n  K --\u003e|promote| M[Full Deployment]\n  style A fill:#f9d,stroke:#333,stroke-width:4px\n  style B fill:#ccf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n  style C fill:#ff9,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n  style D fill:#9f6,stroke:#333,stroke-width:2px,stroke-dasharray: 5, 5\n  style E fill:#9f6,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n  style F fill:#cfc,stroke:#333,stroke-width:2px\n  style G fill:#6cf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n  style H fill:#f6c,stroke:#333,stroke-width:2px\n  style I fill:#6fc,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n  style J fill:#cf6,stroke:#333,stroke-width:2px\n  style K fill:#6cf,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n  style L fill:#f6c,stroke:#333,stroke-width:2px\n  style M fill:#6fc,stroke:#f66,stroke-width:2px,stroke-dasharray: 5, 5\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctodemo%2Fjava-springboot-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foctodemo%2Fjava-springboot-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foctodemo%2Fjava-springboot-demo/lists"}