The Website Indexer App is a web-based tool designed to streamline and automate the process of submitting web pages for indexing to Google Search Console. It provides more control and faster visibility of content for website owners and SEO professionals, overcoming the limitations of Google Search Console's daily indexing submission limits and lack of bulk submission features.
Author: Hector Bravo
Create a .env
file in the root directory with the following variables:
# Database
POSTGRES_URL=postgres://<user>:<password>@<host>?sslmode=require
# Google OAuth
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_CLIENT_EMAIL=your_service_account_email
GOOGLE_PRIVATE_KEY=your_service_account_private_key
# NextAuth
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your_nextauth_secret
# Cron Secret
CRON_SECRET=your_api_key_for_daily_indexing
# Email Configuration
EMAIL_HOST=your_smtp_host
EMAIL_PORT=587
EMAIL_SECURE=false
EMAIL_USER=your_email_user
EMAIL_PASSWORD=your_email_password
EMAIL_FROM=your_sender_email
Read GOOGLE-APIS.md for the instructions on getting the values for the Google API's environment variables
migrations/001_create_all.sql
# Install dependencies
npm install
# Run development server
npm run dev
# Build for production
npm run build
# Start production server
npm start
The app includes an automated daily indexing system that processes websites that have auto-indexing enabled. Here's how to set it up:
POST /api/websites/daily-indexing
Bearer Token
authorization matching your CRON_SECRET
Using cURL in a cron job:
0 0 * * * curl -X GET https://your-domain.com/api/websites/daily-indexing \
-H "Authorization: Bearer CRON_SECRET"
Using wget:
0 0 * * * wget --header="Authorization: Bearer CRON_SECRET" \
https://your-domain.com/api/websites/daily-indexing
The job identifies websites that:
enabled = true
auto_indexing_enabled = true
is_owner = true
(service account has owner permissions)For each eligible website, the job:
Rate limiting and error handling:
GET /api/websites
- List all user's websitesPOST /api/websites/refresh
- Refresh websites from Google Search ConsolePOST /api/websites/daily-indexing
- Trigger daily auto-indexing for enabled websites (Protected, requires Authorization: Bearer YOUR_CRON_SECRET header)GET /api/websites/:websiteId
- Get website detailsPOST /api/websites/:websiteId/toggle
- Enable/disable website and auto-indexingGET /api/websites/:websiteId/verify-ownership
- Verify Google Search Console ownershipGET /api/websites/:websiteId/indexing-stats
- Get website indexing statisticsGET /api/websites/:websiteId/pages
- List website pages (Supports query params: all, page, pageSize, orderBy, order)POST /api/websites/:websiteId/pages/:pageId/submit-for-indexing
- Submit a page for indexing (24-hour cooldown between submissions)POST /api/websites/:websiteId/metrics
- Get page impressions and clicks from Google Search ConsoleGET /api/sae
- Get service account email used for Google Search Consolegit checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is licensed under the MIT License - see the LICENSE file for details.