@startuml arch-container
' !includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/master/C4_Container.puml
!include c4-plantuml/C4_Container.puml

' title Container diagram for the Software Heritage Filesystem (SwhFS)
left to right direction

Person(user, "Developer")
System(tool, "Programming Tool")
Container(fuse, "FUSE", "kernel", "Delegates filesystem implementation to user space")

System_Boundary(swhfs_bound, "SwhFS") {
	Container(swh_fuse, "swh.fuse", "pyfuse3, libfuse, FUSE", "Provides a filesystem view of Software Heritage objects")
	ContainerDb(cache, "Cache", "SQLite or in-memory", "Local cache for objects and metadata")
	Rel(swh_fuse, cache, "Reads objects and metadata from", "SQL")
}

System_Ext(archive, "Software Heritage archive")

Rel(user, swhfs_bound, "Controls user-space daemon", "Command-line interface")
Rel(user, fuse, "Browses", "POSIX filesystem")
Rel(tool, fuse, "Accesses", "POSIX filesystem")
Rel(fuse, swh_fuse, "Calls user-space daemon", "FUSE API")
Rel(swh_fuse, archive, "Retrieves objects and metadata from", "REST API")

@enduml
