Automated browser execution API powered by Playwright, Fastify, and Docker.
Ideal for remote automation, login handling, web scraping, and headless workflows—accessible via simple HTTP POST calls.
.
├── Dockerfile
├── docker-compose.yml
├── example.env
├── .env # Not committed (add secrets here)
├── package.json
├── runner.ts # Fastify API entrypoint
├── tsconfig.json
├── scripts/ # All .tsx scripts are executed dynamically
│ └── login-demo.tsx # Example Playwright script
git clone https://github.com/yourusername/playwright-runner.git
cd playwright-runnerCreate .env from example.env or edit it directly:
PLAYWRIGHT_PORT=7780
PLAYWRIGHT_HOST=0.0.0.0Ensure the external Docker network exists:
docker network create NETWORKNAMEThen build and start the container:
docker-compose up -d --buildThe API will be available at:
http://localhost:7780/run
Run a specific Playwright script via HTTP.
Headers:
Content-Type: application/json
Body (Example – login-demo.tsx):
{
"script": "login-demo",
"params": {
"username": "tomsmith",
"password": "SuperSecretPassword!"
}
}Response:
{
"status": "ok",
"message": "You logged into a secure area!",
"loggedIn": true
}All scripts are stored in /scripts and executed with:
npx tsx scripts/<script>.tsxEach script should accept params from the CLI:
const args = JSON.parse(process.argv[2] || '{}');Example filename: scripts/login-demo.tsx
Use "script": "login-demo" to run it via API.
- Playwright for browser automation
- Fastify for lightweight API
- TypeScript with
tsxrunner - Docker for containerization
Leon M. Saia
GitHub: @leonmsaia
This tool is intended for educational, automation, and internal use.
Do not use it to interact with external systems you don't own or have permission to automate.
MIT – Free to use, modify, and distribute.