A Spring Boot application that analyzes websites for performance, security, and reliability metrics.
- Performance Analysis: Measures latency, compression, caching, and content size
- Security Scoring: Checks HTTPS, HSTS, CSP, and other security headers
- Reliability Assessment: Evaluates HTTP status codes, response headers, and caching
- Java 17 or higher
- Maven 3.6+
website-analyzer/
├── src/
│ └── main/
│ ├── java/com/analyzer/
│ │ ├── WebsiteAnalyzerApplication.java # Main Spring Boot application
│ │ ├── config/
│ │ │ ├── AnalyzerConfig.java # Configuration constants
│ │ │ └── WebConfig.java # Web/CORS configuration
│ │ ├── controller/
│ │ │ └── AnalyzerController.java # REST API endpoints
│ │ ├── model/
│ │ │ ├── URLRequest.java # Request DTO
│ │ │ ├── Result.java # Response DTO
│ │ │ ├── PerformanceDetails.java
│ │ │ ├── SecurityDetails.java
│ │ │ └── ReliabilityDetails.java
│ │ └── service/
│ │ ├── FetcherService.java # HTTP client service
│ │ └── ScorerService.java # Scoring logic
│ └── resources/
│ └── application.properties # Application configuration
├── frontend/
│ ├── index.html
│ ├── app.js
│ └── style.css
└── pom.xml # Maven configuration
# Build with Maven
mvn clean package
# Or build without running tests
mvn clean package -DskipTestsmvn spring-boot:runjava -jar target/website-analyzer-1.0.0.jarThe application will start on http://localhost:8080
- Open your browser and navigate to: http://localhost:8080
- Enter one or more URLs (one per line) in the text area
- Click "Analyze Websites"
- View the ranked results with detailed metrics
Analyze multiple websites and return scoring results.
Request Body:
{
"urls": [
"example.com",
"https://google.com"
]
}Response:
[
{
"url": "https://example.com",
"performance": 85,
"security": 70,
"reliability": 90,
"total": 81,
"backend": "Apache/2.4.41",
"protocols": "HTTP/1.1 over TLS",
"responseTime": "234 ms",
"performanceDetails": { ... },
"securityDetails": { ... },
"reliabilityDetails": { ... }
}
]Edit application.properties to customize:
- Server port (default: 8080)
- HTTP timeout (default: 15000ms)
- Logging levels
- CORS settings
- Latency: ≤200ms (100 pts), ≤500ms (85 pts), ≤1000ms (70 pts), ≤2000ms (50 pts)
- Compression: +10 for gzip/brotli
- Caching: +10 for Cache-Control with max-age
- Content Size: +10 (≤300KB), +5 (≤1MB)
- HTTPS: 30 points
- HSTS header: 20 points
- Content-Security-Policy: 20 points
- X-Content-Type-Options: 10 points
- X-Frame-Options: 10 points
- Referrer-Policy: 10 points
- HTTP Status 2xx: +30 points
- HTTP Status 3xx: +15 points
- Response headers >20: +10 points
- Compression enabled: +5 points
- Caching enabled: +10 points
This Spring Boot version maintains feature parity with the original Python/FastAPI implementation:
- ✅ Same API endpoints and response format
- ✅ Same scoring algorithms
- ✅ Same frontend (HTML/CSS/JS)
- ✅ HTTPS/HTTP fallback logic
- ✅ Comprehensive error handling
- ✅ Detailed logging
- Port: 8080 (Spring Boot default) instead of 8000 (FastAPI default)
- HTTP Client: Apache HttpClient 5 instead of httpx
- Runtime: JVM instead of Python interpreter
mvn spring-boot:runmvn clean package
java -jar target/website-analyzer-1.0.0.jarPort already in use:
# Change port in application.properties
server.port=8081Java version issues:
# Verify Java version
java -version # Should be 17 or higherMaven not found:
# Install Maven on Ubuntu/Debian
sudo apt-get install maven
# Install on macOS
brew install mavenThis project is open source and available for educational purposes.