⚠️ DISCLAIMER: This software is intended for educational and research purposes only. The goal is to demonstrate RPA (Robotic Process Automation) capabilities in a containerized environment. Use responsibly and in accordance with the target website's Terms of Service.
Cambio Medico Lombardia Automation is a containerized RPA tool for the Fascicolo Sanitario Elettronico.
It automates the monitoring of family doctor availability and notifies users via Telegram.
graph TD
User((User)) -->|Commands /start, /stop| Telegram[Telegram Bot]
Telegram -->|Control| App[Node.js App]
App -->|Notifications| Telegram
subgraph DockerContainer [Docker Container]
App -->|Controls| Chrome[Headless Chrome]
Chrome -->|Scrapes| Portal[Lombardia Health Portal]
App -->|Persists| Cookies[Session Storage]
VNC[VNC Server] -.->|Monitor/Debug| Chrome
end
User -.->|"Manual Login (2FA)"| VNC
- 🔄 Automated Scanning: Periodically checks for doctor availability in configured municipalities.
- 🐳 Dockerized Environment: Isolated execution with persistent session storage.
- 🔐 Hybrid Authentication: Uses VNC for initial manual login (handling SPID/CIE/2FA), then switches to automated cookies.
- 📱 Telegram Integration: Control the bot and receive real-time notifications with screenshots.
- 🛡️ Error Recovery: Automatic retry logic and process resilience.
| Telegram Notification | VNC Login Interface |
|---|---|
![]() |
![]() |
| Real-time alerts with screenshots | Secure manual authentication via VNC |
- Docker Engine (20.10+) & Docker Compose
- Telegram Bot Token & Chat ID
git clone https://github.com/lorenzo-deluca/lombardia-medico-finder.git
cd lombardia-medico-finder
cp .env.example .envEdit .env with your credentials:
| Variable | Description |
|---|---|
TELEGRAM_BOT_TOKEN |
Token from @BotFather |
TELEGRAM_CHAT_ID |
Your numeric Chat ID |
VNC_PASSWORD |
Password for VNC access (Default: secret) |
SEARCH_INTERVAL_MINUTES |
Check frequency in minutes (Default: 1) |
docker compose up --build -dSee docs/synology_deployment.md for NAS deployment.
Initial login requires manual interaction due to 2FA protections.
- Start the container.
- Connect to
localhost:5900via VNC (Password:secret). - Log in to the portal manually.
- The bot detects the session and begins automation.
| Command | Action |
|---|---|
/status |
Check service status. |
/start |
Resume monitoring. |
/stop |
Pause monitoring. |
/restart |
Restart the application container. |
lombardia-medico-finder/
├── dist/ # Compiled JavaScript (Runtime)
├── src/
│ ├── auth.ts # Authentication logic (Cookies/2FA)
│ ├── index.ts # Application Entry Point
│ ├── logger.ts # Winston logger config
│ ├── search.ts # Core Puppeteer scanning logic
│ └── telegram.ts # Telegram Bot wrapper
├── cookies/ # Persistent session storage (Docker Volume)
├── screenshots/ # Debug captures (Docker Volume)
├── docs/ # Documentation & Assets
├── Dockerfile # Multi-stage Docker build
└── docker-compose.yml # Container orchestrationContributions, issues, and feature requests are welcome! Feel free to check issues page if you want to contribute.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
See CONTRIBUTING.md for more details.
MIT License - see LICENSE.

