Products Recommendation System#69
Merged
Merged
Conversation
Adjust CI workflows, Docker and app configs for local/dev testing: simplify DB credentials, change MySQL port mappings to 3307 for runners, expose real ports in dev compose, and add CORS_ALLOWED_ORIGIN env. Generate short-lived SSL certs in GitHub Actions and start Angular with ng serve (remove proxy-test usage). Make backend CORS origin configurable via app.cors.allowed-origin and update application/test.properties and application.properties accordingly. Switch JWT cookie handling to use Spring ResponseCookie (SameSite=None) and update login/logout methods; improve JWT filter logging to suppress benign missing-cookie errors. Update frontend proxy target to use backend port 8443, remove proxy-test.conf.json, make WebSocket URL protocol/host-aware, add users-management unit tests, and disable Angular CLI analytics.
Replace constructor-based Angular dependency injection with the inject() function in many components. Updated imports to include inject, moved services and tokens to class fields using inject(), removed now-empty constructors, and applied small formatting fixes (e.g. whitespace in admin-home). Changes affect multiple admin, client and common components to reduce constructor boilerplate and centralize DI usage.
Cleanup and reorganization of imports across backend services, controllers, models, repositories and tests; small API/test adjustments; and an update to the admin-home frontend template. Changes include consolidating DTO imports (using wildcard imports where appropriate), reordering and removing unused imports, adding missing model/dto imports (e.g. StatDTO), standardizing Mockito/hamcrest usages in tests, and minor signature/formatter tweaks. The admin-home component template was modified to use conditional @if blocks. No substantial business-logic changes were introduced — mostly cosmetic/import/test updates and minor formatting fixes.
Replace the in-workflow Maven Sonar invocation with the SonarSource/sonarcloud-github-action and add a dedicated backend test step (mvn -B verify -Dspring.profiles.active=test). Add a root sonar-project.properties that centralizes SonarCloud settings (organization, project key, sources/tests, java binaries, exclusions, and coverage report paths for backend/frontend). Remove sonar-specific properties from backend/pom.xml so analysis settings live in the new sonar-project.properties. This centralizes and corrects paths for combined frontend/backend analysis and supplies GITHUB_TOKEN to the action.
Enable code coverage for the frontend test target and add excludes in angular.json, and point the test runner to the karma config. Change Karma's coverage output to 'lcovonly' and add a getter-only property that freezes config.coverageReporter.reporters to prevent Angular 19's esbuild karma builder from overwriting the reporters (preserving LCOV output required by SonarCloud). Update sonar-project.properties exclusions to include the new frontend app and utils paths so Sonar excludes match the coverage config.
Rename and standardize environment variables across workflows, Docker Compose, and Spring config to separate MySQL, MongoDB and MinIO credentials. Key changes: - GitHub Actions: replace RUNNER_DB_* with RUNNER_MYSQL_*; add RUNNER_MONGODB_USERNAME/PASSWORD and RUNNER_MONGODB_NAME; use these vars in docker run and mongosh invocations; map Mongo to host port 27018 in CI to avoid collisions; add RUNNER_MINIO_BUCKET_NAME. - Backend configs: application.properties now reads MYSQL_URL/USERNAME/PASSWORD and exposes MONGODB_USERNAME/PASSWORD; application-test.properties updated to use RUNNER_MYSQL_* and to connect to Mongo on localhost:27018 with separate username/password properties. - Docker Compose (dev, prod, mongo): set MONGO_INITDB_ROOT_USERNAME/PASSWORD to new values, use env refs in Mongo healthchecks, switch DATASOURCE_* to MYSQL_* env names, remove embedded Mongo credentials from MONGODB_URI and add MONGODB_USERNAME/PASSWORD. - Docs: update .env example to reflect the new variable names and provide example values for MySQL, MongoDB, MinIO and other required variables. These changes align naming across environments, avoid port conflicts in CI, and centralize credential management via environment variables.
Combine MongoDB username/password into the Spring Data MongoDB URI and adjust docker-compose env values accordingly. application.properties and application-test.properties now build a mongodb://<user>:<pass>@<host> URI using environment variables, and docker-compose.yml / docker-compose-dev.yml provide the host/port/db (without the mongodb:// prefix). This centralizes connection configuration and lets the app assemble the full connection string from separate credential and host env vars.
Add new diagram and QR menu images, and update documentation to include QR scan/show sections. Update SonarQube screenshots and bump reported new-code coverage to 84.77%. Clarify Docker Desktop usage and local DB setup details (MongoDB credentials and MySQL/Mongo tooling), and tweak wording for MinIO certificate step in the development guide.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several important updates across the backend and CI/CD workflow configurations. The main themes are the standardization and improvement of environment variable usage in GitHub Actions workflows, updates to backend service and repository naming for clarity, the addition of a product recommendations endpoint, and enhancements to test and analysis automation.
Key changes include:
CI/CD Workflow Improvements
.github/workflows/full_test_on_pull_request.ymland.github/workflows/sonar_analysis.yml, and updated corresponding service startup steps to use these new names. This includes changing default ports for MySQL (3307), MongoDB (27018), and MinIO (9002/9003), and making MongoDB/MinIO credentials configurable. [1] [2] [3] [4] [5] [6] [7] [8]Backend API and Service Layer Updates
UserConnectionandUserConnectionRepositorytoConnectionandConnectionRepositorythroughout the backend, including all relevant service and controller injections, for clearer and more consistent naming. [1] [2] [3] [4] [5] [6] [7] [8] [9]New Features
/products/recommendationsinProductRestControllerto provide paged personalized product recommendations to users.Build and Project Configuration
pom.xmlto exclude model, DTO, repository, config, and utility classes, improving the accuracy of code coverage metrics.pom.xml.