A comprehensive Django-based system for analyzing component dependencies and assessing change impacts in complex software architectures. This system provides advanced transitive dependency analysis, interactive visualizations, and detailed impact assessments to help teams make informed decisions about system changes.
- Component Management: Define and manage system components with detailed metadata
- Flow Designer: Visual flow designer for creating and managing component relationships
- Transitive Dependency Analysis: Advanced analysis showing both direct and indirect impacts
- Interactive Visualizations: D3.js-powered network graphs with force simulation
- Impact Assessment: Comprehensive severity analysis with business impact scoring
- Runbook Management: Operational procedures and step-by-step guides
- YAML/JSON Import: Import system architectures from external formats
- Multi-directional Analysis: Downstream, upstream, and bidirectional impact analysis
- Depth Control: Configurable analysis depth (1-3 levels or unlimited)
- Severity Calculation: Dynamic severity scoring based on connection types and component criticality
- Impact Paths: Visual representation of dependency chains
- Business Impact Scoring: Quantitative assessment of change impacts
- Component Grouping: Visual distinction between direct and indirect impacts
- Responsive Design: Works seamlessly on desktop and mobile devices
- Real-time Updates: Dynamic component loading and analysis results
- Interactive Elements: Clickable components, expandable sections, and detailed tooltips
- Export Capabilities: Export analysis results and flow diagrams
- Authentication System: Secure user management and session handling
- Python 3.8+
- Django 4.2+
- PostgreSQL (recommended) or SQLite for development
- Node.js (for frontend dependencies)
- Git
git clone https://github.com/yourusername/impact-analysis-system.git
cd impact-analysis-systempython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txt# Create and run migrations
python manage.py makemigrations
python manage.py migrate
# Create superuser
python manage.py createsuperuserpython manage.py loaddata sample_data.jsonpython manage.py runserverVisit http://localhost:8000 to access the application.
impact_analysis_system/
βββ core/ # Core models and business logic
β βββ models.py # Component, Flow, Connection, ImpactAnalysis models
β βββ admin.py # Django admin configuration
βββ api/ # REST API endpoints
β βββ views.py # API viewsets with analysis algorithms
β βββ serializers.py # Data serialization
β βββ urls.py # API routing
βββ frontend/ # Web interface
β βββ views.py # Frontend views
β βββ urls.py # Frontend routing
β βββ templates/ # HTML templates
βββ templates/ # Shared templates
βββ base.html # Base template
βββ frontend/ # Frontend-specific templates
βββ registration/ # Authentication templates
- Purpose: Represents individual system components
- Fields: Name, type, business function, description, metadata
- Types: Database, Service, API, Frontend, Middleware, External Service
- Purpose: Represents system workflows or processes
- Fields: Name, version, description, metadata
- Relationships: Contains multiple components and their connections
- Purpose: Defines relationships between components
- Types: API Call, Data Flow, Message Queue, Database Connection, Event Trigger
- Metadata: Source, target, connection type, custom properties
- Purpose: Stores analysis results and recommendations
- Features: Severity assessment, affected components, analysis metadata
- Analysis Types: Downstream, Upstream, Bidirectional
- Navigate to Components section
- Click "Add Component"
- Fill in component details:
- Name and description
- Component type (Database, Service, API, etc.)
- Business function
- Technical metadata
- Go to Flows section
- Create a new flow or edit existing one
- Use the Flow Designer to:
- Add components to the flow
- Create connections between components
- Position components visually
- Define connection types and metadata
-
Navigate to Impact Analysis
-
Configure analysis parameters:
- Select Flow: Choose the target flow
- Target Component: Select component to analyze
- Analysis Type: Downstream, Upstream, or Bidirectional
- Max Depth: Set analysis depth (1-3 levels or unlimited)
- Severity: Set minimum severity threshold
-
Click "Run Analysis" to execute
- Total Components Affected: Count of all impacted components
- Direct vs Indirect: Breakdown of impact types
- Severity Distribution: Components grouped by impact severity
- Direct Impacts: Components immediately connected to the target
- Indirect Impacts: Components affected through dependency chains
- Impact Paths: Visual representation of dependency flows
- Severity Indicators: Color-coded severity levels
- Network Graph: Interactive D3.js visualization
- Force Simulation: Dynamic positioning based on relationships
- Visual Distinction: Different styles for direct vs indirect impacts
- Interactive Elements: Hover tooltips and clickable components
GET /api/v1/components/ # List all components
POST /api/v1/components/ # Create new component
GET /api/v1/components/{id}/ # Get component details
PUT /api/v1/components/{id}/ # Update component
DELETE /api/v1/components/{id}/ # Delete component
GET /api/v1/flows/ # List all flows
POST /api/v1/flows/ # Create new flow
GET /api/v1/flows/{id}/ # Get flow details
GET /api/v1/flows/{id}/components/ # Get flow components
GET /api/v1/flows/{id}/connections/ # Get flow connections
GET /api/v1/impact-analyses/ # List analyses
POST /api/v1/impact-analyses/ # Run new analysis
GET /api/v1/impact-analyses/{id}/ # Get analysis results
{
"flow": "flow-uuid",
"affected_component": "component-uuid",
"analysis_type": "downstream",
"severity": "medium",
"max_depth": "2",
"include_inactive": false,
"description": "Analysis description"
}{
"id": "analysis-uuid",
"flow": "flow-uuid",
"flow_name": "PayShield Flow",
"affected_component": "component-uuid",
"affected_component_name": "Payment Service",
"severity": "medium",
"affected_components": [
{
"id": "component-uuid",
"name": "Validation Engine",
"type": "service",
"severity": "high",
"impact_type": "direct",
"depth": 1,
"path": ["Payment Service", "Validation Engine"],
"transitive_reason": "Directly connected to the target component"
}
],
"severity_distribution": {
"total": {"low": 2, "medium": 1, "high": 1, "critical": 0},
"direct": {"low": 0, "medium": 1, "high": 1, "critical": 0},
"indirect": {"low": 2, "medium": 0, "high": 0, "critical": 0},
"summary": {
"total_affected": 4,
"direct_affected": 2,
"indirect_affected": 2,
"max_depth": 2
}
}
}# Run all tests
python manage.py test
# Run specific app tests
python manage.py test core
python manage.py test api
python manage.py test frontend
# Run with coverage
coverage run --source='.' manage.py test
coverage report
coverage htmltests/
βββ test_models.py # Model tests
βββ test_views.py # View tests
βββ test_api.py # API tests
βββ test_analysis.py # Impact analysis algorithm tests
βββ fixtures/ # Test data fixtures
- Environment Variables
export DEBUG=False
export SECRET_KEY='your-secret-key'
export DATABASE_URL='postgresql://user:pass@localhost/dbname'
export ALLOWED_HOSTS='yourdomain.com'- Database Configuration
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'impact_analysis',
'USER': 'your_user',
'PASSWORD': 'your_password',
'HOST': 'localhost',
'PORT': '5432',
}
}- Static Files
python manage.py collectstatic- Web Server Configuration
- Use Gunicorn or uWSGI for application server
- Configure Nginx for static files and reverse proxy
- Set up SSL certificates for HTTPS
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN python manage.py collectstatic --noinput
EXPOSE 8000
CMD ["gunicorn", "impact_analysis_system.wsgi:application", "--bind", "0.0.0.0:8000"]- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and add tests
- Ensure all tests pass:
python manage.py test - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow PEP 8 for Python code
- Use Black for code formatting:
black . - Use isort for import sorting:
isort . - Add type hints where appropriate
- Write comprehensive docstrings
type(scope): description
[optional body]
[optional footer]
Types: feat, fix, docs, style, refactor, test, chore
- Use database indexes on frequently queried fields
- Implement connection pooling for high-traffic scenarios
- Consider read replicas for analysis-heavy workloads
- Redis for session storage and temporary data
- Cache analysis results for frequently accessed flows
- Implement cache invalidation on component updates
- Lazy loading for large component lists
- Pagination for analysis history
- Debounced search and filtering
- Django's built-in authentication system
- Role-based access control (RBAC)
- API token authentication for external integrations
- Input validation and sanitization
- SQL injection prevention through ORM
- XSS protection with Django's template system
- CSRF protection for all forms
SECURE_BROWSER_XSS_FILTER = True
SECURE_CONTENT_TYPE_NOSNIFF = True
X_FRAME_OPTIONS = 'DENY'
SECURE_HSTS_SECONDS = 31536000- Django's built-in logging framework
- Custom metrics for analysis performance
- Error tracking with Sentry (optional)
- Analysis execution time
- Database query performance
- API response times
- User activity patterns
# Check database status
python manage.py dbshell
# Reset migrations (development only)
python manage.py migrate --fake-initial# Collect static files
python manage.py collectstatic --clear
# Check STATIC_URL and STATIC_ROOT settings- Check database indexes on Connection and FlowComponent tables
- Consider reducing max_depth for large flows
- Monitor memory usage during complex analyses
Enable debug logging:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
},
'loggers': {
'impact_analysis': {
'handlers': ['console'],
'level': 'DEBUG',
},
},
}- Chiraag Bhatia
- Django community for the excellent web framework
- D3.js team for powerful visualization capabilities
- Bootstrap team for responsive UI components
For support, email absurdcoders@gmail.com or create an issue in the GitHub repository.
Built with β€οΈ using Django, D3.js, and modern web technologies