This project main's goal is to create a bot to automate testing and security issues for the rest of our projects
This project now uses Vite as the server runtime (dev and production preview).
Project runtime values are loaded from .env for the server port and Chromium path.
pnpm installpnpm run devServer runs on http://localhost:3000.
docker compose up --buildThis uses a multi-stage Alpine-based build:
depsstage for full dependency installationbuildstage for TypeScript compilationprod-depsstage for production-only dependenciesruntimestage with a non-root user and system Chromium for Playwright
- Swagger UI:
GET /docs GET /health: health probeGET /bots: lists available botsPOST /run: runs the default bot (smoke)POST /run/:botId: runs a specific bot
Example request:
curl -X POST http://localhost:3000/run/smoke \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"waitForSelector": "h1",
"timeoutMs": 20000
}'Example response:
{
"ok": true,
"result": {
"title": "Example Domain",
"finalUrl": "https://example.com/",
"consoleErrors": [],
"failedRequests": []
}
}The project uses a bot registry/orchestrator model so multiple bots can live in the same repository with low coupling.
Current structure:
src/
bots/
smoke/
index.ts # bot metadata + contract implementation
schema.ts # input parsing and validation
runner.ts # Playwright logic
orchestrator/
errors.ts # typed orchestration errors
registry.ts # bot registration map
runBot.ts # listBots + runBotById
types.ts # shared bot contract
To add a new bot:
- Create
src/bots/<your-bot>/index.ts,schema.ts, andrunner.ts. - Register it in
src/orchestrator/registry.ts. - Call it with
POST /run/<your-bot-id>.
- Plawright (recommended starting point by AI)
- Puppeteer
- Selenium
- Opening pages
- Clicking buttons / filling forms
- Waiting for elements
- Handling authentication flows
- End to end (E2E) testing
- Assertions
- Test runners
- Playwright Test
- Cypress
- Detect broken UI flows
- Catch JS errors
- Identify missing elements or failed requests
- Capturing console errors
- Monitoring network requests
- Handling timeouts and failures
- OWASP Top 10 (must-know vulnerabilities)
- XSS (cross-site scripting)
- SQL injection
- CSRF
- Authentication flaws
- OWASP ZAP (great beginner-friendly scanner)
- Burp Suite
- Inject payloads into forms
- Check if scripts execute (XSS)
- Detect insecure headers
- Crawl pages for vulnerabilities
- Navigate and interact with the app
- Integrate:
- Security payloads (e.g., test inputs)
- External scanners (ZAP API)
- Bot logs into Notion-like app
- Creates pages with malicious inputs
- Checks if anything breaks or executes unexpectedly
- Learn Playwright (automate a login + form)
- Add assertions (test results)
- Capture errors (console + network)
- Study OWASP Top 10
- Try OWASP ZAP manually
- Integrate security tests into your bot
- Opens your app
- Logs in
- Creates a page
- Inputs weird/malicious text
- Checks:
- Did it crash?
- Did scripts run?
- Any console errors?
- TypeScript for frontend interaction and testing
- Python for security research scripts