This page details the internal structure and architectural decisions of the BeenThere backend. It follows a layered architecture pattern with clear separation of concerns, making it maintainable, testable, and scalable.
The backend is organized in the following primary layers:
flowchart LR
Controller --> Service --> Repository --> Database
Each layer has a specific responsibility:
Layer | Responsibility |
---|---|
Controller | Handles HTTP requests and responses, performs request validation |
Service | Contains business logic and transaction management |
Repository | Abstracts persistence operations using Spring Data JPA |
Model | Defines domain entities and DTOs (Data Transfer Objects) |
backend/
├── src/
│ └── main/
│ └── kotlin/
│ └── ghdrope/beenthere/backend/
│ ├── controller/
│ ├── service/
│ ├── repository/
│ ├── model/
│ └── BackendApplication.kt
│
│ └── resources/
│ ├── application.yml
│ ├── application-local.yml
│ └── application-docker.yml
│
├── dev-db-compose.yaml
├── Makefile
├── detekt.yml
└── build.gradle.kts
controller/
@RestController
@Valid
@PostMapping
, @GetMapping
, etc.service/
@Transactional