Skip to content

A simple Node.js application that uses the **Google PageSpeed Insights API** to analyze a website's performance, save results in a JSON file, and display the results using a Bootstrap-styled interface.

Notifications You must be signed in to change notification settings

indrajithc/pagespeed-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 PageSpeed Analyzer

A simple Node.js application that uses the Google PageSpeed Insights API to analyze a website's performance, save results in a JSON file, and display the results using a Bootstrap-styled interface.


🌟 Features

  • 📩 Submit any URL to analyze
  • ⚙️ Uses Google PageSpeed Insights API (mobile strategy)
  • 💾 Saves result in results/ folder as a timestamped JSON file
  • 📊 Displays score and key performance metrics with Bootstrap styling

📸 Demo

screenshot


🧑‍💻 Technologies Used

  • Node.js
  • Express.js
  • EJS templating engine
  • Bootstrap 5
  • node-fetch
  • dotenv

🔑 Requirements

  • Node.js v14+
  • Google PageSpeed Insights API key

🛠️ Setup Instructions

  1. Clone the repository:

    git clone https://github.com/indrajithc/pagespeed-app.git
    cd pagespeed-app
  2. Install dependencies:

    npm install
  3. Create a .env file:

    touch .env

    Add your API key:

    PAGESPEED_API_KEY=your_pagespeed_api_key_here
    

    You can get a free API key from Google PageSpeed API Docs.

  4. Run the app:

    npm start
  5. Visit in browser:

    Open http://localhost:3000


📂 File Structure

pagespeed-app/
├── public/              # Static assets (CSS, etc.)
├── results/             # JSON results saved here
├── views/               # EJS templates for UI
│   ├── index.ejs
│   └── result.ejs
├── .env                 # Contains your API key
├── app.js               # Main server logic
├── package.json
└── README.md

📊 Metrics Displayed

  • Overall Performance Score
  • First Contentful Paint (FCP)
  • Speed Index
  • Largest Contentful Paint (LCP)
  • Time to Interactive (TTI)
  • Total Blocking Time (TBT)
  • Cumulative Layout Shift (CLS)

Color-coded using Bootstrap:

  • 🟢 Green: Good
  • 🟡 Yellow: Needs Improvement
  • 🔴 Red: Poor

✅ License

MIT License


🙌 Acknowledgements

About

A simple Node.js application that uses the **Google PageSpeed Insights API** to analyze a website's performance, save results in a JSON file, and display the results using a Bootstrap-styled interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published