How harshdamnc/deptrace works
DepTrace ingests dependency manifests and registry metadata, stores package relationships, and exposes project, package, authentication, vulnerability, and graph APIs. The main analysis path is manifest upload → parsing and project processing → persisted dependency graph → traversal and blast-radius results. The graph also preserves the documented PyPI ingestion, OSV scanning, caching, and RBAC capabilities. Some route and service implementations are unsampled; those links are shown only where source references or README statements support them.
Main entry points: graph_service.py Graph analysis · router.py FastAPI routes · project_service.py Project processing · manifest_parser.py Manifest dispatch
Components 34
API and access
- FastAPI routes
backend/app/api/v1/router.py - Auth routes
backend/app/api/v1/auth.py - Authentication
backend/app/services/auth_service.py - JWT security
backend/app/core/security.py - Request dependencies
backend/app/core/dependencies.py - Project routes
backend/app/api/v1/projects.py - Ingestion routes
backend/app/api/v1/ingestion.py - Graph routes
backend/app/api/v1/graph.py - Package routes
backend/app/api/v1/packages.py - Vulnerability routes
backend/app/api/v1/vulnerabilities.py
Project ingestion
- Project processing
backend/app/services/project_service.py - Manifest dispatch
backend/app/parsers/manifest_parser.py - Requirements parser
backend/app/parsers/requirements_txt.py - PyProject parser
backend/app/parsers/pyproject_toml.py - Package JSON parser
backend/app/parsers/package_json.py - Metadata ingestion
backend/app/services/ingestion_service.py
Dependency analysis
- Graph analysis
backend/app/services/graph_service.py - Graph queries
backend/app/repositories/graph_repository.py - Adjacency graph
backend/app/graph/adjacency_list.py - Graph traversal
backend/app/graph/traversal.py - Blast radius
backend/app/graph/blast_radius.py - Cycle detection
backend/app/graph/cycle_detection.py - Strong components
backend/app/graph/components.py - Topological sort
backend/app/graph/topological.py
Persistence and cache
- Package service
backend/app/services/package_service.py - Package repository
backend/app/repositories/package_repository.py - Project repository
backend/app/repositories/project_repository.py - Ingestion jobs
backend/app/repositories/ingestion_repository.py - User repository
backend/app/repositories/user_repository.py
External intelligence
- PyPI client
backend/app/ingestion/pypi_client.py - OSV scanner
backend/app/integrations/osv_client.py
Other components
- Engineer
- PyPI registry
- Google OSV
Connections 42
- Engineer → FastAPI routes: calls
README.md - FastAPI routes → Auth routes: routes to
backend/app/api/v1/router.py - FastAPI routes → Project routes: routes to
backend/app/api/v1/router.py - FastAPI routes → Ingestion routes: routes to
backend/app/api/v1/router.py - FastAPI routes → Graph routes: routes to
backend/app/api/v1/router.py - FastAPI routes → Package routes: routes to
backend/app/api/v1/router.py - FastAPI routes → Vulnerability routes: routes to
backend/app/api/v1/router.py - Auth routes → Authentication: delegates to
backend/app/api/v1/auth.py - Authentication → JWT security: uses
backend/app/services/auth_service.py - Authentication → User repository: reads and writes
backend/app/services/auth_service.py - Request dependencies → JWT security: validates tokens
backend/app/core/dependencies.py - Request dependencies → User repository: loads users
backend/app/core/dependencies.py - Project routes → Project processing: delegates to
backend/app/api/v1/projects.py - Project processing → Manifest dispatch: parses manifests
backend/app/services/project_service.py - Manifest dispatch → Requirements parser: dispatches
backend/app/parsers/manifest_parser.py - Manifest dispatch → PyProject parser: dispatches
backend/app/parsers/manifest_parser.py - Manifest dispatch → Package JSON parser: dispatches
backend/app/parsers/manifest_parser.py - Project processing → Project repository: persists projects
backend/app/services/project_service.py - Project processing → Graph queries: updates graph
backend/app/services/project_service.py - Project processing → PyPI client: resolves packages
backend/app/services/project_service.py - PyPI client → PyPI registry: fetches metadata
backend/app/ingestion/pypi_client.py - Ingestion routes → Metadata ingestion: delegates to
backend/app/api/v1/ingestion.py - Metadata ingestion → PyPI client: fetches metadata
backend/app/services/ingestion_service.py - Metadata ingestion → Package repository: stores packages
backend/app/services/ingestion_service.py - Metadata ingestion → Ingestion jobs: tracks jobs
backend/app/services/ingestion_service.py - Graph routes → Graph analysis: delegates to
- Graph analysis → Graph queries: queries graph
backend/app/services/graph_service.py - Graph analysis → Adjacency graph: builds graph
backend/app/services/graph_service.py - Graph analysis → Graph traversal: traverses
backend/app/services/graph_service.py - Graph analysis → Blast radius: calculates impact
backend/app/services/graph_service.py - Graph analysis → Cycle detection: checks cycles
backend/app/services/graph_service.py - Graph queries → Adjacency graph: builds from records
backend/app/repositories/graph_repository.py - Graph queries → Graph traversal: runs fallback BFS
backend/app/repositories/graph_repository.py - Blast radius → Adjacency graph: reads graph
backend/app/graph/blast_radius.py - Blast radius → Graph traversal: uses traversal
backend/app/graph/blast_radius.py - Graph analysis → Strong components: finds components
backend/app/services/graph_service.py - Graph analysis → Topological sort: sorts dependencies
- Vulnerability routes → OSV scanner: scans advisories
- Project processing → OSV scanner: checks vulnerabilities
backend/app/services/project_service.py - OSV scanner → Google OSV: queries
backend/app/integrations/osv_client.py - Package routes → Package service: delegates to
- Package service → Package repository: reads and writes
backend/app/services/package_service.py