Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Page Pulse

Page Pulse is a lightweight web application that analyzes any publicly accessible webpage and generates a concise report containing useful SEO and performance metrics.

The application fetches a webpage, parses its HTML content, and displays key information such as HTTP status, response time, page title, meta description, H1 count, images missing alt attributes, and approximate visible word count.

This project was developed as part of the Digital Heroes Software Development Internship Qualification Task.


✨ Features

  • Analyze any publicly accessible webpage
  • Measure HTTP response status
  • Measure response time
  • Extract page title
  • Extract meta description
  • Count H1 headings
  • Count images without alt attributes
  • Estimate visible word count
  • Clean and responsive user interface
  • Graceful error handling
  • Unit tests for HTML parsing logic

🛠 Tech Stack

Backend

  • Python 3
  • FastAPI
  • Requests
  • BeautifulSoup4
  • Jinja2

Frontend

  • HTML5
  • CSS3
  • Vanilla JavaScript

Testing

  • Pytest

📁 Project Structure

page-pulse/
│
├── app/
│   ├── main.py
│   ├── parser.py
│   ├── templates/
│   │   └── index.html
│   ├── static/
│   │   ├── style.css
│   │   └── script.js
│   └── tests/
│       └── test_parser.py
│
├── requirements.txt
├── README.md
└── .gitignore

⚙️ Installation

1. Clone the repository

git clone https://github.com/hello674583/Page_pulse.git
cd page-pulse

2. Create a virtual environment

Windows

python -m venv venv
venv\Scripts\activate

Linux / macOS

python3 -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Run the application

uvicorn app.main:app --reload

Open your browser and visit:

http://pagepulse-production-fb9a.up.railway.app

📖 API Documentation

FastAPI automatically generates interactive API documentation.

Visit:

http://pagepulse-production-fb9a.up.railway.app/docs

📡 API Endpoint

Request

POST /audit

Request Body

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

Successful Response

{
  "httpStatus": 200,
  "responseTimeMs": 1309,
  "title": "Software, Web & App Development Company | Digital Heroes",
  "metaDescription": "Digital Heroes builds custom software, websites, web & mobile apps, Shopify stores and SaaS. Senior NY + Delhi team, 2,000+ brands shipped in 55+ countries.",
  "h1Count": 1,
  "imagesMissingAlt": 21,
  "wordCount": 3001
}

❌ Error Handling

The application handles several common failure scenarios:

Scenario Response
Invalid URL 422 Unprocessable Entity
Website unreachable 502 Bad Gateway
Request timeout 504 Gateway Timeout
Non-HTML content 400 Bad Request

🧪 Running Tests

Run all unit tests with:

python -m pytest -v -s

The test suite includes:

  • Happy path parsing
  • Missing title
  • Missing meta description
  • Empty HTML
  • Images with and without alt
  • Multiple images missing alt
  • Word count validation

🏗 Design Decisions

1. FastAPI

FastAPI was selected because it provides automatic request validation, excellent performance, and built-in interactive API documentation, making it well suited for a REST API.

2. Separate Parsing Module

The HTML parsing logic is isolated in parser.py, while request handling remains in main.py. This separation of concerns improves maintainability and allows the parser to be tested independently.

3. BeautifulSoup for HTML Parsing

BeautifulSoup was chosen because it can reliably parse HTML, even when pages contain imperfect markup. It provides a simple way to extract titles, meta tags, headings, images, and visible text.


🚀 Future Improvements

If additional development time were available, I would consider adding:

  • SEO health score
  • Open Graph metadata analysis
  • Canonical URL detection
  • Heading hierarchy validation (H1–H6)
  • PDF report export
  • Scan history
  • Response caching
  • Docker support
  • CI/CD with GitHub Actions
  • Integration tests

🤖 AI Usage Statement

AI tools were used to assist with research, troubleshooting, and reviewing implementation ideas. The final application structure, code organization, testing, and project integration were implemented and verified by me.


👨‍💻 Author

Your Name

GitHub: https://github.com/hello674583/Page_pulse


🙏 Acknowledgement

This project was created for the Digital Heroes Software Development Internship Qualification Task.

The application includes the required footer:

Built for Digital Heroes Training Task

which links to:

https://digitalheroesco.com

About

Digital_Heroes_Internship_Task

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages