A modern web tool for analyzing robots.txt files, built with Qwik and deployed on Cloudflare Pages. Try it out at robots-txt.arvid.tech!
- 🔍 Instant robots.txt analysis
- 📊 Comprehensive scoring system
- 🗺️ Sitemap validation
- 🚫 Security recommendations
- 📱 Mobile-friendly interface
- 💾 Export results as JSON or CSV
- ⚡️ Built with Qwik for optimal performance
- Node.js 16+
- npm or yarn
- A
.env.local
file with:ORIGIN="http://localhost:5173" API_KEY="your-api-key" HISTORY_KV="NAME_OF_CLOUDFLARE_KV_NAMESPACE"
- A
wrangler.toml
file with:[[d1_databases]] binding = "DB" database_name = "robots-txt-analyzer" database_id = "YOUR-DATABASE-ID"
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Visit http://localhost:5173
npm run build
npm run preview
This project is deployed on Cloudflare Pages. The build configuration is:
- Build command:
npm run build
- Build output directory:
dist
- Environment variables:
ORIGIN
: Your production URLAPI_KEY
: Your API key for the analyzerDB
: Your Cloudflare D1 database ID
wrangler.toml
: Your Cloudflare D1 database IDwrangler.toml.example
: Examplewrangler.toml
file
Notes:
- Set the
DB
variable in the.env.local
file to your Cloudflare D1 database ID. - For initially setup, push the DB schema to cloudflare, run
npx wrangler d1 execute robots-txt-analyzer --file=./db/schema.sql --remote
.
To cleanup old cache entries, you can run the cleanup endpoint. This will delete all cache entries older than 24 hours.
curl -X GET https://robots-txt.arvid.tech/api/v1/cleanup
Recommendation is to call this using a cron job.
├── src/
│ ├── components/ # Reusable UI components
│ ├── routes/ # Page routes and API endpoints
│ └── utils/ # Utility functions and parsers
├── public/ # Static assets
└── adapters/ # Cloudflare Pages adapter config
- Qwik - The web framework
- Cloudflare Pages - Hosting platform
- Cloudflare D1 - Database
- Tailwind CSS - Styling
Built by Arvid Berndtsson
This project is open source and available under the MIT License.