Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PagePulse - Website Audit Tool

PagePulse is a simple web-based website auditing tool that analyzes a given URL and generates a quick report containing important technical and SEO-related information.

The purpose of this project was to build a reliable REST API that can fetch a webpage, extract useful information, handle different failure scenarios, and provide a clean interface for users to view the results.


Features

  • Analyze any website URL
  • Fetch HTTP response status
  • Measure website response time
  • Extract webpage title
  • Count H1 headings
  • Check meta description availability
  • Detect images missing alt attributes
  • Calculate a basic SEO score
  • Display audit results through a simple frontend interface
  • Handle invalid URLs, unreachable websites, timeout cases, and non-HTML responses gracefully

Tech Stack

Backend

  • Java
  • Spring Boot
  • REST API
  • Maven
  • Jsoup for HTML parsing

Frontend

  • HTML
  • CSS
  • JavaScript

How To Run The Project

Backend Setup

  1. Clone the repository.
  2. Open the backend project in IntelliJ IDEA.
  3. Build the project using Maven.
  4. Run the Spring Boot application.

The backend will start on: http://localhost:8080


Frontend Setup

Open the index.html file in a browser.

The frontend communicates with the backend API and displays the generated audit report.


API Documentation

Audit Website Endpoint

POST /api/audit


Request Body

Example:

{
  "url": "https://example.com"
}

Successful Response

Example:

{
  "url": "https://example.com",
  "title": "Example Domain",
  "statusCode": 200,
  "wordCount": 21,
  "h1Count": 1,
  "seoScore": 60,
  "metaDescriptionPresent": false,
  "imagesMissingAlt": 0,
  "message": "Audit completed successfully"
}

Error Handling

The application handles different failure scenarios:

Invalid URL

Example: hello

Returns a validation error instead of crashing.

Website Not Reachable

If a website cannot be accessed, the API returns a meaningful error response.

Timeout Handling

If the website does not respond within the configured time limit, the API returns a timeout response.

Non HTML Response

If the URL points to a non-HTML resource, such as an image file, the API identifies it and returns an appropriate response.


Design Decisions

1. Layered Backend Architecture

The application follows a layered structure with separate Controller, Service, DTO, and Exception handling components.

The controller handles API requests, while the service contains the website analysis logic. This keeps the code organized and easier to maintain.

2. Using Jsoup For Website Parsing

Jsoup was used for extracting HTML information because it provides a simple way to parse webpages and access elements like titles, headings, metadata, and images.

This avoids manually processing raw HTML content.

3. Graceful Error Handling

Instead of allowing failures to break the application, different scenarios such as invalid URLs, unreachable websites, timeout cases, and unsupported content types are handled separately.

This makes the API more reliable and user-friendly.


Testing

The project includes automated tests covering:

  • Successful website audit (Happy Path)
  • Website not reachable scenario
  • Non HTML response scenario

These tests verify that the application produces expected results for both successful and failure cases.


Future Improvements

If given additional development time, I would improve the project by adding:

  • More detailed SEO analysis rules
  • Better URL validation
  • Support for asynchronous website scanning
  • Audit history and saved reports
  • More detailed performance metrics

AI Usage

AI tools were used during development for understanding implementation approaches, debugging issues, reviewing possible improvements, and improving project documentation.

The suggestions generated by AI were reviewed and modified according to the project requirements instead of being used directly. The final implementation decisions were made based on the application's design and expected functionality.


Live Demo

Frontend: https://page-pulse-five-pi.vercel.app/

Backend API: https://pagepulse-production-d2a3.up.railway.app/api/audit

Author

Built as part of the Digital Heroes Software Development Internship Task.

About

A web-based website auditing tool built using Spring Boot and JavaScript.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages