# rightmove/code-challenge-devex architecture

> Architecture diagram of the GitHub repository rightmove/code-challenge-devex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rightmove/code-challenge-devex
- Repository: https://github.com/rightmove/code-challenge-devex

## Overview

##### Project type and purpose
- This is a Java-based Spring Boot web service (backend only) that provides residential property information over a REST API.
- It’s organized as a multi-module Gradle project with two subprojects:
- “data” holds your DAO layer, entities and data population logic
- “web” is the Spring Boot application exposing HTTP endpoints

##### File structure
- Top-level files: gradle wrapper, Dockerfile, settings.gradle, build scripts.
- “data” module
- src/main/java/com/rightmove/property/data → PropertyEntity, PropertyType, PropertyDao & its implementation, DataPopulator
- src/test → unit tests for DAO
- “web” module
- Application.java (Spring Boot entry point)
- PropertyController, PropertyResult DTO
- application.properties
- datasetup tests in web/src/test
- No separate service layer—controllers talk directly to DAOs from the data module.

##### Key insights from README
- Java 21 (or newer), Gradle wrapper, Docker ready
- Spring Boot 3.4.3, JUnit 5 for tests
- Typical lifecycle: DataPopulator loads initial data into the chosen datastore at startup, controllers handle HTTP GET/POST, DAOs interact with the database.

##### Main components and their relationships
a. Components
- Client (e.g. browser or other service)
- Spring Boot Application (“web” module) including:
- PropertyController (REST API layer)
- DataPopulator (startup data loader)
- “data” module beans:
- PropertyDao (interface)
- PropertyDaoImpl (JPA or JDBC interactions)
- PropertyEntity & PropertyType (domain model)
- Database (relational or in-memory store configured in application.properties)
- Build & deployment: Gradle → Docker image → container
b. Interactions
- Client → HTTP request → PropertyController
- Controller calls PropertyDaoImpl → SQL/ORM → Database
- On startup, DataPopulator runs → writes initial records to Database
c. Architectural patterns & principles
- Modular monolith (multi-module Gradle project)
- Layered: Controller → DAO → Entity → Database
- Dependency injection (Spring-managed beans across modules)
- Single responsibility: data module cannot start HTTP server; web module depends on data module
d. Key technologies
- Spring Boot (REST, DI)
- Java 21
- Gradle multi-project build
- JUnit 5
- Docker

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client
    Client["Client\n(browser or service)"]:::client

    %% Web Module
    subgraph "Web Module"
        App["Spring Boot App\n(Application.java)\nSpring Boot 3.4.3\nJava 21"]:::web
        Controller["PropertyController"]:::web
        DTO["PropertyResult"]:::web
        Config["application.properties"]:::web
    end

    %% Data Module
    subgraph "Data Module"
        DataPop["DataPopulator"]:::data
        DAOInt["PropertyDao\n(interface)"]:::data
        DAOImpl["PropertyDaoImpl"]:::data
        Entity["PropertyEntity"]:::data
        Enum["PropertyType"]:::data
    end

    %% Database
    DB["Database"]:::infra

    %% Build & Deploy
    subgraph "Build & Deploy"
        Gradle["settings.gradle\n(Gradle multi-module build)"]:::infra
        Docker["Dockerfile"]:::infra
    end

    %% Connections
    Client -->|"HTTP REST call"| Controller
    Controller -->|"invoke DAO"| DAOImpl
    DAOImpl -->|"SQL/ORM"| DB
    DataPop -->|"data load"| DB
    App -->|"depends on"| DAOInt
    Gradle -->|"build image"| Docker
    Docker -->|"deploy container"| App

    %% Click Events
    click App "https://github.com/rightmove/code-challenge-devex/blob/master/web/src/main/java/com/rightmove/Application.java"
    click Controller "https://github.com/rightmove/code-challenge-devex/blob/master/web/src/main/java/com/rightmove/property/PropertyController.java"
    click DTO "https://github.com/rightmove/code-challenge-devex/blob/master/web/src/main/java/com/rightmove/property/PropertyResult.java"
    click Config "https://github.com/rightmove/code-challenge-devex/blob/master/web/src/main/resources/application.properties"
    click DataPop "https://github.com/rightmove/code-challenge-devex/blob/master/data/src/main/java/com/rightmove/property/data/DataPopulator.java"
    click DAOInt "https://github.com/rightmove/code-challenge-devex/blob/master/data/src/main/java/com/rightmove/property/data/PropertyDao.java"
    click DAOImpl "https://github.com/rightmove/code-challenge-devex/blob/master/data/src/main/java/com/rightmove/property/data/PropertyDaoImpl.java"
    click Entity "https://github.com/rightmove/code-challenge-devex/blob/master/data/src/main/java/com/rightmove/property/data/PropertyEntity.java"
    click Enum "https://github.com/rightmove/code-challenge-devex/blob/master/data/src/main/java/com/rightmove/property/data/PropertyType.java"
    click Docker "https://github.com/rightmove/code-challenge-devex/tree/master/Dockerfile"
    click Gradle "https://github.com/rightmove/code-challenge-devex/blob/master/settings.gradle"

    %% Styles
    classDef web fill:#cce5ff,stroke:#0366d6,color:#0366d6
    classDef data fill:#d4edda,stroke:#28a745,color:#155724
    classDef infra fill:#e2e3e5,stroke:#6c757d,color:#343a40
    classDef client fill:#fff3cd,stroke:#856404,color:#856404
```
