How javierrodriguezregueiro/traza-backend works
TRAZA BACKEND is a single Kotlin/Gradle backend service, most likely built on Spring Boot, with a small but clear layered structure. The repository is currently more of a service skeleton than a full feature tree: the only visible business package is domain, and the only adapter code shown is REST-side error handling.
The application entry point is dev.traza.TrazaApplication. That is the main bootstrap for the runtime and the top of the dependency graph for the service.
The codebase is organized around a boundary between domain and delivery concerns. src/main/kotlin/dev/traza/domain holds core business concepts, and src/main/kotlin/dev/traza/adapter/in/rest holds HTTP-facing code. This suggests an adapter-style or hexagonal layering, where the domain is meant to stay independent of transport details.
The visible domain model is intentionally small: DomainError lives under domain/error. This indicates that business failures are represented explicitly in the domain layer rather than being mapped directly from HTTP or framework exceptions.
The REST adapter currently focuses on error translation. DomainErrorExtensions.kt and GlobalExceptionHandler.kt indicate that domain exceptions or error values are converted into HTTP responses in one centralized place, so controllers or endpoints can stay thin and avoid repeating error-mapping logic.
There is no visible persistence package in the tree, but src/main/resources/db/migration shows Flyway-style database migration support. That means schema changes are managed as part of application startup/deployment, with the database treated as an external resource initialized through versioned migrations.
Configuration is environment-based. application.yml provides the default runtime configuration, while application-dev.yml and application-test.yml separate local development and test settings. This points to a standard Spring profile-driven setup.
Operationally, the project includes container support via Dockerfile and docker-compose.yml, so the service is intended to run in an isolated container environment and likely depends on at least one external backing service during development.
Testing is present but minimal: TrazaApplicationTest.kt suggests a basic application context or startup test, and the test-specific config in src/test/resources/application-test.yml supports isolated test execution.
Build and quality tooling are part of the architecture too. The repo uses Gradle Kotlin DSL (build.gradle.kts, settings.gradle.kts) plus a version catalog, and it enforces static analysis with Detekt (detekt.yml). CI is wired through GitHub Actions (.github/workflows/ci.yml), so build, test, and lint checks are expected to run automatically.
Logging is configured separately in logback-spring.xml, which means application logs are treated as a first-class operational concern rather than relying on defaults.
For an architecture diagram, the main flows to show are: external client request enters the REST adapter, domain-level errors are normalized through the global exception handler into HTTP responses, and application startup is surrounded by configuration, logging, and Flyway database migration initialization. The rest of the business pipeline is not visible in this repository snapshot, so the diagram should stop at the currently implemented boundaries rather than inventing missing service or persistence layers.
Main entry points: TrazaApplication.kt Traza App · rest REST Adapter · GlobalExceptionHandler.kt Exception Handler · ci.yml CI Workflow
Components 18
Runtime
Application code and execution paths
- Traza App · Main application bootstrap for the backend service
src/main/kotlin/dev/traza/TrazaApplication.kt - Domain · Core business boundary for the service
src/main/kotlin/dev/traza/domain - Domain Error · Explicit business failure model
src/main/kotlin/dev/traza/domain/error/DomainError.kt - REST Adapter · HTTP-facing delivery boundary
src/main/kotlin/dev/traza/adapter/in/rest - Error Mapping · Maps domain errors to HTTP-facing forms
src/main/kotlin/dev/traza/adapter/in/rest/DomainErrorExtensions.kt - Exception Handler · Centralized translation of exceptions into responses
src/main/kotlin/dev/traza/adapter/in/rest/GlobalExceptionHandler.kt - App Config · Default application configuration
src/main/resources/application.yml - Dev Config · Development profile overrides
src/main/resources/application-dev.yml - Test Config · Test profile overrides
src/test/resources/application-test.yml - Migrations · Versioned database schema initialization
src/main/resources/db/migration - Logback · Application logging configuration
src/main/resources/logback-spring.xml - App Test · Basic application context or startup validation
src/test/kotlin/dev/traza/TrazaApplicationTest.kt
Ops
Build, container, CI, and runtime support
- Gradle Build · Kotlin DSL build and dependency setup
build.gradle.kts - Versions · Central dependency version catalog
gradle/libs.versions.toml - Detekt · Code quality and lint rules
detekt.yml - CI Workflow · Automated build, test, and lint pipeline
.github/workflows/ci.yml - Dockerfile · Container image definition for the service
Dockerfile - Compose · Local multi-container development setup
docker-compose.yml
Connections 16
- Traza App → App Config: loads · Bootstraps with default runtime configuration
- Traza App → Dev Config: profiles · Can be overridden by development profile settings
- Traza App → Logback: uses · Initializes structured application logging
- Traza App → Migrations: applies · Runs schema migrations during startup
- Traza App → REST Adapter: hosts · Starts the HTTP delivery layer
- REST Adapter → Domain: calls · Delivers requests into business logic
- Domain → Domain Error: defines · Encapsulates business failure types
- Exception Handler → Domain Error: handles · Translates domain failures into responses
- Exception Handler → Error Mapping: uses · Shares error-to-response mapping helpers
- REST Adapter → Exception Handler: delegates · Centralizes REST error handling
- App Test → Traza App: verifies · Validates application startup behavior
- Gradle Build → Versions: imports · Resolves dependency versions from the catalog
- CI Workflow → Gradle Build: runs · Executes build and verification tasks
- CI Workflow → Detekt: checks · Enforces static analysis in automation
- Dockerfile → Traza App: packages · Builds a container image for the service
- Compose → Dockerfile: orchestrates · Runs the service in a local container stack