How philippstahlberggit/dat251_project_library_app works
What this project is (from tree + README)
Project type: Java Spring Boot application built with Gradle (Kotlin DSL).
Likely architecture style: a single deployable monolith (one Spring Boot service) named LibraryApp.
Signals in the repo:
• build.gradle.kts, settings.gradle.kts, gradlew*, gradle/wrapper/* ⇒ Gradle-built JVM service.
• src/main/java/.../LibraryAppApplication.java ⇒ standard Spring Boot entrypoint class.
• src/main/resources/application.yaml ⇒ Spring Boot configuration (ports, DB, profiles, etc.).
• src/test/java/...LibraryAppApplicationTests.java ⇒ Spring Boot test harness.
• .github/workflows/Java CI with Gradle.yaml ⇒ CI pipeline for Java/Gradle.
• .github/workflows/python-app.yml ⇒ extra CI workflow (possibly for tooling/scripts); include it only if it actually runs something relevant.
Open build.gradle.kts and list key dependencies
• spring-boot-starter-web ⇒ REST controllers, HTTP endpoints.
• spring-boot-starter-data-jpa + DB driver ⇒ persistence layer + RDBMS.
• spring-boot-starter-security ⇒ authn/authz component.
• spring-kafka, amqp, etc. ⇒ async messaging components.
• actuator, micrometer ⇒ observability endpoints/metrics.
2. Scan src/main/java/app/main/LibraryApp for packages (even if not in the provided snippet):
• controller / web (API layer)
• service (domain/business logic)
• repository / dao (data access)
• model / entity / domain
• config (Spring config)
• security
• integration / client (calls to external systems)
Read application.yaml to identify external dependencies
• DB URL / host, credentials (or env var placeholders)
• server port/context path
• message broker endpoints
• third-party API base URLs
• profiles (dev/test/prod)
4. **Check .github/workflows/*** to understand build/test/release flow and include a lightweight CI/CD view if needed.
This is important: don’t guess components that are not backed by dependencies/config/packages. If a DB is not referenced anywhere, keep persistence as “TBD / not configured” rather than drawing PostgreSQL because it’s a “library app”.
Context (C4 Level 1) — “What is this system and who uses it?”
• User / Admin (actor)
• LibraryApp (Spring Boot service) (system)
• Any external systems discovered in application.yaml and build.gradle.kts (DB, identity provider, external book catalog APIs, etc.)
• User → LibraryApp (HTTP/HTTPS)
• LibraryApp → External dependencies (JDBC, REST, etc.)
Container (C4 Level 2) — “What deployables exist?”
Based on repo, at minimum:
• Container: LibraryApp (Java, Spring Boot, Gradle build)
• Container: Database (only if config/deps confirm it)
• Container: CI pipeline (GitHub Actions) as “build/test artifact” flow (optional, but often useful)
• prod branch → CI → deploy to Prod runtime
• testing branch → CI → deploy to Test runtime
(Your README explicitly defines production and testing branches, so including this pipeline view is justified.)
Component (C4 Level 3) — “Inside the Spring Boot app”
• Web/API Layer
• Controllers (REST endpoints)
• Request/response DTOs
• Service Layer
• Core domain services (e.g., BookService, MemberService, LoanService)
• Transaction boundaries
• Persistence Layer
• Repositories (Spring Data interfaces)
• Entities / ORM mappings
• Cross-cutting
• Security config / filters (if present)
• Exception handling / validation
• Observability (Actuator/Micrometer)
• Integration clients (if present)
• Controller → Service (method calls)
• Service → Repository (data access)
• Repository → DB (JDBC)
• Service → External API clients (REST/gRPC)
• Security filters wrap Controller entry
Relationships and interactions to make explicit
• “HTTP REST: /api/books”
• “JPA/Hibernate: CRUD on BOOK table”
• “OAuth2/JWT validation” (if security exists)
• “GitHub Actions: gradle test → build artifact”
Also distinguish:
Important architectural patterns to highlight (for this repo)
Given the Spring Boot structure, the most likely patterns to show are:
• Layered architecture (Controller → Service → Repository)
• Configuration via application.yaml (12-factor style; values via env vars in real deployments)
• Branch-based release flow (testing → production), enforced by protected branch PRs
• Profile-based wiring (test vs prod beans, different DBs, etc.)
From what’s certain:
• Java
• Spring Boot
• Gradle
• GitHub Actions
• YAML config (application.yaml)
• JUnit/Spring Boot Test (from src/test)
From what you must confirm (only label if present in Gradle/config):
• Spring Web (REST)
• Spring Data JPA + Hibernate
• PostgreSQL/MySQL/H2/etc.
• Spring Security
• Actuator/Micrometer
• Flyway/Liquibase migrations
Context
• Actor: Librarian/User
• System: LibraryApp (Spring Boot)
• External: “Database (TBD from config)”, “External APIs (TBD)”
Container
• GitHub Repo → GitHub Actions (Gradle build + tests) → Artifact
• Artifact → Deploy to Testing (from testing branch)
• Artifact → Deploy to Production (from production branch, PR gated)
• Runtime: LibraryApp container/VM + optional DB
Component
• LibraryAppApplication (bootstraps)
• Controllers (if present)
• Services (if present)
• Repositories (if present)
• application.yaml configuration feeding the app
• Tests (as a separate “verification” boundary, not runtime)
• build.gradle.kts: exact starters/drivers used
• application.yaml: external endpoints, profiles
• Any Dockerfile, docker-compose.yml, Helm charts, or deploy manifests (none shown—so deployment may be out-of-repo)
• Package structure under src/main/java/... beyond the main class