Skip to content

Commit ae047ab

Browse files
authored
docs: add CLAUDE.md with project context (#1057)
Provide structured project context (overview, architecture, build/test, key patterns, ecosystem position, dependencies, constraints) to enhance development workflows. Part of kcenon/common_system#560
1 parent 488a95f commit ae047ab

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

CLAUDE.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# pacs_system
2+
3+
## Overview
4+
5+
Modern C++20 PACS (Picture Archiving and Communication System) implementation with
6+
DICOM standard implemented from scratch — zero external DICOM library dependency.
7+
Leverages the kcenon ecosystem for infrastructure (networking, threading, logging,
8+
containers). Currently in Phase 4 (Advanced Services & Production Hardening).
9+
10+
## Architecture
11+
12+
12 library targets organized in layered dependency:
13+
14+
```
15+
pacs_core - Tags, elements, datasets, Part 10 file I/O, dictionary
16+
pacs_encoding - VR types, transfer syntaxes, compression codecs
17+
pacs_security - RBAC, anonymization (PS3.15), digital signatures, TLS
18+
pacs_network - PDU encode/decode, association state machine, DIMSE, pipeline
19+
pacs_client - Job/routing/sync/prefetch/remote node management
20+
pacs_services - SCP/SCU implementations, SOP class registry, IOD validators
21+
pacs_storage - File storage, SQLite indexing, cloud (S3/Azure), HSM
22+
pacs_ai - AI service connector, result handler (SR/SEG)
23+
pacs_monitoring - Health checks, Prometheus metrics
24+
pacs_workflow - Auto prefetch, task scheduler, study lock
25+
pacs_web - REST API (Crow), DICOMweb (WADO/STOW/QIDO)
26+
pacs_integration - Adapters to kcenon ecosystem
27+
```
28+
29+
Web frontend: `web/` — React + Vite + Tailwind + React Query (separate build).
30+
31+
## Build & Test
32+
33+
```bash
34+
# Quick build
35+
cmake -S . -B build && cmake --build build
36+
cd build && ctest --output-on-failure --timeout 120
37+
38+
# Build script with options
39+
./scripts/build.sh --debug --tests
40+
```
41+
42+
Key CMake options:
43+
- `PACS_BUILD_TESTS` (ON) — Catch2 v3.4.0 unit tests
44+
- `PACS_BUILD_EXAMPLES` (OFF) — 32 example programs
45+
- `PACS_BUILD_BENCHMARKS` (OFF), `PACS_BUILD_SAMPLES` (OFF)
46+
- `PACS_BUILD_STORAGE` (ON) — Requires SQLite3
47+
- `PACS_BUILD_CODECS` (ON) — JPEG, JPEG2000, JPEG-LS, HTJ2K, RLE
48+
- `PACS_WITH_OPENSSL` (ON), `PACS_WITH_REST_API` (ON)
49+
- `PACS_WITH_AWS_SDK` (OFF), `PACS_WITH_AZURE_SDK` (OFF)
50+
51+
Presets: `default`, `debug`, `release`, `asan`, `tsan`, `ubsan`, `ci`, `vcpkg`
52+
53+
CI: Multi-platform (Ubuntu GCC/Clang, macOS, Windows MSVC), coverage, static analysis,
54+
sanitizers, fuzzing, DCMTK interop testing, CVE scan, SBOM.
55+
56+
## Key Patterns
57+
58+
- **DICOM from scratch** — Full SOP class implementations without dcmtk/GDCM dependency
59+
- **SOP classes** — Verification (C-ECHO), CT/MR/US/XA/NM/PET/RT/SR/SEG/MG/CR/SC Storage,
60+
Patient/Study Root Q/R, Modality Worklist, MPPS, Storage Commitment, Print, UPS, PIR, XDS-I.b
61+
- **Transfer syntaxes** — Implicit/Explicit VR, JPEG Baseline/Lossless, JPEG 2000,
62+
JPEG-LS, RLE, HTJ2K, HEVC, Frame Deflate, JPEG XL
63+
- **Network pipeline** — PDU -> DIMSE -> Service execution -> Response encode pipeline architecture
64+
- **Association state machine** — Full DICOM Upper Layer association management
65+
- **Result type**`kcenon::common::Result<T>` throughout
66+
67+
## Ecosystem Position
68+
69+
**Tier 5** — Highest-level application in the kcenon ecosystem.
70+
71+
```
72+
common_system (Tier 0) [required] — Result<T>, IExecutor
73+
container_system (Tier 1) [required] — DICOM serialization
74+
thread_system (Tier 1) [via network_system]
75+
logger_system (Tier 2) [via network_system]
76+
monitoring_system (Tier 2) [optional via network_system]
77+
network_system (Tier 4) [required] — TCP/TLS, async operations
78+
database_system (Tier 3) [optional]
79+
pacs_system (Tier 5) <-- this project
80+
```
81+
82+
## Dependencies
83+
84+
**Required ecosystem**: common_system, container_system, network_system (which pulls thread_system, logger_system)
85+
**Required native**: ICU (charset encoding), SQLite3 >= 3.45.1 (storage)
86+
**Optional codecs**: libjpeg-turbo, OpenJPEG, CharLS, libpng, OpenJPH (HTJ2K), OpenSSL >= 3.0
87+
**Fetched**: Catch2 v3.4.0, Crow v1.3.1 (REST API), ASIO 1.30.2
88+
89+
## Known Constraints
90+
91+
- Windows `std::min`/`std::max`: Must use `(std::min)(a, b)` parenthesization (Windows.h macros)
92+
- `std::jthread` unavailable on AppleClang; auto-fallback to `std::thread` with `USE_STD_JTHREAD`
93+
- libjpeg-turbo cannot be built via FetchContent (must be system package)
94+
- `PACS_USE_MOCK_S3` prohibited in Release builds (CMake FATAL_ERROR)
95+
- Linux static linking: circular dependency requires `--start-group/--end-group` linker flags
96+
- C++20 modules experimental (CMake 3.28+, Clang 16+/GCC 14+)
97+
- UWP/Xbox unsupported
98+
- Test framework: Catch2 (differs from ecosystem's Google Test convention)

0 commit comments

Comments
 (0)