Files
reitti/pom.xml
Daniel Graf ed07c18500 10 update detection of visits and places (#17)
* - Remove `SignificantPlaceService` and migrate functionality to `VisitService` and `VisitMergingService`.
- Decouple `Visit` from `SignificantPlace` by removing `place_id` and adding `latitude` and `longitude` fields.
- Refactor `LocationProcessingPipeline` to work with updated `VisitService` for stay point processing.
- Update database schema via migration to remove references to `place_id` in `visits` table.
- Cleanup and improve merging logic in `VisitMergingService` for processed visits.

* refactor: update visit merging logic and distance calculation method

* refactor: optimize visit merging algorithm to reduce ProcessedVisit objects

* refactor: rename Haversine distance method to improve clarity

* feat: add meters to degrees conversion method in GeoUtils

* test: add unit test for GeoUtils distance calculation

* test: add test cases for metersToDegreesAtPosition method

* feat: Add Testcontainers configuration for RabbitMQ and TimescaleDB

* - Refactor TestContainer management to simplify integration tests setup
- Remove redundant Google Takeout and GPX import endpoints from LocationDataApiController
- Add dedicated ImportDataApiController for handling file imports
- Replace RabbitTemplate dependency with ImportListener interface in ImportHandler
- Implement RabbitMQImportDispatcher to handle RabbitMQ interactions
- Convert GeoUtils method calls to use more succinct `distanceInMeters`
- Adjust visit merging threshold setting in application.properties
- Enable Flyway migrations during tests
- Add unit test for ImportHandler GPX functionality
- Update visit repository with method for unprocessed visit periods logging

* refactor: Adjust stay point detection parameters and time window calculation

* feat: make stay point detection parameters configurable

* - Remove `LocationDataProcessingService` and related unused files/tests.
- Migrate RabbitMQ listener to `LocationProcessingPipeline`.
- Add new test `StayPointDetectionServiceTest` for stay point detection validation.
- Refactor `ImportListener` method to `handleImport` for improved clarity.
- Enhance `RawLocationPoint` with `equals` and `hashCode` methods.
- Adjust stay point detection property names for better readability.
- Add `MockImportListener` for test use.
- Refactor and expand test coverage for `LocationDataService` and `ImportHandler`.
- Add utility method for `StayPoint` distance calculation in `GeoUtils`.

* - Remove unused imports from StayPointDetectionServiceTest.java

* refactor: Update place merge distance calculation using GeoUtils method

* feat: enhance visit merging with configurable time and proximity criteria

* - Introduced `VisitMergingServiceTest` to validate visit merging functionality.
- Optimized visit merging in `VisitMergingService` by removing unnecessary time checks and parameters.
- Refactored stay point detection in `StayPointDetectionService` for simplicity and improved clustering.
- Added helper methods `weightedCenter` and reduced redundant logic in `StayPointDetectionService`.
- Enhanced testing utilities in `AbstractIntegrationTest` for visit-related imports.
- Extended `ProcessedVisitRepository` with `findByUserOrderByStartTime` for better sorting.

* - Removed TimescaleDB extension from database initialization script.
- Increased ImportHandler batch size from 100 to 10,000.
- Added staypoint time threshold configuration property.
- Adjusted staypoint detection minimum points from 5 to 1 in test properties.
- Updated BCrypt encoded password for the admin user.
- Switched Docker PostGIS image from TimescaleDB to PostGIS Alpine.
- Expanded StayPointDetectionService processing window by 1 hour before and after points.
- Fixed SettingsController to retrieve the principal from authentication instead of details.

* - Replace `Point` with `GeoPoint` for better consistency and clarity across the codebase.
- Update stay point clustering logic to reflect new `GeoPoint` implementation.
- Add transaction management to visit merging service test.
- Optimize imports and flatten stay point detection to improve readability.
- Reduce batch size in import handler from 10000 to 100.
- Update application properties for fine-tuned stay point and visit processing settings.
- Introduce `GeoPoint` record for encapsulating geographic coordinates.
- Adjust test cases to match refined clustering and visit merging logic

* refactor: Simplify nearby places search by removing unnecessary blank line

* refactor: modify visit merging algorithm to merge consecutive visits at same place

* - Add `equals` and `hashCode` methods to `SignificantPlace` for better object comparison.
- Introduce `VisitMergingService` dependency and helper method `importUntilProcessedVisits` in `AbstractIntegrationTest`.
- Adjust `reitti.visit.merge-threshold-seconds` configuration from 300 to 600 seconds.
- Minor cleanup: remove redundant line in `VisitMergingService` and duplicate test data in `VisitMergingServiceTest`.

* - Add `toString` implementation to `SignificantPlace` class
- Add integration test for `TripDetectionService` to ensure trip detection logic between visits
- Include helper method to print detected trips in tests

* feat: make batch size configurable in ImportHandler with @Value

* refactor: Extend trip search time range by one day before and after

* added new icons

* - updated trip merging to ignore duplicates
- add first and last places if they start before the current day but end on it.

* - updated labels on trips

* refactor: remove icon element from entry rendering logic

* feat: add day and month for entries spanning multiple days

* - added day and month if time is outside the selected day

* style: update login.html to match dark theme of the app

* feat: add persistent login with remember-me functionality

* feat: add user update functionality to settings page

* style: remove extra semicolon in CSS file

* feat: allow editing of current logged-in user with re-login warning

* refactor: Remove unused return value from updateUser method

* refactor: use HTMX for user form management with dynamic fragments

* - add ability to update existing users
- add remember me functionality

* - finished login page

* feat: adjust marker size and popup to reflect visit duration

* Revert "- finished login page"

This reverts commit 424988d009.

* - updated display of visits

* build: add Docker image building configuration to pom.xml

* fixed running all tests

* added docker image creation to build step

* feat: Add Docker Hub description and update README with comprehensive project details

* docs: Update README with detailed project information and usage instructions

* added docker image creation to build step

* add pre-release.yml

* add pre-release.yml

* added docker push

* added docker push

* added docker push

* added docker push

* added docker push

* refactor: remove Spring Boot Docker plugin and add custom Dockerfile with UID/GID support

* feat: improve user and group ID switching in Dockerfile

* build: add docker run script for container deployment

* updated docker creation

* updated docker creation

* updated docker creation

* updated docker creation

* updated docker creation

* updated docker creation
2025-06-04 16:40:37 +02:00

167 lines
5.9 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.0</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.dedicatedcode</groupId>
<artifactId>reitti</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>reitti</name>
<description>Reitti application</description>
<properties>
<java.version>24</java.version>
<argLine/>
<testcontainers.version>1.19.5</testcontainers.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.locationtech.jts</groupId>
<artifactId>jts-core</artifactId>
<version>1.20.0</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>6.6.15.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-springsecurity6</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<!-- Testcontainers -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>rabbitmq</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers-bom</artifactId>
<version>${testcontainers.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>properties</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{argLine} -javaagent:${org.mockito:mockito-core:jar}</argLine>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>docker</id>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>