diff --git a/.run/ShareItGateway.run.xml b/.run/ShareItGateway.run.xml
new file mode 100644
index 0000000..32c8129
--- /dev/null
+++ b/.run/ShareItGateway.run.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/ShareItServer.run.xml b/.run/ShareItServer.run.xml
new file mode 100644
index 0000000..a8ed9e5
--- /dev/null
+++ b/.run/ShareItServer.run.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..3ab8885
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,57 @@
+version: '3.8'
+
+services:
+ gateway:
+ build: ./gateway
+ container_name: shareit-gateway
+ ports:
+ - "8080:8080"
+ depends_on:
+ server:
+ condition: service_healthy
+ environment:
+ - SHAREIT_SERVER_URL=http://server:9090
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
+ interval: 10s
+ timeout: 5s
+ retries: 10
+
+ server:
+ build: ./server
+ container_name: shareit-server
+ ports:
+ - "9090:9090"
+ depends_on:
+ db:
+ condition: service_healthy
+ environment:
+ - SPRING_DATASOURCE_URL=jdbc:postgresql://db:5432/shareit
+ - SPRING_DATASOURCE_USERNAME=postgres
+ - SPRING_DATASOURCE_PASSWORD=postgres
+ healthcheck:
+ test: ["CMD", "curl", "-f", "http://localhost:9090/actuator/health"]
+ interval: 10s
+ timeout: 5s
+ retries: 10
+ command: ["./wait-for-it.sh", "db:5432", "--timeout=120", "--", "java", "-jar", "app.jar"]
+
+ db:
+ image: postgres:13.7-alpine
+ container_name: postgres
+ ports:
+ - "5432:5432"
+ environment:
+ - POSTGRES_PASSWORD=postgres
+ - POSTGRES_USER=postgres
+ - POSTGRES_DB=shareit
+ volumes:
+ - postgres_data:/var/lib/postgresql/data
+ healthcheck:
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
+ interval: 5s
+ timeout: 5s
+ retries: 10
+
+volumes:
+ postgres_data:
\ No newline at end of file
diff --git a/gateway/Dockerfile b/gateway/Dockerfile
new file mode 100644
index 0000000..0ff1817
--- /dev/null
+++ b/gateway/Dockerfile
@@ -0,0 +1,5 @@
+FROM eclipse-temurin:21-jre-jammy
+VOLUME /tmp
+ARG JAR_FILE=target/*.jar
+COPY ${JAR_FILE} app.jar
+ENTRYPOINT ["sh", "-c", "java ${JAVA_OPTS} -jar /app.jar"]
\ No newline at end of file
diff --git a/gateway/pom.xml b/gateway/pom.xml
new file mode 100644
index 0000000..d0cb9a8
--- /dev/null
+++ b/gateway/pom.xml
@@ -0,0 +1,83 @@
+
+
+ 4.0.0
+
+ ru.practicum
+ shareit
+ 0.0.1-SNAPSHOT
+
+
+ shareit-gateway
+ 0.0.1-SNAPSHOT
+ ShareIt Gateway
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+ org.springframework.boot
+ spring-boot-starter-validation
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ org.apache.httpcomponents
+ httpclient
+ 4.5.14
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.apache.httpcomponents.client5
+ httpclient5
+ 5.2.1
+
+
+ org.mapstruct
+ mapstruct
+ ${mapstruct.version}
+
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ ${java.version}
+ ${java.version}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+ org.mapstruct
+ mapstruct-processor
+ ${mapstruct.version}
+
+
+ org.projectlombok
+ lombok-mapstruct-binding
+ 0.2.0
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/gateway/src/main/java/ru/practicum/shareit/ShareItGatewayApp.java b/gateway/src/main/java/ru/practicum/shareit/ShareItGatewayApp.java
new file mode 100644
index 0000000..084aa09
--- /dev/null
+++ b/gateway/src/main/java/ru/practicum/shareit/ShareItGatewayApp.java
@@ -0,0 +1,11 @@
+package ru.practicum.shareit;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class ShareItGatewayApp {
+ public static void main(String[] args) {
+ SpringApplication.run(ShareItGatewayApp.class, args);
+ }
+}
\ No newline at end of file
diff --git a/gateway/src/main/java/ru/practicum/shareit/booking/BookingStatus.java b/gateway/src/main/java/ru/practicum/shareit/booking/BookingStatus.java
new file mode 100644
index 0000000..a34e409
--- /dev/null
+++ b/gateway/src/main/java/ru/practicum/shareit/booking/BookingStatus.java
@@ -0,0 +1,8 @@
+package ru.practicum.shareit.booking;
+
+public enum BookingStatus {
+ WAITING,
+ APPROVED,
+ REJECTED,
+ CANCELED
+}
\ No newline at end of file
diff --git a/gateway/src/main/java/ru/practicum/shareit/booking/client/BookingClient.java b/gateway/src/main/java/ru/practicum/shareit/booking/client/BookingClient.java
new file mode 100644
index 0000000..6bd20ad
--- /dev/null
+++ b/gateway/src/main/java/ru/practicum/shareit/booking/client/BookingClient.java
@@ -0,0 +1,60 @@
+package ru.practicum.shareit.booking.client;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.boot.web.client.RestTemplateBuilder;
+import org.springframework.http.ResponseEntity;
+import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.web.util.DefaultUriBuilderFactory;
+import ru.practicum.shareit.booking.dto.BookingDto;
+import ru.practicum.shareit.booking.dto.BookingState;
+import ru.practicum.shareit.client.BaseClient;
+
+import java.util.Map;
+
+@Service
+public class BookingClient extends BaseClient {
+ private static final String API_PREFIX = "/bookings";
+
+ @Autowired
+ public BookingClient(@Value("${shareit-server.url}") String serverUrl, RestTemplateBuilder builder) {
+ super(
+ builder
+ .uriTemplateHandler(new DefaultUriBuilderFactory(serverUrl + API_PREFIX))
+ .requestFactory(() -> new HttpComponentsClientHttpRequestFactory())
+ .build()
+ );
+ }
+
+ public ResponseEntity