From 5034f10ea6ad57427d741962b888f9f7cbdc39a1 Mon Sep 17 00:00:00 2001 From: "chrisert-sync-bot[bot]" Date: Sun, 29 Mar 2026 01:21:57 +0000 Subject: [PATCH 1/2] chore: sync from main From 8d5a08d7a64758082c15bbbd9b80172be2733ece Mon Sep 17 00:00:00 2001 From: Fernando Tona <105774270+fernandotonacoder@users.noreply.github.com> Date: Sun, 29 Mar 2026 04:11:09 +0100 Subject: [PATCH 2/2] chore: update docs & set SQ Server to scan dev branch (#79) * chore: updat docs & set SQ Server to scan dev branch * little improvements on docs --- .github/workflows/sonarqube.yml | 2 +- README.md | 188 ++++++++++++++++++++++++++++---- docs/sonarqube-admin.md | 55 ++++++++++ 3 files changed, 221 insertions(+), 24 deletions(-) create mode 100644 docs/sonarqube-admin.md diff --git a/.github/workflows/sonarqube.yml b/.github/workflows/sonarqube.yml index f8b23c0..9a57178 100644 --- a/.github/workflows/sonarqube.yml +++ b/.github/workflows/sonarqube.yml @@ -4,7 +4,7 @@ on: push: branches: # - main # production, already covered automatically by SonarQube Cloud - - main + - dev # pull_request: # SonarQube Server Community doesn't support PRs # types: [opened, synchronize, reopened] workflow_dispatch: diff --git a/README.md b/README.md index 45d685a..fba822d 100644 --- a/README.md +++ b/README.md @@ -8,33 +8,166 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ SonarQube Cloud mainSonarQube Server dev (self-hosted on Azure)
- SonarQube Cloud + Quality gate - - Quality Gate Status + + Quality gate
Security Rating + + Security Rating (dev) + +
+ + Vulnerabilities + + N/A — free tier limitation
N/A — free tier limitation + + Security Issues + +
N/A — free tier limitation + + Security Hotspots + +
+ + Reliability Rating + + + + Reliability Rating (dev) + +
+ + Bugs + + N/A — free tier limitation
N/A — free tier limitation + + Reliability Issues + +
Maintainability Rating + + Maintainability Rating (dev) + +
+ + Technical Debt + + + + Technical Debt (dev) + +
+ + Code Smells + + N/A — free tier limitation
N/A — free tier limitation + + Maintainability Issues + +
N/A — free tier limitation + + Coverage (dev) + +
+ + Duplicated Lines (%) + + + + Duplicated Lines (%) (dev) + +
+ + Lines of Code + + + + Lines of Code (dev) + +
+--- + A high-performance web platform for a construction firm specializing in ETICS insulation. Built to bridge modern frontend development with real-world business needs, focusing on SEO and lead generation. ## 📋 About @@ -57,17 +190,17 @@ Optimized for performance and SEO to maximize the company's online visibility. F ## 🚀 Tech Stack -| Category | Technology | -| ------------- | --------------------------------------------------------------------------------------- | -| Framework | React | -| Language | JavaScript | -| Styling | Tailwind CSS | -| UI Components | Shadcn UI | -| Testing | Vitest | -| Code Quality | [SonarQube Cloud](https://sonarcloud.io/project/overview?id=fernandotonacoder_chrisert) | -| Staging | GitHub Pages | -| Production | Netlify | -| Forms | Netlify Forms | +| Category | Technology | +| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Framework | React | +| Language | JavaScript | +| Styling | Tailwind CSS | +| UI Components | Shadcn UI | +| Testing | Vitest | +| Code Quality | [SonarQube Cloud](https://sonarcloud.io/project/overview?id=fernandotonacoder_chrisert) (`main`) + [SonarQube Server](https://sonarqube-ft-dpdwb8g8dnhkfbey.swedencentral-01.azurewebsites.net/dashboard?id=fernandotonacoder_chrisert_bbc86f72-9ba6-4533-99be-b85658dca317) (`dev`) | +| Staging | GitHub Pages | +| Production | Netlify | +| Forms | Netlify Forms | ## 🛠️ Getting Started @@ -81,13 +214,10 @@ Optimized for performance and SEO to maximize the company's online visibility. F ```bash # Clone the repository git clone https://github.com/fernandotonacoder/chrisert.git - # Navigate to the project directory cd chrisert - # Install dependencies npm install - # Start the development server npm run dev ``` @@ -97,19 +227,14 @@ npm run dev ```bash # Run development server npm run dev - # Run dev server accessible from other devices (e.g., mobile) npm run dev -- --host - # Build for production npm run build - # Run tests npm run test - # Run tests with coverage report npm run test:coverage - # Preview production build npm run preview ``` @@ -132,6 +257,17 @@ npm run preview - **Deployments:** Automatic on push to respective branches - **Auto-Sync:** After each push to `main`, changes are automatically rebased onto `dev` to keep branches in sync +### Code Quality Strategy + +This project uses two SonarQube instances with complementary roles: + +| Instance | Branch | Role | +| ------------------------------------------- | ------ | ----------------------------------------------------------------------------------------- | +| **SonarQube Cloud** | `main` | Automatic analysis of production code; decorates PRs with quality feedback before merge | +| **SonarQube Server** (self-hosted on Azure) | `dev` | Continuous analysis of active development; monitors code quality before it reaches `main` | + +SonarQube Cloud handles PR decoration automatically via GitHub App. The self-hosted server runs via GitHub Actions on every push to `dev`. See [`docs/sonarqube-admin.md`](docs/sonarqube-admin.md) for administration notes. + ### Deployment Controls - **Manual Triggers:** Both GitHub Pages and Netlify workflows can also be triggered manually via Actions → Run workflow @@ -170,7 +306,13 @@ The **source code** of this project is licensed under the [MIT License](LICENSE) **Fernando Tona** - GitHub: [@fernandotonacoder](https://github.com/fernandotonacoder) +- LinkedIn: [Fernando Tona](https://www.linkedin.com/in/fernandotona/) +- Website: [fernandotonacoder.github.io](https://fernandotonacoder.github.io/) --- +
+ _Built with ❤️ for real-world business needs_ + +
diff --git a/docs/sonarqube-admin.md b/docs/sonarqube-admin.md new file mode 100644 index 0000000..3519647 --- /dev/null +++ b/docs/sonarqube-admin.md @@ -0,0 +1,55 @@ +# SonarQube Server — Administration Notes + +### Administration commands and notes for the SonarQube Server (self-hosted) for this project. + +> Instance: `https://sonarqube-ft-dpdwb8g8dnhkfbey.swedencentral-01.azurewebsites.net` + +--- + +## Changing the project's main branch via API + +SonarQube Community Build does not allow changing the default branch from _main_ to _dev_ through the graphical interface. The REST API must be used instead. + +```bash +curl -X POST \ + -H "Authorization: Bearer " \ + "https://sonarqube-ft-dpdwb8g8dnhkfbey.swedencentral-01.azurewebsites.net/api/project_branches/rename" \ + -d "project=fernandotonacoder_chrisert_bbc86f72-9ba6-4533-99be-b85658dca317&name=dev" +``` + +Replace `` with a User Token generated under **My Account → Security**. + +--- + +## SonarQube Server Badges + +SonarQube Server badges require a dedicated badge token. To generate one: + +**Project Settings → Badges → Generate a token** + +The badge token is different from the analysis token — it is read-only and is used solely to expose metrics publicly. + +Badge URL: + +``` +https://sonarqube-ft-dpdwb8g8dnhkfbey.swedencentral-01.azurewebsites.net/api/project_badges/measure?project=fernandotonacoder_chrisert_bbc86f72-9ba6-4533-99be-b85658dca317&metric=alert_status&token= +``` + +Available metrics: `alert_status`, `security_rating`, `sqale_rating`, `reliability_rating`, `coverage`, `duplicated_lines_density` + +--- + +## Project Key + +``` +fernandotonacoder_chrisert_bbc86f72-9ba6-4533-99be-b85658dca317 +``` + +--- + +## Required GitHub Repository Secrets + +| Secret | Description | +| ---------------- | ------------------------------------------------------------------------------------------------ | +| `SONAR_TOKEN` | Project Analysis Token generated under My Account → Security → Project Analysis Token → chrisert | +| `SONAR_HOST_URL` | `https://sonarqube-ft-dpdwb8g8dnhkfbey.swedencentral-01.azurewebsites.net` |