Compare commits

...

26 Commits

Author SHA1 Message Date
TakahashiNg 25cb59c56c Merge branch 'dev-order-service' of http://host.docker.internal:9780/takahashi/backend into dev-order-service
Release package / release (push) Successful in 2m27s
2026-03-23 00:53:07 +00:00
TakahashiNg d49482b4ba fix: better build configuration 2026-03-23 00:52:26 +00:00
gitea-actions d1d81037a4 chore: release [ci skip] 2026-03-23 00:51:37 +00:00
TakahashiNg ec25744942 fix: better build configuration
Release package / release (push) Successful in 3m56s
2026-03-23 00:48:19 +00:00
TakahashiNg ffdd64a1da fix: better build configuration
Release package / release (push) Failing after 3m34s
2026-03-23 00:44:16 +00:00
TakahashiNg a04e3353f8 fix: test
Release package / release (push) Failing after 3m58s
2026-03-23 00:32:14 +00:00
TakahashiNg 1416c61da1 Merge branch 'dev-order-service' of http://host.docker.internal:9780/takahashi/backend into dev-order-service
Release package / release (push) Successful in 4m41s
2026-03-22 15:20:39 +00:00
TakahashiNg 6b1368fc42 fix: disabled build 2026-03-22 15:20:01 +00:00
gitea-actions 2b993bdef4 chore: release [ci skip] 2026-03-22 15:16:46 +00:00
TakahashiNg 8da7877920 fix: test
Release package / release (push) Successful in 8m30s
2026-03-22 15:09:35 +00:00
gitea-actions 45e01a863b chore: release [ci skip] 2026-03-22 15:05:19 +00:00
TakahashiNg d851a49fc3 fix: better act config
Release package / release (push) Successful in 9m25s
2026-03-22 14:57:45 +00:00
gitea-actions 5cd79b10a2 chore: release [ci skip] 2026-03-22 14:51:12 +00:00
TakahashiNg 4f66008774 fix: test
Release package / release (push) Successful in 6m13s
2026-03-22 14:37:39 +00:00
TakahashiNg db13397063 fix: test
Release package / release (push) Has been cancelled
2026-03-22 14:14:42 +00:00
gitea-actions 89107bb5a8 chore: release [ci skip] 2026-03-22 14:11:24 +00:00
TakahashiNg ad77a3022c fix: test
Release package / release (push) Waiting to run
2026-03-22 14:07:03 +00:00
gitea-actions 9d900f8fb3 chore: release [ci skip] 2026-03-22 14:02:30 +00:00
TakahashiNg 2b6f8da6c2 Merge branch 'dev-order-service' of http://host.docker.internal:9780/takahashi/backend into dev-order-service
Release package / release (push) Waiting to run
2026-03-22 13:57:17 +00:00
TakahashiNg 9b2d90d290 fix: removed ignore file 2026-03-22 13:56:39 +00:00
gitea-actions d40c586299 chore: release [ci skip] 2026-03-22 13:45:28 +00:00
TakahashiNg 66df4488c0 fix: better image push
Release package / release (push) Successful in 9m58s
2026-03-22 13:40:54 +00:00
gitea-actions a3470a3b7a chore: release [ci skip] 2026-03-22 13:31:39 +00:00
TakahashiNg a320b6cd16 fix: test
Release package / release (push) Successful in 11m18s
2026-03-22 13:26:01 +00:00
TakahashiNg 392d395215 fix: test
Release package / release (push) Waiting to run
2026-03-22 13:13:13 +00:00
TakahashiNg 784e516eea fix: update
Release package / release (push) Failing after 2m34s
2026-03-22 12:55:15 +00:00
20 changed files with 205 additions and 127 deletions
+4 -4
View File
@@ -4,7 +4,7 @@ services:
restart: unless-stopped
network_mode: host
extra_hosts:
- 'host.docker.internal:host-gateway'
- "host.docker.internal:host-gateway"
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
@@ -13,7 +13,7 @@ services:
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
kafdrop:
@@ -23,7 +23,7 @@ services:
- kafka
network_mode: host
extra_hosts:
- 'host.docker.internal:host-gateway'
- "host.docker.internal:host-gateway"
command: sh -c "sleep 5 && exec ./start-app"
environment:
KAFKA_BROKERCONNECT: 'localhost:9092'
KAFKA_BROKERCONNECT: "localhost:9092"
+1 -1
View File
@@ -11,5 +11,5 @@ services:
- ../..:/workspaces:cached
network_mode: host
extra_hosts:
- 'host.docker.internal:host-gateway'
- "host.docker.internal:host-gateway"
command: sleep infinity
+1 -1
View File
@@ -5,7 +5,7 @@ services:
- POSTGRES_PASSWORD=password
network_mode: host
extra_hosts:
- 'host.docker.internal:host-gateway'
- "host.docker.internal:host-gateway"
volumes:
- postgres_data:/var/lib/postgresql/data
+12 -4
View File
@@ -19,8 +19,8 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '25'
distribution: "temurin"
java-version: "25"
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
@@ -43,7 +43,15 @@ jobs:
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
@@ -53,6 +61,7 @@ jobs:
- name: Run Semantic Release
env:
GITEA_USER: ${{ github.actor }}
GITEA_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
pnpm i
@@ -60,7 +69,6 @@ jobs:
pnpm release
- name: Commit & Push Changes
if: always()
env:
MY_PAT_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
+1
View File
@@ -46,3 +46,4 @@ nb-configuration.xml
# NodeJS
/node_modules
/.pnpm-store
+1 -1
View File
@@ -8,7 +8,7 @@
"@semantic-release/exec",
{
"prepareCmd": "./mvnw versions:set -DnewVersion=${nextRelease.version}",
"publishCmd": "./mvnw clean package -Dquarkus.container-image.tag=${nextRelease.version} -DskipTests"
"publishCmd": "./mvnw package -Dquarkus.container-image.tag=${nextRelease.version} -DskipTests"
}
],
["@saithodev/semantic-release-gitea", {
+56
View File
@@ -0,0 +1,56 @@
# [1.0.0-dev.16](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.15...v1.0.0-dev.16) (2026-03-23)
### Bug Fixes
* better build configuration ([ec25744](https://git.demonkernel.io.vn/FoodSurf/backend/commit/ec2574494239b5660b740f14947134aa4839f2da))
# [1.0.0-dev.12](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.11...v1.0.0-dev.12) (2026-03-22)
### Bug Fixes
* test ([8da7877](https://git.demonkernel.io.vn/FoodSurf/backend/commit/8da7877920b552e1e2f325bb40ccb4eb9a9c0907))
# [1.0.0-dev.11](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.10...v1.0.0-dev.11) (2026-03-22)
### Bug Fixes
* better act config ([d851a49](https://git.demonkernel.io.vn/FoodSurf/backend/commit/d851a49fc3d831048eae6482aab1b915fb39f6da))
# [1.0.0-dev.10](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.9...v1.0.0-dev.10) (2026-03-22)
### Bug Fixes
* test ([4f66008](https://git.demonkernel.io.vn/FoodSurf/backend/commit/4f66008774e1bd338bc94dd58f9500310490d3f2))
* test ([db13397](https://git.demonkernel.io.vn/FoodSurf/backend/commit/db13397063c80ddf310510152bbdb397d98730b7))
# [1.0.0-dev.9](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.8...v1.0.0-dev.9) (2026-03-22)
### Bug Fixes
* test ([ad77a30](https://git.demonkernel.io.vn/FoodSurf/backend/commit/ad77a3022cd9f03749a764b91ee85942f9b696f9))
# [1.0.0-dev.8](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.7...v1.0.0-dev.8) (2026-03-22)
### Bug Fixes
* removed ignore file ([9b2d90d](https://git.demonkernel.io.vn/FoodSurf/backend/commit/9b2d90d29003090954b104b54e7ba723c0bae1f7))
# [1.0.0-dev.7](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.6...v1.0.0-dev.7) (2026-03-22)
### Bug Fixes
* better image push ([66df448](https://git.demonkernel.io.vn/FoodSurf/backend/commit/66df4488c0fd9b9bda1df72877d7ab6c4a075d84))
# [1.0.0-dev.6](https://git.demonkernel.io.vn/FoodSurf/backend/compare/v1.0.0-dev.5...v1.0.0-dev.6) (2026-03-22)
### Bug Fixes
* test ([a320b6c](https://git.demonkernel.io.vn/FoodSurf/backend/commit/a320b6cd162be6f09381698ee1551e7575c33c1c))
+16 -7
View File
@@ -1,5 +1,9 @@
<?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">
<?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>
<groupId>com.drinkool</groupId>
<artifactId>account-service</artifactId>
@@ -10,9 +14,11 @@
<compiler-plugin.version>3.15.0</compiler-plugin.version>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.reporting.outputEncoding
>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.group-id
>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.32.4</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.5.4</surefire-plugin.version>
@@ -102,7 +108,8 @@
<configuration>
<argLine>@{argLine}</argLine>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<java.util.logging.manager
>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
@@ -121,8 +128,10 @@
<configuration>
<argLine>@{argLine}</argLine>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<native.image.path
>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager
>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
@@ -2,13 +2,13 @@ package com.drinkool;
import com.drinkool.dtos.*;
import com.drinkool.models.Customer;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.*;
import jakarta.ws.rs.core.*;
@Path("/api")
public class RestAPI {
@POST
@Path("/signup")
@Transactional
@@ -36,11 +36,11 @@ public class RestAPI {
public Response login(Login input) {
Customer customer = Customer.find("phone", input.phone).firstResult();
if (customer == null)
throw new BadRequestException("InvalidPhoneNumber");
if (customer == null) throw new BadRequestException("InvalidPhoneNumber");
if (!customer.login(input.password))
throw new BadRequestException("InvalidPassword");
if (!customer.login(input.password)) throw new BadRequestException(
"InvalidPassword"
);
return Response.accepted().build();
}
@@ -1,6 +1,7 @@
package com.drinkool.dtos;
public class Login {
public String phone;
public String password;
}
@@ -1,5 +1,6 @@
package com.drinkool.dtos;
public class QuickSignup {
public String phone;
}
@@ -1,6 +1,7 @@
package com.drinkool.dtos;
public class Signup {
public String name;
public String phone;
public String password;
@@ -4,6 +4,4 @@ import jakarta.persistence.*;
@Entity
@Table(name = "customer")
public class Customer extends User {
}
public class Customer extends User {}
@@ -1,19 +1,18 @@
package com.drinkool.models;
import com.drinkool.utils.PhoneValidator;
import com.password4j.Password;
import io.quarkus.hibernate.orm.panache.PanacheEntity;
import jakarta.persistence.*;
import jakarta.transaction.*;
import jakarta.ws.rs.BadRequestException;
import java.util.UUID;
import com.drinkool.utils.PhoneValidator;
import com.password4j.Password;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "users")
public abstract class User extends PanacheEntity {
@Column(nullable = false)
public String name;
@@ -48,8 +47,7 @@ public abstract class User extends PanacheEntity {
}
public boolean login(String rawPassword) {
if (this.hashedPassword == null)
return false;
if (this.hashedPassword == null) return false;
return Password.check(rawPassword, this.hashedPassword).withArgon2();
}
@@ -4,7 +4,9 @@ import com.google.i18n.phonenumbers.*;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
public class PhoneValidator {
private static final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
private static final PhoneNumberUtil phoneUtil =
PhoneNumberUtil.getInstance();
public static boolean isValidInternationalPhone(String phone) {
try {
@@ -9,8 +9,8 @@ quarkus.hibernate-orm.database.generation=update
# URL của Gitea Registry (thường là gitea.yourdomain.com)
quarkus.container-image.registry=git.demonkernel.io.vn
quarkus.container-image.group=foodsurf/backend
quarkus.container-image.name=auth-service
quarkus.container-image.group=foodsurf
quarkus.container-image.name=account-service
quarkus.container-image.push=true
quarkus.container-image.build=true
quarkus.container-image.builder=docker
@@ -1,20 +1,21 @@
package com.drinkool;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
import io.quarkus.test.junit.QuarkusTest;
import org.junit.jupiter.api.Test;
@QuarkusTest
class GreetingResourceTest {
@Test
void testHelloEndpoint() {
given()
.when().get("/hello")
.when()
.get("/hello")
.then()
.statusCode(200)
.body(is("Hello from Quarkus REST"));
}
}
+1 -1
View File
@@ -3,7 +3,7 @@
"description": "",
"scripts": {
"release": "semantic-release",
"format": "prettier --write \"./**/*.{java,yaml,json,xml}\""
"format": "prettier --write \"./**/*.{java,yaml,json,xml}\" \"./**/.*rc\""
},
"keywords": [],
"author": "DemonKernel",
+6 -4
View File
@@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
<?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">
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>
<groupId>com.drinkool</groupId>
<artifactId>drinkool</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.0.0-dev.16</version>
<packaging>pom</packaging>
<properties>
<maven.compiler.source>17</maven.compiler.source>