@startuml Nemera API Server Components !pragma layout elk !include LAYOUT_WITH_LEGEND() title Component diagram for Nemera API Server 2.2 Container_Ext(webapp, "Web Application Client 2.1", "Nemera.Presentation.Web", "Provides the user interface [detailed in '3.1 component-web-client-diagram.puml']") Container_Boundary(api, "API Server 2.2") { Component(endpoints, "API Endpoints", "FastEndpoints", "Provides REST API endpoints for libraries, media items, playback, reading, favorites, playlists, statistics, plugins, themes, scheduling, users, administration and maintenance") Component(mediaManagement, "Media Library Management", "Application + Domain services", "Handles media libraries and their books and music, and owns the lifecycle and queueing of their scans") Component(mediaConsumption, "Media Consumption", "Application + Domain services", "Tracks playback and reading progress, resume points and per-user consumption statistics") Component(favorites, "Favorites", "Application + Domain services", "Tracks the favorite library items of each user") Component(playlists, "Playlists", "Application + Domain services", "Creates playlists and orders their entries") Component(fileSystem, "File System Management", "Application + Domain services", "Manages drives, directories, files, paths and thumbnails") Component(userManagement, "User Management", "Application + Domain services", "Handles authentication, roles, permissions and user settings") Component(backgroundServices, "Media Library Scanning 3.2.1", ".NET Worker Services", "Executes the queued media library scans, owns their metadata and artwork enrichment, and publishes their progress notifications [detailed in '4.1 code-media-library-scanning-diagram.puml']") Component(bookReading, "Book Reading 3.2.2", "Application + Infrastructure services", "Resolves the reader plugin of a book, checks its per-library enablement, extracts the book into the reading cache on first access, sanitizes every section, and serves the reading manifest, sections and resources [detailed in '4.2 code-book-reading-diagram.puml']") Component(readerPlugins, "Book Reader Plugins", "Nemera.Plugins.Epub, Nemera.Plugins.Pdf", "Decode a book format into a normalized reading document (spine, table of contents, sections, resources), loaded into the host by the plugin loader [detailed in '4.2 code-book-reading-diagram.puml']") Component(musicPlayback, "Music Playback", "Application + Infrastructure services", "Decides how a track is delivered, normalizes audio with ffmpeg, caches it as segments and serves the track stream and segment endpoints") Component(plugins, "Plugin Hosting", "Plugin loader + Application services", "Loads metadata, artwork and book reader plugins, installs them, stores their settings and applies the per-library provider configurations; the hosted metadata and artwork providers call the external services") Component(themes, "Themes", "Application + Infrastructure services", "Installs, repairs and serves theme packs and their assets") Component(scheduledJobs, "Scheduled Jobs 3.2.3", "Application + Infrastructure services", "Lets administrators schedule the one off or recurring execution of maintenance tasks (media library scans, temporary files cleanup, theme repair, execution history cleanup, technical data cleanup), stores the display preferences of the scheduler page, and broadcasts the jobs and their executions; a background scheduler runs the tasks on their schedules [detailed in '4.3 code-scheduler-diagram.puml']") Component(repositories, "Repositories", "EF Core + Dapper", "Provides data access for the domain entities and the consumption statistics") } ContainerDb_Ext(db, "Database", "SQLite", "Stores user data, media metadata, library configuration, favorites, playlists, media consumption, plugins, themes, scheduled jobs and their executions") Container_Ext(filestore, "Media Store", "File System", "Stores the actual media files") Container_Ext(readCache, "Reading Cache", "File System", "Temporary directory in the API output, wiped at startup, where the reader plugins extract the contents of the books") Container_Ext(transcodingCache, "Transcoding Cache", "File System", "Normalized audio cache. By default a private directory under the system temporary directory, scoped to the API account; a configured relative TranscodingSettings:CacheDirectory resolves under the API base directory. It must never overlap the media root: it must neither sit inside it nor contain it.") Container_Ext(pluginStore, "Plugin Store", "File System", "Plugin assemblies and their dependencies, installed into this directory on upload and loaded from it when the API starts") Container_Ext(themeStore, "Theme Store", "File System", "Installed and bundled theme packs served by the API") System_Ext(metadataServices, "Media Metadata and Artwork Services", "Provides media information and artwork (MusicBrainz, Open Library, Cover Art Archive)") Rel(webapp, endpoints, "Makes API calls to", "JSON/HTTPS") Rel(endpoints, mediaManagement, "Uses") Rel(endpoints, mediaConsumption, "Uses") Rel(endpoints, favorites, "Uses") Rel(endpoints, playlists, "Uses") Rel(endpoints, fileSystem, "Uses") Rel(endpoints, userManagement, "Uses") Rel(endpoints, bookReading, "Uses") Rel(endpoints, musicPlayback, "Uses") Rel(endpoints, plugins, "Uses") Rel(endpoints, themes, "Uses") Rel(endpoints, scheduledJobs, "Uses") Rel(mediaManagement, repositories, "Uses") Rel(mediaManagement, filestore, "Reads from and writes to") Rel(mediaManagement, plugins, "Configures the metadata and artwork providers") Rel(mediaConsumption, repositories, "Uses") Rel(favorites, repositories, "Uses") Rel(playlists, repositories, "Uses") Rel(userManagement, repositories, "Uses") Rel(bookReading, repositories, "Reads the per-library reader enablement") Rel(bookReading, readerPlugins, "Resolves and invokes") Rel(bookReading, readCache, "Extracts into and serves from", "File system") Rel(readerPlugins, readCache, "Extracts into", "File system") Rel(musicPlayback, repositories, "Reads the track locations") Rel(musicPlayback, filestore, "Reads the source tracks") Rel(musicPlayback, transcodingCache, "Reads from and writes to", "File system") Rel(plugins, readerPlugins, "Loads and registers") Rel(plugins, repositories, "Stores plugin settings and provider configurations") Rel(plugins, pluginStore, "Installs into and loads plugin assemblies from", "File system") Rel(plugins, metadataServices, "Retrieves metadata and artwork from", "HTTPS") Rel(themes, repositories, "Reads and updates the current theme") Rel(themes, themeStore, "Reads and writes theme packs", "File system") Rel(backgroundServices, mediaManagement, "Prepares the scan job graph") Rel(backgroundServices, fileSystem, "Reads and writes media files") Rel(backgroundServices, plugins, "Uses the enabled metadata and artwork providers") Rel(backgroundServices, repositories, "Reads and writes the scan staging data") Rel(mediaManagement, backgroundServices, "Queues and cancels scans") Rel(fileSystem, filestore, "Browses") Rel(scheduledJobs, repositories, "Uses") Rel(scheduledJobs, mediaManagement, "Queues the media library scans of its ScanMediaLibraries task") Rel(scheduledJobs, themes, "Repairs the installed themes of its RepairThemes task") Rel(scheduledJobs, readCache, "Empties with its CleanTemporaryFiles task", "File system") Rel(repositories, db, "Reads from and writes to", "SQL") caption [Component] Nemera - API Server 2.2 (Nemera.Presentation.Api) footer The component diagram for the Nemera API Server 2.2 - created with PlantUML @enduml