# ankit-kumar17/fossology architecture

> Architecture diagram of the GitHub repository ankit-kumar17/fossology, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ankit-kumar17/fossology
- Repository: https://github.com/ankit-kumar17/fossology

## Overview

FOSSology is a license-compliance toolkit and web workflow system. Users submit software through the web API or command-line tools; uploads are stored and scheduled for analysis, producing license, copyright, package, and related findings. Users then review and clear findings, manage license decisions, and generate compliance reports such as SPDX and ReadMe outputs. The graph also captures shared database/repository services and decision import/export. The README documents deduplication and CLI scans; source excerpts are partial, so uncertain internal agent dispatch details are not expanded.

Main entry points: [`src/lib/php/Db/DbManager.php`](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/php/Db/DbManager.php) (FOSSology database), [`src/lib/c/libfossscheduler.c`](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossscheduler.c) (Agent scheduler), [`src/lib/c/libfossrepo.c`](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossrepo.c) (File repository), [`src/lib/c/libfossagent.c`](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossagent.c) (Agent and DB libraries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Intake and scheduling"]
  node_upload_api["Upload API"]
  node_cli["CLI tools<br/>[cp2foss.php]"]
  node_downloader["Network downloader<br/>[main.c]"]
  node_scheduler["Agent scheduler<br/>[libfossscheduler.c]"]
end

subgraph group_analysis["Software analysis"]
  node_mimetype["MIME detection<br/>[mimetype.c]"]
  node_pkgagent["Package metadata<br/>[main.c]"]
  node_license_scan["License scanners<br/>[nomos.c]"]
  node_copyright_scan["Copyright analysis<br/>[copyright.cc]"]
  node_regex_scan["Regex scanning<br/>[regexscan.c]"]
  node_scanoss["Code reuse scan<br/>[main.c]"]
  node_buckets["File organization<br/>[buckets.c]"]
end

subgraph group_review["Compliance review"]
  node_license_ui["License management"]
  node_decider["Decision processing<br/>[DeciderAgent.php]"]
  node_decision_import["Decision import"]
  node_decision_export["Decision export"]
  node_copyright_ui["Finding views<br/>[CopyrightView.php]"]
end

subgraph group_reports["Reports and exchange"]
  node_spdx["SPDX generation"]
  node_readme_report["ReadMe notices<br/>[readmeoss.php]"]
end

subgraph group_platform["Shared platform"]
  node_repository["File repository<br/>[libfossrepo.c]"]
  node_database[("FOSSology database<br/>[DbManager.php]")]
  node_shared_libs["Agent and DB libraries<br/>[libfossagent.c]"]
end

node_user(("User"))
node_external_scan{{"SCANOSS service"}}

node_user -->|"submits upload"| node_upload_api
node_user -->|"runs scans"| node_cli
node_upload_api -->|"records upload"| node_database
node_cli -->|"queues work"| node_scheduler
node_upload_api -->|"queues analysis"| node_scheduler
node_scheduler -->|"dispatches download"| node_downloader
node_downloader -->|"stores files"| node_repository
node_scheduler -->|"dispatches analysis"| node_mimetype
node_scheduler -->|"dispatches analysis"| node_pkgagent
node_scheduler -->|"dispatches analysis"| node_license_scan
node_scheduler -->|"dispatches analysis"| node_copyright_scan
node_scheduler -->|"dispatches analysis"| node_regex_scan
node_scheduler -.->|"dispatches analysis"| node_scanoss
node_mimetype -->|"reads files"| node_repository
node_pkgagent -->|"reads packages"| node_repository
node_license_scan -->|"reads files"| node_repository
node_copyright_scan -->|"reads files"| node_repository
node_regex_scan -->|"reads files"| node_repository
node_scanoss -.->|"requests matches"| node_external_scan
node_mimetype -->|"records findings"| node_database
node_pkgagent -->|"records metadata"| node_database
node_license_scan -->|"records findings"| node_database
node_copyright_scan -->|"records findings"| node_database
node_regex_scan -->|"records findings"| node_database
node_scanoss -.->|"records results"| node_database
node_scheduler -->|"dispatches organization"| node_buckets
node_buckets -->|"stores file groups"| node_database
node_user -->|"reviews licenses"| node_license_ui
node_license_ui -->|"reads and updates"| node_database
node_scheduler -->|"dispatches decisions"| node_decider
node_decider -->|"reads and writes decisions"| node_database
node_decision_import -->|"imports decisions"| node_database
node_decision_export -->|"reads decisions"| node_database
node_user -->|"imports decisions"| node_decision_import
node_user -->|"exports decisions"| node_decision_export
node_user -->|"requests report"| node_spdx
node_spdx -->|"reads compliance data"| node_database
node_user -->|"requests notices"| node_readme_report
node_readme_report -->|"reads copyright data"| node_database
node_user -->|"views findings"| node_copyright_ui
node_copyright_ui -->|"reads findings"| node_database
node_scheduler -->|"uses agent services"| node_shared_libs
node_license_scan -->|"uses DB services"| node_shared_libs
node_copyright_scan -->|"uses DB services"| node_shared_libs
node_shared_libs -->|"accesses state"| node_database
node_shared_libs -->|"accesses files"| node_repository

click node_upload_api "https://github.com/ankit-kumar17/fossology/blob/master/src/www/ui/api/Controllers/UploadController.php"
click node_cli "https://github.com/ankit-kumar17/fossology/blob/master/src/cli/cp2foss.php"
click node_downloader "https://github.com/ankit-kumar17/fossology/blob/master/src/wget_agent/agent/main.c"
click node_scheduler "https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossscheduler.c"
click node_repository "https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossrepo.c"
click node_database "https://github.com/ankit-kumar17/fossology/blob/master/src/lib/php/Db/DbManager.php"
click node_shared_libs "https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossagent.c"
click node_mimetype "https://github.com/ankit-kumar17/fossology/blob/master/src/mimetype/agent/mimetype.c"
click node_pkgagent "https://github.com/ankit-kumar17/fossology/blob/master/src/pkgagent/agent/main.c"
click node_license_scan "https://github.com/ankit-kumar17/fossology/blob/master/src/nomos/agent/nomos.c"
click node_copyright_scan "https://github.com/ankit-kumar17/fossology/blob/master/src/copyright/agent/copyright.cc"
click node_regex_scan "https://github.com/ankit-kumar17/fossology/blob/master/src/regexscan/agent/regexscan.c"
click node_scanoss "https://github.com/ankit-kumar17/fossology/blob/master/src/scanoss/agent/main.c"
click node_buckets "https://github.com/ankit-kumar17/fossology/blob/master/src/buckets/agent/buckets.c"
click node_license_ui "https://github.com/ankit-kumar17/fossology/blob/master/src/www/ui/api/Controllers/LicenseController.php"
click node_decider "https://github.com/ankit-kumar17/fossology/blob/master/src/decider/agent/DeciderAgent.php"
click node_decision_import "https://github.com/ankit-kumar17/fossology/blob/master/src/decisionimporter/agent/decisionimporter.php"
click node_decision_export "https://github.com/ankit-kumar17/fossology/blob/master/src/decisionexporter/agent/decisionexporter.php"
click node_spdx "https://github.com/ankit-kumar17/fossology/blob/master/src/cyclonedx/agent/reportgenerator.php"
click node_readme_report "https://github.com/ankit-kumar17/fossology/blob/master/src/readmeoss/agent/readmeoss.php"
click node_copyright_ui "https://github.com/ankit-kumar17/fossology/blob/master/src/copyright/ui/CopyrightView.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_upload_api,node_cli,node_downloader,node_scheduler,node_user toneBlue
class node_mimetype,node_pkgagent,node_license_scan,node_copyright_scan,node_regex_scan,node_scanoss,node_buckets toneAmber
class node_license_ui,node_decider,node_decision_import,node_decision_export,node_copyright_ui toneMint
class node_spdx,node_readme_report toneRose
class node_repository,node_database,node_shared_libs,node_external_scan toneIndigo
```

## Components

### Intake and scheduling

- [Upload API](https://github.com/ankit-kumar17/fossology/blob/master/src/www/ui/api/Controllers/UploadController.php): `src/www/ui/api/Controllers/UploadController.php`
- [CLI tools](https://github.com/ankit-kumar17/fossology/blob/master/src/cli/cp2foss.php): `src/cli/cp2foss.php`
- [Network downloader](https://github.com/ankit-kumar17/fossology/blob/master/src/wget_agent/agent/main.c): `src/wget_agent/agent/main.c`
- [Agent scheduler](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossscheduler.c): `src/lib/c/libfossscheduler.c`

### Software analysis

- [MIME detection](https://github.com/ankit-kumar17/fossology/blob/master/src/mimetype/agent/mimetype.c): `src/mimetype/agent/mimetype.c`
- [Package metadata](https://github.com/ankit-kumar17/fossology/blob/master/src/pkgagent/agent/main.c): `src/pkgagent/agent/main.c`
- [License scanners](https://github.com/ankit-kumar17/fossology/blob/master/src/nomos/agent/nomos.c): `src/nomos/agent/nomos.c`
- [Copyright analysis](https://github.com/ankit-kumar17/fossology/blob/master/src/copyright/agent/copyright.cc): `src/copyright/agent/copyright.cc`
- [Regex scanning](https://github.com/ankit-kumar17/fossology/blob/master/src/regexscan/agent/regexscan.c): `src/regexscan/agent/regexscan.c`
- [Code reuse scan](https://github.com/ankit-kumar17/fossology/blob/master/src/scanoss/agent/main.c): `src/scanoss/agent/main.c`
- [File organization](https://github.com/ankit-kumar17/fossology/blob/master/src/buckets/agent/buckets.c): `src/buckets/agent/buckets.c`

### Compliance review

- [License management](https://github.com/ankit-kumar17/fossology/blob/master/src/www/ui/api/Controllers/LicenseController.php): `src/www/ui/api/Controllers/LicenseController.php`
- [Decision processing](https://github.com/ankit-kumar17/fossology/blob/master/src/decider/agent/DeciderAgent.php): `src/decider/agent/DeciderAgent.php`
- [Decision import](https://github.com/ankit-kumar17/fossology/blob/master/src/decisionimporter/agent/decisionimporter.php): `src/decisionimporter/agent/decisionimporter.php`
- [Decision export](https://github.com/ankit-kumar17/fossology/blob/master/src/decisionexporter/agent/decisionexporter.php): `src/decisionexporter/agent/decisionexporter.php`
- [Finding views](https://github.com/ankit-kumar17/fossology/blob/master/src/copyright/ui/CopyrightView.php): `src/copyright/ui/CopyrightView.php`

### Reports and exchange

- [SPDX generation](https://github.com/ankit-kumar17/fossology/blob/master/src/cyclonedx/agent/reportgenerator.php): `src/cyclonedx/agent/reportgenerator.php`
- [ReadMe notices](https://github.com/ankit-kumar17/fossology/blob/master/src/readmeoss/agent/readmeoss.php): `src/readmeoss/agent/readmeoss.php`

### Shared platform

- [File repository](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossrepo.c): `src/lib/c/libfossrepo.c`
- [FOSSology database](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/php/Db/DbManager.php): `src/lib/php/Db/DbManager.php`
- [Agent and DB libraries](https://github.com/ankit-kumar17/fossology/blob/master/src/lib/c/libfossagent.c): `src/lib/c/libfossagent.c`

### Other components

- **User**
- **SCANOSS service**

## Connections

- User → Upload API: submits upload
- User → CLI tools: runs scans
- Upload API → FOSSology database: records upload
- CLI tools → Agent scheduler: queues work
- Upload API → Agent scheduler: queues analysis
- Agent scheduler → Network downloader: dispatches download
- Network downloader → File repository: stores files
- Agent scheduler → MIME detection: dispatches analysis
- Agent scheduler → Package metadata: dispatches analysis
- Agent scheduler → License scanners: dispatches analysis
- Agent scheduler → Copyright analysis: dispatches analysis
- Agent scheduler → Regex scanning: dispatches analysis
- Agent scheduler → Code reuse scan: dispatches analysis
- MIME detection → File repository: reads files
- Package metadata → File repository: reads packages
- License scanners → File repository: reads files
- Copyright analysis → File repository: reads files
- Regex scanning → File repository: reads files
- Code reuse scan → SCANOSS service: requests matches
- MIME detection → FOSSology database: records findings
- Package metadata → FOSSology database: records metadata
- License scanners → FOSSology database: records findings
- Copyright analysis → FOSSology database: records findings
- Regex scanning → FOSSology database: records findings
- Code reuse scan → FOSSology database: records results
- Agent scheduler → File organization: dispatches organization
- File organization → FOSSology database: stores file groups
- User → License management: reviews licenses
- License management → FOSSology database: reads and updates
- Agent scheduler → Decision processing: dispatches decisions
- Decision processing → FOSSology database: reads and writes decisions
- Decision import → FOSSology database: imports decisions
- Decision export → FOSSology database: reads decisions
- User → Decision import: imports decisions
- User → Decision export: exports decisions
- User → SPDX generation: requests report
- SPDX generation → FOSSology database: reads compliance data
- User → ReadMe notices: requests notices
- ReadMe notices → FOSSology database: reads copyright data
- User → Finding views: views findings
- Finding views → FOSSology database: reads findings
- Agent scheduler → Agent and DB libraries: uses agent services
- License scanners → Agent and DB libraries: uses DB services
- Copyright analysis → Agent and DB libraries: uses DB services
- Agent and DB libraries → FOSSology database: accesses state
- Agent and DB libraries → File repository: accesses files
