Compare commits

...
5 Commits
Author SHA1 Message Date
hamx e1ae71409b Add .gitignore to exclude build artifacts and IDE configuration files 2026-05-29 23:29:59 +02:00
hamx a3d2a781c2 Nigdy nie wkładamy target do repozytorium 2026-05-29 23:29:10 +02:00
B3rcik 08f28dd727 . 2026-05-28 20:54:36 +02:00
B3rcik 946946622e . 2026-05-28 20:44:41 +02:00
B3rcik 4213478c94 dolozone 2026-05-25 23:19:18 +02:00
5 changed files with 97 additions and 5 deletions
+33
View File
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
+36 -3
View File
@@ -12,7 +12,7 @@ services:
- postgres_data:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
listhub_backend: listhub_backend:
build: . build: ./backend
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
- db - db
@@ -24,8 +24,41 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
volumes: volumes:
- listhub_data:/app - listhub_backend_data:/app
listhub_frontend:
build:
context: ./frontend
args:
VITE_API_URL: http://localhost:8080/api/v1
restart: unless-stopped
depends_on:
- listhub_backend
ports:
- "8000:8000"
volumes:
- listhub_frontend_data:/app
loki:
image: grafana/loki:2.9.2
container_name: loki
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
restart: unless-stopped
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
depends_on:
- loki
restart: unless-stopped
volumes: volumes:
postgres_data: postgres_data:
listhub_data: listhub_backend_data:
listhub_frontend_data:
+5
View File
@@ -31,6 +31,11 @@
<lombok.version>1.18.46</lombok.version> <lombok.version>1.18.46</lombok.version>
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>com.github.loki4j</groupId>
<artifactId>loki-logback-appender</artifactId>
<version>1.4.1</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId> <artifactId>spring-boot-starter-data-jpa</artifactId>
@@ -6,6 +6,7 @@ import _11.asktpk.artisanconnectbackend.dto.*;
import _11.asktpk.artisanconnectbackend.security.JwtUtil; import _11.asktpk.artisanconnectbackend.security.JwtUtil;
import _11.asktpk.artisanconnectbackend.service.AuthService; import _11.asktpk.artisanconnectbackend.service.AuthService;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.*; import org.springframework.http.*;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -45,8 +46,8 @@ public class AuthController {
} }
} }
@PostMapping("/register") @PostMapping("/register")//****************************
public ResponseEntity<?> register(@RequestBody ClientRegistrationDTO clientRegistrationDTO) { public ResponseEntity<?> register(@Valid @RequestBody ClientRegistrationDTO clientRegistrationDTO) { // <-- Dodane @Valid przed @RequestBody
if (clientRegistrationDTO.getEmail() == null || clientRegistrationDTO.getPassword() == null if (clientRegistrationDTO.getEmail() == null || clientRegistrationDTO.getPassword() == null
|| clientRegistrationDTO.getEmail().isEmpty() || clientRegistrationDTO.getPassword().isEmpty()) { || clientRegistrationDTO.getEmail().isEmpty() || clientRegistrationDTO.getPassword().isEmpty()) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new RequestResponseDTO("Przekazano puste login lub hasło")); return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new RequestResponseDTO("Przekazano puste login lub hasło"));
+20
View File
@@ -0,0 +1,20 @@
<configuration>
<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<http>
<url>http://loki:3100/loki/api/v1/push</url>
</http>
<format>
<label>
<pattern>app=backend,host=${HOSTNAME},level=%level</pattern>
</label>
<message>
<pattern>%l %msg</pattern>
</message>
</format>
</appender>
<root level="INFO">
<appender-ref ref="LOKI" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>