Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +0,0 @@
*
!target/*-runner
!target/*-runner.jar
!target/lib/*
!target/quarkus-app/*
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,30 @@ nb-configuration.xml

# Local environment
.env

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json

*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/tools/api/
/web/node/
/web/_old/
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM eclipse-temurin:21-jdk

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
WORKDIR /app

COPY entrypoint.sh ./
COPY --chown=185 service/target/quarkus-app/lib /app/lib
COPY --chown=185 service/target/quarkus-app/app /app/app
COPY --chown=185 service/target/quarkus-app/quarkus /app/quarkus
COPY --chown=185 service/target/quarkus-app/quarkus-run.jar /app/app.jar

EXPOSE 8080
USER 185

CMD ["/app/entrypoint.sh"]
30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* [Open-api generate](https://openapi-generator.tech/docs/generators/typescript-axios)

## Frontend
* [React](https://reactjs.org/)
* [svelte](https://svelte.dev)
* [Vite](https://vitejs.dev/)
* [mantine](https://mantine.dev/)
* [stwui](https://stwui.vercel.app/)

## How to run project

Expand Down
37 changes: 37 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
version: '3'

tasks:
dev-dependencies:
cmd: docker compose up -d database

build:
cmds:
- task: build-openapi
- task: web-build
- mvn package -Pprod

build-fast:
cmd: mvn package -Pprod -DskipTests -DskipChecks

build-openapi:
cmd: mvn package -Popen-api -DskipTests -DskipChecks -am -pl "service"

run:
cmd: docker compose up -d service --build

be:dev:
cmds:
- task: dev-dependencies
- mvn compile quarkus:dev -am -pl "service"

be:clean:
cmd: mvn clean

fe:build:
cmd: mvn clean package -pl web -DskipTests

fe:dev:
cmd: yarn --cwd ./web dev --open

generate-jwt:
cmd: mvn exec:java -pl "service" -Dexec.mainClass=com.lopixlabs.app.fullstackdemo.GenerateToken -Dexec.classpathScope=test -Dsmallrye.jwt.sign.key.location=privateKey.pem
7 changes: 7 additions & 0 deletions doc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj-diagram</artifactId>
<version>2.2.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
Expand Down
7 changes: 7 additions & 0 deletions doc/src/main/asciidoc/auth.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

The diagram shows flow of how we implemented Authentication process with Access Token and Refresh Token.

["plantuml","containers",svg]
plantuml::auth.puml[]


27 changes: 27 additions & 0 deletions doc/src/main/asciidoc/auth.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@startuml
autonumber 1

alt User Login
Client -> Server: Login \nPOST /api/auth/signin {username, password}
activate Server
Server --> Client: Authentication Response {token, refreshToken}
deactivate Server
end alt

alt Access resource with Expired token
Client -> Server: Request data with JWT on header
activate Server
Server --> Client: Token Expired
deactivate Server
end alt

alt Refresh token
Client -> Server: Send Refresh token request \nPOST /api/auth/refreshToken
activate Server
Server --> Client: Authentication Response {token, refreshToken}
deactivate Server
end alt



@enduml
14 changes: 14 additions & 0 deletions doc/src/main/asciidoc/jwt.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

|===
|Property |Description
|iss|The issuer of the token, typically the server that generated it.
|sub|The subject of the token, typically the user to whom the token pertains.
|aud|The intended audience of the token, typically the server(s) that should accept and validate the token.
|exp|The expiration time of the token, after which it should no longer be accepted.
|iat|The time at which the token was issued.
|jti|The unique identifier of the token, which can be used to prevent replay attacks.

|===



2 changes: 1 addition & 1 deletion doc/src/main/asciidoc/openapi/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.4.0
6.5.0
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d624c50784935cfcca1dc30c29b4b047623e40011cd9bf82ec19db74c9422e24
61afb69e36ed22dad34196d1f1bcaf0ee76844e96a615ba8d745ade634223fa6
Loading