How waougri/athenaeum works
Purpose and Entry Point
Athenaeum is a .NET book-catalog API that persists book records in a local database and extracts metadata/content from EPUB and PDF inputs. The application starts at api/Program.cs; project and runtime dependencies are defined by api/Athenaeum.csproj and api/Athenaeum.sln.
API Host and Composition Root
api/Program.cs is the composition boundary: it likely configures the HTTP pipeline, dependency injection, application settings, and catalog services. Environment-specific configuration is provided through api/appsettings.json and api/appsettings.Development.json.
Catalog Application Service
api/src/Athenaeum.Core/BookCatalogService.cs is the primary use-case layer for catalog operations. It should coordinate input payloads, format extraction, and persistence rather than expose storage or document-format concerns directly to the API host.
Book Domain and Transport Models
Core book representations are separated by responsibility:
• api/src/Athenaeum.Core/BookData.cs represents stored or domain-facing book information.
• api/src/Athenaeum.Core/BookPayload.cs represents incoming book data/request payloads.
• api/src/Athenaeum.Core/EPUBData.cs and api/src/Athenaeum.Core/PDFData.cs carry format-specific extracted results.
This boundary lets catalog operations use common book data while retaining source-format details where needed.
Format Extraction Pipeline
Document ingestion is abstracted behind api/src/Athenaeum.Core/IBookExtractor.cs. Concrete implementations, api/src/Athenaeum.Core/EPUBExtractor.cs and api/src/Athenaeum.Core/PDFExtractor.cs, parse their respective formats and produce the corresponding data models. api/src/Athenaeum.Core/BookExtractor.cs is the likely dispatcher/facade that selects an extractor based on the uploaded or referenced book format.
Primary flow: API request or ingestion input → BookCatalogService → BookExtractor/IBookExtractor → EPUB or PDF extractor → normalized book data → repository.
Persistence Boundary
api/src/Athenaeum.Core/BookRepository.cs isolates database access from catalog and extraction logic. The checked-in database file is api/db/books.db, indicating a local file-backed database, likely SQLite. Repository methods should be the sole boundary for reading and writing catalog records.
Deployment Runtime
The API runs in a containerized .NET environment via api/Dockerfile. api/compose.yaml provides local multi-container or service orchestration, while api/db/books.db is the local persistence artifact that must be handled deliberately for container volume/lifecycle behavior. The core library is packaged independently in api/src/Athenaeum.Core/Athenaeum.Core.csproj, separating reusable catalog logic from the HTTP host.
Components 15
API Host
- Program · Configures HTTP, DI, and catalog services.
api/Program.cs
Catalog Core
- Book Catalog Service · Coordinates catalog ingestion and persistence.
api/src/Athenaeum.Core/BookCatalogService.cs - Book Payload
api/src/Athenaeum.Core/BookPayload.cs - Book Data · Normalized stored book information.
api/src/Athenaeum.Core/BookData.cs - Book Repository · Sole catalog database access boundary.
api/src/Athenaeum.Core/BookRepository.cs - Core Project · Reusable catalog logic package.
api/src/Athenaeum.Core/Athenaeum.Core.csproj
Format Extraction
- Book Extractor · Selects extraction by book format.
api/src/Athenaeum.Core/BookExtractor.cs - IBook Extractor
api/src/Athenaeum.Core/IBookExtractor.cs - EPUB Extractor
api/src/Athenaeum.Core/EPUBExtractor.cs - PDF Extractor
api/src/Athenaeum.Core/PDFExtractor.cs - EPUB Data
api/src/Athenaeum.Core/EPUBData.cs - PDF Data
api/src/Athenaeum.Core/PDFData.cs
Runtime & Storage
- Books Database · File-backed catalog persistence.
api/db/books.db - Docker Runtime
api/Dockerfile - Compose
api/compose.yaml
Connections 17
- Program → Book Catalog Service: invokes
- Program → Core Project: references
- Book Catalog Service → Book Payload: accepts
- Book Catalog Service → Book Extractor: extracts through
- Book Catalog Service → Book Repository: reads and writes
- Book Extractor → IBook Extractor: uses
- IBook Extractor → EPUB Extractor: implemented by
- IBook Extractor → PDF Extractor: implemented by
- EPUB Extractor → EPUB Data: produces
- PDF Extractor → PDF Data: produces
- EPUB Data → Book Data: normalizes to
- PDF Data → Book Data: normalizes to
- Book Repository → Book Data: stores
- Book Repository → Books Database: accesses
- Compose → Docker Runtime: runs
- Docker Runtime → Program: hosts
- Docker Runtime → Books Database: persists catalog