Microservices platform that automates web application testing end-to-end: crawl a target site, extract user requirements from uploaded documents with ML, generate test cases, synthesize test data, execute tests, and analyze failures β all from a single modern React dashboard.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser / React Dashboard β
β http://localhost:3000 β
β Crawler β’ User Stories β’ Context β’ Test Cases β’ Data Gen β
β Execution β’ Bugs β’ History β’ Reports β’ Settings β
βββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β HTTP REST + WebSocket (live events)
βββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β Orchestrator :3001 β
β pipeline controller β’ session lifecycle β’ WebSocket relay β
β pause / stop / resume β’ heartbeat monitoring β
ββββ¬βββββββββββ¬βββββββββββββ¬βββββββββββ¬ββββββββββββ¬ββββββββββββ
β β β β β
ββββΌββββ βββββΌβββ βββββββββΌβββ ββββββΌβββ βββββββΌβββββββ
βExplorβ βContxtβ βTest Casesβ βDataGenβ β Execution β
β:5000 β β:3003 β β :3007 β β :3004 β β :3005 β
ββββ¬ββββ ββββββββ ββββββββββββ βββββββββ βββββββ¬βββββββ
β State graph β Neo4j β 3-strategy click fallback
β β live WS streaming
β βββββββββββββββββββββββ βββββββββΌβββββββ
ββββ UserStoriesExtract β β Bug Analyzer β
β (FLAN-T5 + LoRA) β β :3006 β
β :8000 β ββββββββββββββββ
βββββββββββββββββββββββ
(All services share)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β MongoDB :27017 β Redis :6379 β Neo4j :7687 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Pipeline Flow: Upload user stories document + start crawl β Exploration crawls site & ML extracts stories in parallel β Context Detection β Test Case Generation β Data Generation β Execution β Bug Analysis β Reports
New in this release: Full pipeline pause / stop / resume controls, improved execution engine with three-strategy click fallback, professional StateFlow graph visualization (Cytoscape.js), redesigned History and Settings pages, and real-time WebSocket execution streaming.
| Service | Port | Language | Role |
|---|---|---|---|
| Frontend | 3000 | React + Vite + Tailwind | Dashboard UI β Crawler, Execution, Reports, History, Settings |
| Orchestrator | 3001 | Node.js | Pipeline controller, sessions, WebSocket relay, pause/resume |
| Exploration | 5000 | Node.js + Playwright | Web crawler, state-graph extraction, user stories API |
| Context Detection | 3003 | Node.js | Form/element classification with AI |
| Test Case Generation | 3007 | Node.js | AI-driven test scenario synthesis |
| Data Generator | 3004 | Node.js | Synthetic test data via Faker.js |
| Execution | 3005 | Node.js + Playwright | Test runner with live WS streaming, pass/fail recording |
| Bug Analyzer | 3006 | Node.js | Failure detection and AI root-cause analysis |
| UserStoriesExtractor | 8000 | Python / FastAPI | FLAN-T5 + LoRA for structured user story extraction |
Note: The UserStoriesExtractor ML service is optional in local mode. When unavailable, the Exploration service automatically falls back to a rule-based "As aβ¦ I wantβ¦ so thatβ¦" parser β the rest of the pipeline continues normally.
| Component | Port | Notes |
|---|---|---|
| MongoDB | 27017 | Local install or Docker (full mode) |
| Redis | 6379 | Docker (docker compose -f docker-compose.full.yml up -d redis) |
| Neo4j | 7687 | Docker (full mode) β stores StateFlow graph data |
Frontend β React + Vite + Tailwind dashboard. Sections:
- Crawler β start/configure crawl sessions, upload user story documents
- User Stories β view ML-extracted story cards with confidence rings
- Context β classified form fields and navigation elements
- Test Cases β AI-generated test scenarios
- Data Generator β synthetic data sets per test case
- Execution β live test run with pass/fail per case, skip controls, real-time progress
- Bugs β deduplicated failure list with AI root-cause summaries
- History β all past sessions with metadata, filterable table
- Reports β Application Context summary + interactive StateFlow Graph (Cytoscape.js)
- Settings β 5-tab sidebar: General, AI Providers, Crawler, Execution, Appearance
Orchestrator β Central pipeline controller. Manages crawl sessions in MongoDB, routes pipeline-stage jobs to downstream services, relays real-time events over WebSocket. Supports pause / stop / resume at any pipeline stage with heartbeat monitoring to detect stalled services. Uses ORCHESTRATOR_INTERNAL_URL for Docker-internal callback routing.
Exploration β Playwright-based crawler. Navigates the target site, extracts page elements (forms, links, screenshots), and builds a state graph stored in Neo4j and local file storage. Also exposes the User Stories REST API (POST /api/user-stories/upload, POST /api/user-stories/process). Falls back to local regex extraction when the ML service is unreachable.
UserStoriesExtractor (ML) β Python FastAPI service in services/exploration/src/UserStoriesExtractor/. Uses a fine-tuned FLAN-T5 model with LoRA adapters to parse uploaded PDF/DOCX/TXT documents into structured user stories (actor Β· action Β· benefit Β· acceptance criteria). Required only for Docker full mode or if you install PyTorch locally.
Context Detection β Classifies form fields and UI elements using AI (Gemini / Ollama / OpenRouter).
Test Case Generation β Generates test cases from the classified context using configurable AI models.
Data Generator β Produces realistic synthetic values for each test-case field using Faker.js, with field-type awareness (email, phone, name, dateβ¦).
Execution β Replays test cases against the live target site with Playwright. Features:
- Three-strategy click fallback: standard β force-click β keyboard Enter (handles custom button implementations)
- Live WebSocket streaming of each step result to the dashboard
- Skip-test support (skips remaining steps in a case, continues to next)
- Pipeline pause / stop hooks β executor checks flags between steps
- Artifacts saved per crawl session (screenshots, logs)
Bug Analyzer β Correlates execution failures, infers root causes with AI, and surfaces a deduplicated bug report with severity ratings.
StateFlow Graph β Interactive state-graph visualization in the Reports tab, powered by Cytoscape.js:
- Node types: Entry (diamond, blue), Form (amber), Content-Heavy (emerald), Dead-End (red dashed), Standard (violet)
- Typed edges: Navigation, Form Submit (dashed amber), Button Click (indigo)
- Five layout modes: Grid (default), Tree Top-Down, Concentric (depth rings), Force-Directed, Radial
- Glass-morphism floating UI: stats badge, collapsible legend, zoom/fit/export toolbar, refresh + fullscreen toggle
- Neighborhood dimming on hover, rich tooltips, click-to-open detail modals
- Node.js 18+ and npm 9+
- Docker Desktop (for MongoDB / Redis / Neo4j infrastructure)
- PowerShell 5.1+ (Windows)
- An AI API key β OpenRouter is recommended (free tier at https://openrouter.ai); Gemini or Ollama also work
- (Optional) Python 3.9+ with PyTorch β only needed for ML-based user story extraction
git clone https://github.com/Hassan-301/FYP-AutoValid.git
cd autovalid-microservices
copy .env.example .env
notepad .envAt minimum set OPENROUTER_API_KEY (or GEMINI_API_KEY) in .env.
# Installs npm packages for all Node services
.\install-all.ps1(Optional) To also install Python deps for ML extraction:
cd services\exploration\src\UserStoriesExtractor
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
cd ..\..\..\..docker compose -f docker-compose.full.yml up -d mongodb redis neo4j.\start-all.ps1Starts all Node services in separate terminal windows and attempts to start the Python ML service. If Python/PyTorch is not installed, a warning is shown and the app continues with the rule-based fallback β no error.
Optional flags:
.\start-all.ps1 -ForceRestart # Kill existing listeners first
.\start-all.ps1 -InstallDeps # Run npm install before starting
.\start-all.ps1 -InstallPythonDeps # Run pip install before starting Python servicehttp://localhost:3000
Sign up for an account, then follow the pipeline walkthrough below.
.\stop-all.ps1No Node.js, no MongoDB, no Python required on your machine.
Everything runs inside Docker containers β including the ML service.
- Docker Desktop installed and running
- An OpenRouter API key (free at https://openrouter.ai)
git clone https://github.com/Hassan-301/FYP-AutoValid.git
cd autovalid-microservices
copy .env.example .env
notepad .env # Set OPENROUTER_API_KEY and change passwords if desired.\docker-up.ps1Builds all images and starts every service. First run downloads base images and installs Playwright browser binaries β allow ~5β10 minutes.
| URL | Service |
|---|---|
| http://localhost | Main app (via API gateway) |
| http://localhost:3000 | Frontend direct |
| http://localhost:3001 | Orchestrator API |
| http://localhost:7474 | Neo4j Browser |
.\docker-up.ps1 -Down.\docker-up.ps1 -Logsdocker compose -f docker-compose.full.yml down -vCopy .env.example to .env and edit the values. Key variables:
# ===== AI Provider (choose one) =====
# openrouter β multi-model via API (recommended for Docker mode)
# gemini β cloud, fast (recommended for local mode)
# ollama β local, no API key required, slower
CONTEXT_AI_PROVIDER=openrouter
OPENROUTER_API_KEY=your_openrouter_key_here
CONTEXT_AI_MODEL=meta-llama/llama-3.1-8b-instruct
TEST_CASE_GEN_AI_PROVIDER=openrouter
TEST_CASE_GEN_AI_MODEL=meta-llama/llama-3.1-8b-instruct
# Optional: Ollama for local models
OLLAMA_BASE_URL=http://127.0.0.1:11434
# ===== Service Ports =====
FRONTEND_PORT=3000
ORCHESTRATOR_PORT=3001
CONTEXT_PORT=3003
DATA_GEN_PORT=3004
EXECUTION_PORT=3005
BUG_ANALYZER_PORT=3006
TEST_CASE_GEN_PORT=3007
# ===== Databases =====
MONGODB_URL=mongodb://127.0.0.1:27017/autovalid
REDIS_URL=redis://127.0.0.1:6379
# ===== Crawler Defaults =====
MAX_DEPTH=10
MAX_PAGES=100
CRAWLER_TIMEOUT=300000
# ===== Execution Tuning =====
EXECUTION_STEP_TIMEOUT_MS=20000
EXECUTION_NAV_TIMEOUT_MS=60000
# ===== UserStoriesExtractor ML Tuning (Docker full mode only) =====
USER_STORIES_NUM_BEAMS=2 # beam search width (quality vs speed)
USER_STORIES_MAX_TOKENS=384 # max output tokens per storyhttp://localhost:3000
Sign up for an account and log in.
Open the Crawler section:
- Target β enter the URL to crawl (e.g.
https://example.com) - Authentication β optional: provide credentials if the site requires login
- User Stories β drag-and-drop or select a PDF, DOCX, or TXT document containing your requirements; a progress bar confirms the upload
Click Start Crawl. The service simultaneously crawls the site with Playwright and sends the uploaded document to the ML service for extraction. Both complete asynchronously and results appear in their respective dashboard sections.
Navigate to User Stories. Each story card shows:
- Actor Β· Action Β· Benefit breakdown
- Acceptance criteria list
- Confidence score ring (hybrid: 25 % model probability + 50 % structural quality + 25 % JSON completeness)
- Summary statistics: total stories, average confidence, actor distribution
From the crawl session card, trigger each stage in order. Each stage shows a live status badge (Pending β Running β Completed / Failed) and a result count.
Pipeline Controls β once a pipeline stage is running you can:
- Pause β suspends execution between steps (resumes from where it left off)
- Stop β gracefully halts the current stage and marks it stopped
- Resume β continues a paused pipeline from the current step
| Stage | Service | What it does |
|---|---|---|
| Generate App Context | Context Detection :3003 | Classifies forms and navigation with AI |
| Generate Test Cases | Test Case Generation :3007 | Creates natural-language test scenarios |
| Generate Test Data | Data Generator :3004 | Fills each test case with synthetic data |
| Execute Test Cases | Execution :3005 | Runs tests with Playwright, streams results live |
| Analyze Bugs | Bug Analyzer :3006 | Infers root causes for failures |
- Execution β per-test pass/fail with logs, screenshots, and live step streaming
- Bugs β deduplicated list of failures with AI root-cause summaries and severity
- History β all past crawl sessions in a searchable table (MongoDB-backed)
- Reports β Application Context summary + interactive StateFlow Graph
- Five layout modes: Grid, Tree, Concentric, Force-Directed, Radial
- Click nodes/edges to open detail modals; hover to highlight neighborhood
- Collapsible legend; fullscreen toggle; export PNG
.\stop-all.ps1Kills all Node and Python service processes by port (3000, 3001, 3003β3007, 5000, 8000) and stops local infrastructure containers.
To stop only the Docker infrastructure:
docker compose -f docker-compose.full.yml downstart-all.ps1 opens each service in its own PowerShell window titled with the service name and port. Scroll the window or close it individually to stop that service.
# MongoDB β inspect sessions, stories, results
mongosh mongodb://127.0.0.1:27017/autovalid
# Redis β inspect job queues
redis-cli
> INFO
> KEYS *OpenRouter (Recommended β multi-model, free tier available)
CONTEXT_AI_PROVIDER=openrouter
OPENROUTER_API_KEY=your_key
CONTEXT_AI_MODEL=meta-llama/llama-3.1-8b-instruct
TEST_CASE_GEN_AI_MODEL=meta-llama/llama-3.1-8b-instructGemini (Cloud, fast)
CONTEXT_AI_PROVIDER=gemini
GEMINI_API_KEY=your_key
GEMINI_MODEL=gemini-2.0-flash
TEST_CASE_GEN_AI_MODEL=gemini-2.0-flashOllama (Local β no API key, slower)
CONTEXT_AI_PROVIDER=ollama
OLLAMA_BASE_URL=http://127.0.0.1:11434# Pull model first
ollama pull llama3.1:8b
ollama serveIn local mode (without Python/PyTorch), user stories are extracted using a rule-based parser:
- Parses "As a <actor>, I want to <action>, so that <benefit>" templates
- Extracts acceptance criteria from "verified byβ¦" and "- Verifyβ¦" bullet patterns
In Docker full mode, the FLAN-T5 + LoRA ML model is used instead, giving richer structured output with confidence scores.
Tune ML behaviour via .env (Docker only):
USER_STORIES_NUM_BEAMS=2 # more beams β better quality, slower
USER_STORIES_MAX_TOKENS=384# Re-run with install flags to refresh dependencies
.\start-all.ps1 -ForceRestart -InstallDeps -InstallPythonDepsCheck the service window for the stack trace.
Ensure mongod is running locally before calling start-all.ps1:
# Check if MongoDB is listening
Test-NetConnection -ComputerName 127.0.0.1 -Port 27017Start it via MongoDB Compass, the Windows service, or:
mongod --dbpath C:\data\dbdocker compose up -d redis
# verify
docker compose psThe model is downloaded on first run (~1 GB). Ensure you have internet access and enough disk space. On CPU the first inference request may take 30β60 seconds.
# Run the service manually to see errors
cd services\exploration\src\UserStoriesExtractor
.\.venv\Scripts\python.exe -m uvicorn src.serve:app --host 0.0.0.0 --port 8000# Find and kill the occupying process
.\stop-all.ps1
# Or target a single port
Get-NetTCPConnection -LocalPort 5000 -State Listen | Select-Object OwningProcess
Stop-Process -Id <PID> -Force- Generate a key: https://makersuite.google.com/app/apikey
- Set
GEMINI_API_KEY=your_keyin.env - Restart affected services with
.\stop-all.ps1 ; .\start-all.ps1
ollama pull llama3.1:8b
curl http://127.0.0.1:11434/api/tags
### Services keep restarting
```bash
# View detailed service logs
docker-compose logs -f --tail=50
# Check memory/CPU
docker stats
# Increase Docker memory limit in Docker Desktop settings
autovalid-microservices/
βββ frontend/ # React Dashboard UI (Port 3000)
β βββ src/
β β βββ pages/dashboard/
β β β βββ CrawlerPage.jsx # Automation Pipeline UI
β β β βββ ExecutionPage.jsx # Test Execution Results
β β β βββ BugsPage.jsx # Bug Reports & Analysis
β β β βββ HistoryPage.jsx # Session History
β β β βββ SettingsPage.jsx # Configuration UI
β β β βββ ...
β β βββ components/
β β β βββ DashboardSidebar.jsx # Navigation (incl. User Stories)
β β β βββ DashboardHeader.jsx # Page Headers
β β β βββ DashboardSections.jsx # Page Router
β β βββ pages/dashboard/
β β β βββ UserStoriesPage.jsx # User Stories viewer
β β β βββ ... # Other dashboard pages
β β βββ legacy/ # Legacy Interop Layer
β βββ package.json
β
βββ services/
β βββ exploration/ # Web Crawler (Port 5000)
β β βββ src/crawler/ # Playwright automation
β β βββ src/models/ # Data models (incl. UserStory)
β β βββ src/api/ # API routes (incl. user-stories-routes)
β β βββ src/routes/ # Legacy API endpoints
β β
β βββ orchestrator/ # Job Queue Manager (Port 3001)
β β βββ src/middleware/ # Auth, logging
β β βββ src/routes/ # Session management
β β βββ src/services/ # BullMQ queue
β β
β βββ context-detection/ # AI Form Analysis (Port 3003)
β β βββ src/services/ # AI client, analysis
β β βββ src/routes/ # Analysis endpoints
β β
β βββ data-generator/ # Synthetic Test Data (Port 3004)
β β βββ src/services/ # Faker.js generation
β β βββ src/routes/ # Generation endpoints
β β
β βββ execution/ # Playwright Executor (Port 3005)
β β βββ src/services/ # Script generator, runner
β β βββ src/routes/ # Execution endpoints
β β
β βββ bug-analyzer/ # Bug Detection (Port 3006)
β β βββ src/services/ # AI analysis service
β β βββ src/routes/ # Analysis routes
β β
β βββ test-case-generation/ # AI Test Creation (Port 3007)
β βββ src/services/ # AI client, generator
β βββ src/routes/ # Generation endpoints
β
βββ docker-compose.yml # Service definitions
βββ .env.example # Configuration template
βββ .env # Configuration (gitignored)
βββ package.json # Root scripts
βββ README.md # This file
βββ install-all.ps1, start-all.ps1 # Helper scripts
# Service URLs
- Frontend: http://localhost:3000
- Exploration API: http://localhost:5000/api
- Orchestrator API: http://localhost:3001/api
- Neo4j Browser: http://localhost:7474
- MongoDB: mongodb://127.0.0.1:27017/autovalid
# Root directory
npm run install-all # Install all service dependencies
npm run start-all # Start all services (background)
npm run stop-all # Stop all services
# Docker operations
docker-compose up -d # Start all with Docker
docker-compose down # Stop all
docker-compose logs -f # View live logs
docker-compose build # Rebuild images- Set strong database passwords in
.env - Use Gemini API key from production environment
- Configure SSL/TLS certificates
- Setup health check monitoring
- Configure resource limits in docker-compose.yml
- Setup automated MongoDB backups
- Configure centralized logging
- Test failover and recovery procedures
- Setup CI/CD pipeline for automation
- Monitor API response times and error rates
# Build optimized images
docker-compose build --no-cache
# Verify image sizes
docker images | grep autovalid
# Test production environment
docker-compose -f docker-compose.yml up -d- GitHub Issues: https://github.com/Hassan-301/FYP-AutoValid/issues
- Include logs from
docker-compose logs -f - Provide
.envconfiguration (sanitized)
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit changes:
git commit -m "Add your feature" - Push to branch:
git push origin feature/your-feature - Submit a Pull Request
AutoValid - Automated Test Case Generation and Bug Detection Platform FYP (Final Year Project)
- Repository: https://github.com/Hassan-301/FYP-AutoValid
- Architecture: Microservices with AI/ML pipeline
- Technologies: Node.js, React, MongoDB, Docker, Playwright, Gemini AI
POST /api/sessions # Create crawl session
GET /api/sessions # List sessions
GET /api/sessions/:sessionId # Get session status
WS /ws?sessionId=xxx # WebSocket for real-time updates
POST /explore # Start crawling
GET /session/:sessionId # Get crawl data
POST /api/user-stories/upload # Upload document (PDF/DOCX/TXT)
POST /api/user-stories/process # Extract & store user stories
GET /api/user-stories/:sessionId # Get processed stories + stats
DELETE /api/user-stories/:sessionId # Delete session stories
POST /analyze # Analyze elements
POST /generate/:fieldId # Generate test data
POST /execute/:testId # Execute test
POST /analyze # Analyze results
- β Extract frontend service
- β Create orchestrator with job queue
- β Setup API Gateway
- β MongoDB + Redis infrastructure
- Extract exploration service (from backend/crawler)
- Create context-detection service
- Map element relationships
- Implement Neo4j graph storage
- Create execution service
- Create bug-analyzer service
- Implement defect detection
- Create comprehensive reporting
- Optimize Docker images
- Setup CI/CD pipeline
- Load testing & scaling
- Production deployment
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f [service-name]
# Rebuild service
docker-compose build [service-name]
# Restart service
docker-compose restart [service-name]
# Stop all services
docker-compose down
# Remove volumes (reset data)
docker-compose down -v# Terminal 1: Start orchestrator
cd orchestrator
npm install && npm run dev
# Terminal 2: Start exploration
cd services/exploration
npm install && npm run dev
# Terminal 3: Start frontend
cd frontend
npm install && npm run devCreate .env in project root:
NODE_ENV=development
LOG_LEVEL=debug
DB_PASSWORD=your_secure_password
NEO4J_PASSWORD=neo4j_password
REDIS_URL=redis://redis:6379
MONGODB_URL=mongodb://autovalid:password@mongodb:27017/autovalid?authSource=admin
All services expose /health endpoint:
curl http://localhost:3001/health # Orchestrator
curl http://localhost:3002/health # Exploration
# etc...docker-compose exec redis redis-cli
> INFO
> KEYS crawls:*docker-compose exec mongodb mongosh -u autovalid -p <password> --authenticationDatabase admin
> use autovalid
> db.crawl_sessions.find()
> db.job_queue.find()Access Neo4j Browser at http://localhost:7474
- User: neo4j
- Password: (from NEO4J_PASSWORD)
- API Gateway validates all requests
- Service-to-service communication on internal network only
- JWT authentication (to implement in Week 2)
- Rate limiting per endpoint
- CORS configured for frontend domain
- REST API for session management
- WebSocket for real-time updates
- Polling for status updates
- HTTP REST endpoints
- BullMQ job queue
- Redis pub/sub for events
- MongoDB: persistent session/test data
- Redis: caching and job queue
- Neo4j: graph data and relationships
# Check logs
docker-compose logs [service-name]
# Verify dependencies
docker-compose exec mongodb mongosh -u autovalid -p <password> --authenticationDatabase admin
docker-compose exec redis redis-cli ping# Verify DATABASE_URL in .env
# Check MongoDB is healthy
docker-compose exec mongodb mongosh -eval 'db.adminCommand("ping")'# Check Redis is running
docker-compose exec redis redis-cli ping
# Should return PONGEach service can be replicated:
# docker-compose.yml
exploration:
deploy:
replicas: 3- Nginx routes requests to service replicas
- Redis pub/sub for distributed events
- MongoDB for shared state
- Redis cache layer for frequent queries
- Database connection pooling
- Service-level caching
- CDN for static frontend assets
- Branch naming:
feature/service-nameorfix/issue-number - Commit messages:
[service-name] description - Create pull request with test results
- Update service README with changes
MIT - See LICENSE file
For issues or questions:
- Check documentation
- Review service logs
- Open GitHub issue with error details and logs