# cristiano-corrado/django-defectdojo architecture

> Architecture diagram of the GitHub repository cristiano-corrado/django-defectdojo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cristiano-corrado/django-defectdojo
- Repository: https://github.com/cristiano-corrado/django-defectdojo

## Overview

##### Key Relationships

a. Client Interaction Flow
- External clients → Nginx → Django application
- API clients → API endpoints
- Authentication flow through various providers

b. Data Flow
- Scanner data import path
- Finding management workflow
- Report generation process
- Notification system

##### Specific Architectural Elements

a. Core Services (from dojo/ directory)
- Findings management
- Product/Engagement tracking
- User management
- Report generation
- API services
- Metrics collection

b. Integration Points
- Scanner integration points
- External authentication services
- Issue tracker connections
- API endpoints

##### Implementation Details

- Core application components (blue)
- External integrations (green)
- Security components (red)
- Storage systems (yellow)
- Background processes (purple)

**[Client Browsers] → [Load Balancer/Nginx] → [Django Application Servers]**
- ↓
**[External Scanners] → [Integration Layer] → [Background Workers]**
- ↓
- [Storage Layer]

##### Deployment View

- Docker container organization
- Service dependencies
- Volume mounts
- Network configurations

Remember to include version control, CI/CD, and deployment paths as auxiliary systems that support the main application architecture.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        Browser["Web Browser"]
        APIClient["API Client"]
    end

    subgraph "Web Layer"
        NGINX["NGINX Server"]:::webserver
        Django["Django Application"]:::core
        APIv1["API v1"]:::api
        APIv2["API v2"]:::api
        Auth["Authentication"]:::security
    end

    subgraph "Background Processing"
        CeleryWorker["Celery Workers"]:::worker
        CeleryBeat["Celery Beat"]:::worker
    end

    subgraph "Storage Layer"
        DB[(Database)]:::storage
        FileStorage[("File Storage")]:::storage
    end

    subgraph "Integration Layer"
        Scanners["Security Scanners"]:::integration
        JIRA["JIRA Integration"]:::integration
        ToolConfig["Tool Configurations"]:::integration
    end

    subgraph "Core Services"
        Findings["Findings Management"]:::core
        Products["Product Management"]:::core
        Engagements["Engagement Tracking"]:::core
        Reports["Report Generation"]:::core
        Metrics["Metrics Collection"]:::core
        Users["User Management"]:::core
    end

    Browser --> NGINX
    APIClient --> |API Requests| APIv1
    APIClient --> |API Requests| APIv2
    NGINX --> Django
    Django --> Auth
    Django --> APIv1
    Django --> APIv2
    Django --> |Tasks| CeleryWorker
    CeleryBeat --> |Scheduled Tasks| CeleryWorker
    CeleryWorker --> DB
    Django --> DB
    Django --> FileStorage
    Scanners --> |Import Findings| Django
    Django --> JIRA
    Django --> ToolConfig
    
    Django --> Findings
    Django --> Products
    Django --> Engagements
    Django --> Reports
    Django --> Metrics
    Django --> Users

    %% Click Events
    click NGINX "https://github.com/cristiano-corrado/django-DefectDojo/blob/master/nginx/nginx.conf"
    click Django "https://github.com/cristiano-corrado/django-DefectDojo/blob/master/dojo/settings/settings.dist.py"
    click APIv1 "https://github.com/cristiano-corrado/django-DefectDojo/blob/master/dojo/api.py"
    click APIv2 "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/api_v2"
    click Auth "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/user"
    click CeleryWorker "https://github.com/cristiano-corrado/django-DefectDojo/blob/master/docker/entrypoint-celery-worker.sh"
    click CeleryBeat "https://github.com/cristiano-corrado/django-DefectDojo/blob/master/docker/entrypoint-celery-beat.sh"
    click FileStorage "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/uploads"
    click Scanners "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/tools"
    click JIRA "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/jira_link"
    click ToolConfig "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/tool_config"
    click Findings "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/finding"
    click Products "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/product"
    click Engagements "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/engagement"
    click Reports "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/reports"
    click Metrics "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/metrics"
    click Users "https://github.com/cristiano-corrado/django-DefectDojo/tree/master/dojo/user"

    %% Styling
    classDef core fill:#2374ab
    classDef api fill:#48a9a6
    classDef security fill:#d64933
    classDef storage fill:#e9c46a
    classDef worker fill:#9c528b
    classDef integration fill:#4caf50
    classDef webserver fill:#87ceeb

    %% Legend
    subgraph Legend
        CoreL["Core Services"]:::core
        APIL["API Services"]:::api
        SecurityL["Security Components"]:::security
        StorageL["Storage Systems"]:::storage
        WorkerL["Background Processes"]:::worker
        IntegrationL["External Integrations"]:::integration
        WebServerL["Web Server"]:::webserver
    end
```
