🔒 SonarQube & Snyk Setup Guide
📋 Overview
This guide walks you through setting up SonarQube and Snyk for the Airo super app.
Time Required: ~15 minutes Difficulty: Easy Prerequisites: GitHub account
🎯 Step-by-Step Setup
Part 1: SonarQube Setup (5 minutes)
Step 1.1: Create SonarCloud Account
- Go to: https://sonarcloud.io
- Click Sign up
- Choose GitHub as login method
- Click Authorize SonarCloud
- Complete the authorization
Step 1.2: Create Organization
- After login, click Create organization
- Choose Free plan
- Name:
airo-super-app - Click Create
Step 1.3: Create Project
- Click Create project
- Select GitHub as repository source
- Search for
airorepository - Click Set up
- Choose Free plan
- Click Create project
Step 1.4: Generate Token
- Go to: https://sonarcloud.io/account/security
- Click Generate Tokens
- Name:
AIRO_CI_TOKEN - Type:
Global Analysis Token - Click Generate
- Copy the token (save it somewhere safe!)
Step 1.5: Add GitHub Secret
- Go to: https://github.com/DevelopersCoffee/airo/settings/secrets/actions
- Click New repository secret
- Name:
SONAR_TOKEN - Value: Paste the token from Step 1.4
- Click Add secret
✅ SonarQube Setup Complete!
Part 2: Snyk Setup (5 minutes)
Step 2.1: Create Snyk Account
- Go to: https://app.snyk.io
- Click Sign up
- Choose GitHub as login method
- Click Authorize Snyk
- Complete the authorization
Step 2.2: Add Repository
- After login, click Add project
- Select GitHub
- Search for
airorepository - Click Add selected repositories
- Wait for initial scan to complete
Step 2.3: Generate API Token
- Go to: https://app.snyk.io/account/api-token
- Click Show to reveal token
- Click Copy to copy token
- Save the token (you’ll need it for GitHub)
Step 2.4: Add GitHub Secret
- Go to: https://github.com/DevelopersCoffee/airo/settings/secrets/actions
- Click New repository secret
- Name:
SNYK_TOKEN - Value: Paste the token from Step 2.3
- Click Add secret
✅ Snyk Setup Complete!
✅ Verification
Verify Secrets Added
- Go to: https://github.com/DevelopersCoffee/airo/settings/secrets/actions
- You should see:
- ✅
SONAR_TOKEN - ✅
SNYK_TOKEN
- ✅
Test Integration
- Push a commit to main:
git push origin main -
Go to: https://github.com/DevelopersCoffee/airo/actions
-
Wait for workflow to complete (~10 minutes)
- Check results:
- SonarQube: https://sonarcloud.io/projects
- Snyk: https://app.snyk.io/org/ucguy4u/
📊 Viewing Results
SonarCloud Dashboard
URL: https://sonarcloud.io/projects
What You’ll See:
- Code quality metrics
- Bug count and details
- Code smells
- Test coverage percentage
- Technical debt
- Quality gate status
Snyk Dashboard
URL: https://app.snyk.io/org/ucguy4u/
What You’ll See:
- Vulnerability count
- Severity breakdown
- Dependency issues
- License compliance
- Remediation suggestions
🛠️ Local Testing
Run SonarQube Analysis Locally
# Set token
export SONAR_TOKEN=your_token_here
# Run analysis
make sonar-scan
Run Snyk Scan Locally
# Set token
export SNYK_TOKEN=your_token_here
# Run scan
make snyk-scan
Run All Checks
make full-check
📋 Troubleshooting
SonarQube Issues
Q: “SONAR_TOKEN not found” error
- A: Verify secret is added to GitHub
- Check secret name is exactly
SONAR_TOKEN
Q: “Quality gate failed”
- A: Review issues in SonarCloud dashboard
- Fix code quality issues
- Re-run workflow
Q: “No coverage data”
- A: Ensure tests run with coverage
- Check
app/coverage/lcov.infoexists
Snyk Issues
Q: “SNYK_TOKEN not found” error
- A: Verify secret is added to GitHub
- Check secret name is exactly
SNYK_TOKEN
Q: “Vulnerabilities detected”
- A: Review in Snyk dashboard
- Update vulnerable dependencies
- Apply suggested fixes
Q: “License issues”
- A: Review licenses in Snyk dashboard
- Update or replace incompatible packages
🎯 Next Steps
- ✅ Create SonarCloud account
- ✅ Create Snyk account
- ✅ Add GitHub secrets
- ✅ Test integration
- 📊 Monitor dashboards
- 🔧 Fix issues as they appear
- 📈 Improve metrics over time
📞 Support
Documentation
- SonarCloud: https://docs.sonarcloud.io
- Snyk: https://docs.snyk.io
Dashboards
- SonarCloud: https://sonarcloud.io/projects
- Snyk: https://app.snyk.io/org/ucguy4u/
Help
- SonarCloud Community: https://community.sonarsource.com
- Snyk Support: https://support.snyk.io
✅ Checklist
- SonarCloud account created
- Snyk account created
- SONAR_TOKEN secret added
- SNYK_TOKEN secret added
- First CI run completed
- SonarQube results visible
- Snyk results visible
- Team notified
Status: ✅ Ready to setup Date: November 2, 2025 Time to Complete: ~15 minutes