From 7e4e1a902e5702370d477ada561aede0af714a77 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 14:55:01 +0300 Subject: [PATCH 1/6] feat: add a Dockerfile for the front end to serve web --- frontend/Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 frontend/Dockerfile diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..2e63451 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,13 @@ +FROM ghcr.io/cirruslabs/flutter:3.32.6 AS build +WORKDIR /app + +COPY . . + +RUN flutter pub get +RUN flutter build web --release + +FROM nginx:alpine +COPY --from=build /app/build/web /usr/share/nginx/html + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file From 960aa996fb0accfd1f0a0cacb3831e727321240c Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 14:55:14 +0300 Subject: [PATCH 2/6] feat: hook up the front end with the production API --- frontend/lib/constants/api_constants.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/lib/constants/api_constants.dart b/frontend/lib/constants/api_constants.dart index 7b4f6ad..cff2042 100644 --- a/frontend/lib/constants/api_constants.dart +++ b/frontend/lib/constants/api_constants.dart @@ -1,10 +1,10 @@ class ApiConstants { - static const String baseUrl = 'http://localhost:8080'; - + static const String baseUrl = 'https://api.wesal.online'; + // Auth endpoints static const String loginEndpoint = '/login'; - + // User endpoints static const String getUserEndpoint = '/getUser'; static const String updateUserEndpoint = '/updateUser'; -} \ No newline at end of file +} From 1a540e6999c40d3f3f3132d98acf5deb391cf9bf Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 14:56:10 +0300 Subject: [PATCH 3/6] chore: update maven compile plugin to match JDK version --- backend/application.yml | 21 +++++++++++++++++++++ backend/pom.xml | 14 +++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 backend/application.yml diff --git a/backend/application.yml b/backend/application.yml new file mode 100644 index 0000000..541a4fe --- /dev/null +++ b/backend/application.yml @@ -0,0 +1,21 @@ +spring: + datasource: + url: ${DB_URL} + username: ${DB_USER} + password: ${DB_PASSWORD} + driver-class-name: org.postgresql.Driver + + jpa: + hibernate: + ddl-auto: update + show-sql: true + properties: + hibernate: + dialect: org.hibernate.dialect.PostgreSQLDialect + format_sql: true + + application: + name: wesal + +server: + port: 8080 diff --git a/backend/pom.xml b/backend/pom.xml index ba34886..c085247 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -28,6 +28,8 @@ 21 + 21 + 21 @@ -96,7 +98,17 @@ org.springframework.boot spring-boot-maven-plugin + + org.apache.maven.plugins + maven-compiler-plugin + 3.13.0 + + 21 + 21 + 21 + + - + \ No newline at end of file From 9ab02dda7fc1a89f8d1bb68167aec23a5d1355e1 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 14:56:19 +0300 Subject: [PATCH 4/6] feat: add Dockerfile for backend --- backend/Dockerfile | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 backend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..68d5258 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,14 @@ +FROM maven:3.9.11-eclipse-temurin-21 + +WORKDIR /app + +COPY pom.xml . +COPY application.yml . + +RUN mvn dependency:go-offline -B + +COPY src ./src + +EXPOSE 8080 + +CMD ["mvn", "spring-boot:run"] From 54a1298edf3954bf00b1e741e6de0fd092a82060 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 14:57:11 +0300 Subject: [PATCH 5/6] feat: serve the web app and the backend from Compose --- docker-compose.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0a89171..1a6f764 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,4 +17,21 @@ services: depends_on: - db ports: - - 8100:8080 \ No newline at end of file + - 8100:8080 + + server: + restart: unless-stopped + build: + context: ./backend + dockerfile: Dockerfile + ports: + - 4044:8080 + + + web: + restart: unless-stopped + build: + context: ./frontend + dockerfile: Dockerfile + ports: + - 6060:80 From afacd192d279783af97d021fb31287422c983909 Mon Sep 17 00:00:00 2001 From: sBubshait Date: Mon, 21 Jul 2025 15:02:30 +0300 Subject: [PATCH 6/6] feat: add back button from settings not from profile --- frontend/lib/screens/pages/profile_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/lib/screens/pages/profile_page.dart b/frontend/lib/screens/pages/profile_page.dart index d0a42ab..de8ef20 100644 --- a/frontend/lib/screens/pages/profile_page.dart +++ b/frontend/lib/screens/pages/profile_page.dart @@ -150,6 +150,7 @@ class _ProfilePageState extends State { preferredSize: Size.fromHeight(1), child: Container(height: 1, color: Colors.grey[200]), ), + automaticallyImplyLeading: false, ), body: SingleChildScrollView( child: Column( @@ -493,7 +494,6 @@ class _SettingsPageState extends State { preferredSize: Size.fromHeight(1), child: Container(height: 1, color: Colors.grey[200]), ), - automaticallyImplyLeading: false, ), body: Padding( padding: EdgeInsets.all(16),