# πŸ” Website Monitoring Platform Full-stack website monitoring platform that uses **Google Lighthouse** to audit performance, SEO, accessibility, and best practices β€” with real-time progress tracking, team collaboration, and alerting. ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Website Monitoring β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Frontend │───▢│ Backend │───▢│ PostgreSQL (DB) β”‚ β”‚ β”‚ β”‚ Next.js β”‚ β”‚ Express β”‚ β”‚ via Supabase β”‚ β”‚ β”‚ β”‚ Port 3000 │◀───│ Port 5000β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β–Ό β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ β”‚Lighthouseβ”‚ β”‚ β”‚ └─── SSE ──│ + Chrome β”‚ β”‚ β”‚ (progress) β”‚ Headless β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## ✨ Features | Feature | Status | Description | |---------|--------|-------------| | **Lighthouse Audits** | βœ… Real | Performance, SEO, accessibility, best practices scores | | **Real-time Progress** | βœ… Real | Server-Sent Events stream during scans | | **Dashboard** | βœ… Real | Overview with charts, metrics, and website list | | **Performance Monitoring** | βœ… Real | Track scores over time with Recharts | | **SEO Analysis** | βœ… Real | SEO score tracking and recommendations | | **Uptime Monitoring** | βœ… Real | Periodic uptime checks with alerting | | **Team/Organization** | βœ… Real | Multi-user orgs with role-based access | | **Alerts** | βœ… Real | Configurable alerts for downtime, performance, SSL | | **Competitor Analysis** | βœ… Real | Compare your site metrics against competitors | | **Authentication** | βœ… Real | Supabase Auth (email, OAuth) | | **Scheduled Scans** | βœ… Real | Cron-based automated Lighthouse scans every 6 hours | | **Website Crawler** | βœ… Real | Crawl and discover pages on your websites | ## πŸ›  Tech Stack | Layer | Technology | Cost | |-------|-----------|------| | Frontend | Next.js 15, React 19, TypeScript, Tailwind CSS 4, Shadcn/UI | Free | | Backend | Express.js, TypeScript, Node.js 18+ | Free | | Database | PostgreSQL via Supabase | Free tier | | Auth | Supabase Auth | Free tier | | Auditing | Google Lighthouse + Headless Chrome | Free (OSS) | | Charts | Recharts + Chart.js | Free (OSS) | | CI/CD | GitHub Actions | Free (public repos) | | Containers | Docker + Docker Compose | Free | | Linting | ESLint + Prettier | Free (OSS) | | Testing | Jest + Supertest + Testing Library | Free (OSS) | | Pre-commit | Husky + lint-staged | Free (OSS) | ## πŸš€ Quick Start ### Prerequisites - Node.js 18+ - npm - Docker & Docker Compose (for full stack) - Supabase account (free tier) ### Option 1: Local Development ```bash # Clone the repo git clone cd website-monitoring # Install root dependencies (Husky, concurrently) npm install # Setup backend cd website-monitoring-backend cp .env.example .env npm install npm run build cd .. # Setup frontend cd website-monitoring-frontend cp .env.example .env # Fill in your Supabase keys npm install cd .. # Run everything npm run dev ``` ### Option 2: Docker Compose ```bash # Copy and fill in environment variables cp .env.example .env # Start all services npm run docker:up # Access at http://localhost:3000 ``` ## πŸ“ Project Structure ``` website-monitoring/ β”œβ”€β”€ website-monitoring-backend/ # Express.js API + Lighthouse engine β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ index.ts # Server entry, health check, routing β”‚ β”‚ └── routes/ β”‚ β”‚ └── lighthouse.ts # Lighthouse audit + SSE progress β”‚ β”œβ”€β”€ Dockerfile β”‚ └── package.json β”‚ β”œβ”€β”€ website-monitoring-frontend/ # Next.js 15 dashboard β”‚ β”œβ”€β”€ src/ β”‚ β”‚ β”œβ”€β”€ app/ # Pages & API routes (20+ endpoints) β”‚ β”‚ β”œβ”€β”€ components/ # React components (dashboard, UI, auth) β”‚ β”‚ β”œβ”€β”€ services/ # Business logic (scanning, monitoring) β”‚ β”‚ └── types/ # TypeScript type definitions β”‚ β”œβ”€β”€ Dockerfile β”‚ └── package.json β”‚ β”œβ”€β”€ website-monitoring-devops/ # Infrastructure β”‚ β”œβ”€β”€ docker-compose.yml # Full stack orchestration β”‚ └── .devcontainer/ # VS Code Dev Container config β”‚ β”œβ”€β”€ .github/ β”‚ β”œβ”€β”€ workflows/ β”‚ β”‚ β”œβ”€β”€ backend.yml # Backend CI: lint, test, build β”‚ β”‚ β”œβ”€β”€ frontend.yml # Frontend CI: lint, test, build β”‚ β”‚ └── docker.yml # Docker Compose integration test β”‚ └── pull_request_template.md β”‚ β”œβ”€β”€ CONTRIBUTING.md # Branch strategy, code review, guidelines β”œβ”€β”€ .env.example # Unified environment template └── package.json # Root scripts (dev, build, test, lint) ``` ## πŸ§ͺ Testing ```bash # Run all tests npm test # Backend only (3 tests: health, API info, validation) npm run test:backend # Frontend only (component tests) npm run test:frontend ``` ## πŸ“Š CI/CD Pipelines | Workflow | Trigger | What it does | |----------|---------|-------------| | `backend.yml` | Push/PR to backend | Lint β†’ Test β†’ Build (Node 18 & 20) | | `frontend.yml` | Push/PR to frontend | Lint β†’ Test β†’ Build (Node 18 & 20) | | `docker.yml` | Push/PR to main | Docker Compose build β†’ Backend health check | ## 🀝 Contributing See [CONTRIBUTING.md](./CONTRIBUTING.md) for branch strategy, code style, and PR process. ## πŸ“„ License ISC