A Phoenix application demonstrating event sourcing with Commanded, featuring real-time domain scanning and analysis.
To start your Phoenix server:
docker run --name event-postgres -e POSTGRES_PASSWORD=mysecretpassword -d -p 5432:5432 postgres
- Run
mix setup
to install and setup dependencies - Start Phoenix endpoint with
mix phx.server
or inside IEx withiex -S mix phx.server
Now you can visit localhost:4000
from your browser.
- Visit
localhost:4000/analyses
in your browser - Click "Start New Analysis" to begin a domain scanning job
- Watch as the job progresses through various states:
- 🚀 Started - Initial scan setup
- 🔍 Discovering Domains - Finding associated domains
- 🌐 Discovering Subdomains - Scanning each domain for subdomains
- ✅ Completed - Final analysis with scoring
- ❌ Failed - If errors occur during scanning
Each scan demonstrates real-time updates through LiveView as it:
- Discovers associated domains
- Finds subdomains for each domain
- Handles retries for failed operations
- Calculates a final score based on findings
✅ Event Sourcing with Commanded
- Process managers for coordinating multi-step scans
- Aggregates for maintaining scan state
- Event handlers for side effects
- Projections for read models
✅ Real-time Updates
- Phoenix LiveView integration
- PubSub for broadcasting scan updates
- ETS-based projections for fast reads
✅ Resilient Processing
- Automatic retries for failed operations
- Configurable retry limits
- Error handling and failure states
✅ Simulated Scanning
- Mock domain discovery
- Subdomain detection
- Scoring system
The application uses:
- Commanded for event sourcing
- Phoenix LiveView for real-time updates
- ETS for high-performance read models
- PubSub for broadcasting updates
- Add persistence for projections
- Implement actual domain scanning logic
- Add authentication and user management
- Add more sophisticated scoring algorithms
- Add export capabilities
- Add historical analysis views
- Deploy to production environment