SiteScope (An authenticated SEO audit platform that analyzes any website with PageSpeed Insights, on-page SEO checks, report history, PDF export, and Cloudinary-powered user profiles.)
This project includes:
- Next.js 16 App Router frontend with Tailwind CSS
- Express.js backend with MongoDB
- Email/password signup and login
- JWT authentication stored in HTTP-only cookies
- Google OAuth and GitHub OAuth using Passport.js
- Protected frontend and backend routes
- Website analysis with Google PageSpeed Insights + basic on-page SEO checks
- Saved report history per user with delete-one and delete-all actions
- Animated circular score visuals, PDF report export, and Cloudinary-backed profile avatars
app/- Next.js pagescomponents/- shared frontend UI and auth providerlib/- frontend fetch helpers and shared typesproxy.ts- Next.js 16 route protection redirectsserver/src/config- database and Passport configserver/src/controllers- auth controller logicserver/src/middleware- JWT protection and error handlingserver/src/models- MongoDB user modelserver/src/routes- auth API routes
Create these files before running the app:
NEXT_PUBLIC_API_URL=http://localhost:5000PORT=5000
MONGODB_URI=mongodb://127.0.0.1:27017/seo-geo-auth
JWT_SECRET=replace_with_a_long_random_secret
JWT_EXPIRES_IN=7d
FRONTEND_URL=http://localhost:3000
BACKEND_URL=http://localhost:5000
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GITHUB_CLIENT_ID=your_github_client_id
GITHUB_CLIENT_SECRET=your_github_client_secret
PAGESPEED_API_KEY=your_google_pagespeed_api_key_optional
CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secretFor OAuth providers, set callback URLs to:
http://localhost:5000/api/auth/google/callbackhttp://localhost:5000/api/auth/github/callback
npm install
cd server
npm install
cd ..Run both apps together from the project root:
npm run devThis starts:
- Frontend:
http://localhost:3000 - Backend:
http://localhost:5000
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/logoutGET /api/auth/googleGET /api/auth/google/callbackGET /api/auth/githubGET /api/auth/github/callbackGET /api/auth/mePOST /api/analysisGET /api/analysis/historyDELETE /api/analysis/historyDELETE /api/analysis/history/:idPOST /api/profile/avatar
/login/signup/
- JWTs are stored in the
auth_tokenHTTP-only cookie. proxy.tsredirects unauthenticated users away from/and redirects authenticated users away from/loginand/signup.- The homepage re-checks the session through
/api/auth/meafter load so stale cookies still fall back safely to/login. - The analysis endpoint combines PageSpeed Insights data with HTML-level checks for title tags, meta descriptions, headings, images, page size, and suggestions.
- Each analysis is stored in a dedicated reports collection and surfaced in the dashboard history panel.
- The report view includes animated circular score indicators and can be exported to PDF from the dashboard.
- Profile details and logout are grouped into a dedicated profile section, and avatar uploads are stored in Cloudinary.