Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"GitHub.copilot-chat",
"GitHub.vscode-github-actions",
"GitHub.vscode-pull-request-github",
"cweijan.vscode-mysql-client2",
"ckolkman.vscode-postgres",
"cracrayol.java-pmd",
"SonarSource.sonarlint-vscode",
"streetsidesoftware.code-spell-checker-portuguese-brazilian"
Expand Down
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
root = true

[*.{kt,kts}]
ktlint_standard_package-name = disabled
ktlint_package_name = disabled
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ nb-configuration.xml

# Local environment
.env

# Admin Vite (gerado por Maven: npm ci + npm run build)
src/main/resources/META-INF/resources/dashboard/
src/main/resources/META-INF/resources/admin/node_modules/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Users change Log

## 0.0.7

- Switch to Postgres
- Modify to support hexagonal architecture
- Create Dockerfile and docker-compose

## 0.0.6

- LoginResponseDTO as a standard response object from all endpoints
Expand Down
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
####
# Imagem JVM (Java 25) com o frontend admin (Vite/Vue) incluído.
#
# O admin em src/main/resources/META-INF/resources/admin gera artefatos em
# META-INF/resources/dashboard/ (URL /dashboard), servidos pelo Quarkus.
#
# A partir da raiz do repositório:
#
# docker build -t quarkus/users-jvm-admin .
#
# docker run --rm -p 8080:8080 quarkus/users-jvm-admin
#
# Requisitos: apenas Docker (Node e Maven correm dentro do build).
####

# --- 1) Build do admin (npm)
FROM node:22-alpine AS admin-build
WORKDIR /app/admin
COPY src/main/resources/META-INF/resources/admin/package.json \
src/main/resources/META-INF/resources/admin/package-lock.json ./
RUN npm ci
COPY src/main/resources/META-INF/resources/admin/ ./
RUN npm run build
# vite.config.js: outDir ../dashboard -> /app/dashboard

# --- 2) Build Quarkus (fast-jar), alinhado a maven.compiler.release=25
# Imagem Maven oficial (evita depender do wrapper: maven-wrapper.jar está em .gitignore)
FROM maven:3-eclipse-temurin-25 AS maven-build
WORKDIR /build
COPY pom.xml .
COPY src ./src
COPY --from=admin-build /app/dashboard ./src/main/resources/META-INF/resources/dashboard
RUN mvn -B -DskipTests package

# --- 3) Runtime (JRE 25)
FROM eclipse-temurin:25-jre-noble
ENV LANG='en_US.UTF-8' \
LANGUAGE='en_US:en' \
JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

WORKDIR /deployments
COPY --from=maven-build /build/target/quarkus-app/lib/ ./lib/
COPY --from=maven-build /build/target/quarkus-app/*.jar ./
COPY --from=maven-build /build/target/quarkus-app/app/ ./app/
COPY --from=maven-build /build/target/quarkus-app/quarkus/ ./quarkus/

EXPOSE 8080
ENTRYPOINT ["sh", "-c", "exec java ${JAVA_OPTS_APPEND} -jar quarkus-run.jar"]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,23 @@ The playground includes:

For detailed information about the playground, including how to run it in development and production modes, social login configuration, and user guide, see the [Playground Documentation](docs/playground/Playground.md).

## Admin Console
## Admin dashboard

The project includes a Vue 3 admin console application built with Vuetify that provides an administrative interface for managing users in the Orion Users service.
The project includes a Vue 3 admin application built with Vuetify that provides an administrative interface for managing users in the Orion Users service.

**Access the admin console**: After starting the application, navigate to `http://localhost:8080/console`
**Access the admin UI**: After starting the application, navigate to `http://localhost:8080/dashboard`

**Authentication**: The admin console requires authentication with a JWT token that includes the `admin` role. Only users with admin privileges can access this interface.
**Authentication**: The admin UI requires authentication with a JWT token that includes the `admin` role. Only users with admin privileges can access this interface.

The admin console includes:
The admin dashboard includes:
- User authentication with admin role verification
- User listing with filters and search functionality
- User detail view with complete user information
- User creation (create new users)
- User editing (update email and password)
- User deletion (delete users with confirmation)

For detailed information about the admin console, including development setup and features, see the [Admin Console README](src/main/resources/META-INF/resources/admin/README.md).
For detailed information about the admin UI, including development setup and features, see the [Admin README](src/main/resources/META-INF/resources/admin/README.md).

## Packaging and running the application

Expand Down
43 changes: 43 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Orion Users — API Quarkus + PostgreSQL
#
# docker compose up --build
# Abre: http://localhost:8080 (admin: http://localhost:8080/dashboard)
#
# Variáveis podem ser sobrescritas com ficheiro .env na mesma pasta.

services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-orion}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-orion}
POSTGRES_DB: ${POSTGRES_DB:-users}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-orion} -d ${POSTGRES_DB:-users}"]
interval: 5s
timeout: 5s
retries: 10

users:
build:
context: .
dockerfile: Dockerfile
ports:
- "${HTTP_PORT:-8080}:8080"
environment:
QUARKUS_DEVSERVICES_ENABLED: "false"
QUARKUS_DATASOURCE_REACTIVE_URL: postgresql://${POSTGRES_USER:-orion}:${POSTGRES_PASSWORD:-orion}@postgres:5432/${POSTGRES_DB:-users}
QUARKUS_DATASOURCE_USERNAME: ${POSTGRES_USER:-orion}
QUARKUS_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD:-orion}
# Evita dependência de SMTP real ao subir com compose (sobrescreve perfil prod)
QUARKUS_MAILER_MOCK: "${QUARKUS_MAILER_MOCK:-true}"
depends_on:
postgres:
condition: service_healthy

volumes:
postgres_data:
35 changes: 17 additions & 18 deletions docs/running/Running.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This document provides comprehensive instructions for running the Orion Users se

- **Java 21** or higher
- **Maven** (or use the included `mvnw` wrapper)
- **Database**: MySQL/MariaDB (or compatible database)
- **Database**: PostgreSQL
- **Node.js 18+** (for Playground frontend development)

### Running in Dev Mode
Expand Down Expand Up @@ -47,10 +47,10 @@ src/main/resources/application.properties

```properties
# Database Configuration
quarkus.datasource.db-kind=mysql
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=your-username
quarkus.datasource.password=your-password
quarkus.datasource.reactive.url=mysql://localhost:3306/users
quarkus.datasource.reactive.url=postgresql://localhost:5432/users

# JWT Configuration
mp.jwt.verify.publickey.location=classpath:publicKey.pem
Expand All @@ -77,13 +77,13 @@ You can use Quarkus profiles for different environments:

```properties
# Development
%dev.quarkus.datasource.reactive.url=mysql://localhost:3306/users_dev
%dev.quarkus.datasource.reactive.url=postgresql://localhost:5432/users_dev

# Test
%test.quarkus.datasource.reactive.url=mysql://localhost:3306/users_test
%test.quarkus.datasource.reactive.url=postgresql://localhost:5433/users_test

# Production
%prod.quarkus.datasource.reactive.url=mysql://production-host:3306/users_prod
%prod.quarkus.datasource.reactive.url=postgresql://production-host:5432/users_prod
```

## Production with Containers
Expand Down Expand Up @@ -112,7 +112,7 @@ docker build -f src/main/docker/Dockerfile.jvm -t orion-users:jvm .

```bash
docker run -i --rm -p 8080:8080 \
-e QUARKUS_DATASOURCE_REACTIVE_URL=mysql://host.docker.internal:3306/users \
-e QUARKUS_DATASOURCE_REACTIVE_URL=postgresql://host.docker.internal:5432/users \
-e QUARKUS_DATASOURCE_USERNAME=your-username \
-e QUARKUS_DATASOURCE_PASSWORD=your-password \
orion-users:jvm
Expand All @@ -124,7 +124,7 @@ You can override configuration using environment variables:

```bash
docker run -i --rm -p 8080:8080 \
-e QUARKUS_DATASOURCE_REACTIVE_URL=mysql://db-host:3306/users \
-e QUARKUS_DATASOURCE_REACTIVE_URL=postgresql://db-host:5432/users \
-e QUARKUS_DATASOURCE_USERNAME=dbuser \
-e QUARKUS_DATASOURCE_PASSWORD=dbpass \
-e QUARKUS_MAILER_HOST=smtp.example.com \
Expand Down Expand Up @@ -192,7 +192,7 @@ docker build -f src/main/docker/Dockerfile.native -t orion-users:native .

```bash
docker run -i --rm -p 8080:8080 \
-e QUARKUS_DATASOURCE_REACTIVE_URL=mysql://host.docker.internal:3306/users \
-e QUARKUS_DATASOURCE_REACTIVE_URL=postgresql://host.docker.internal:5432/users \
-e QUARKUS_DATASOURCE_USERNAME=your-username \
-e QUARKUS_DATASOURCE_PASSWORD=your-password \
orion-users:native
Expand Down Expand Up @@ -227,16 +227,15 @@ version: '3.8'

services:
database:
image: mysql:8.0
image: postgres:16
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: users
MYSQL_USER: users
MYSQL_PASSWORD: userspassword
POSTGRES_DB: users
POSTGRES_USER: users
POSTGRES_PASSWORD: userspassword
ports:
- "3306:3306"
- "5432:5432"
volumes:
- mysql_data:/var/lib/mysql
- postgres_data:/var/lib/postgresql/data

users-service:
build:
Expand All @@ -245,14 +244,14 @@ services:
ports:
- "8080:8080"
environment:
QUARKUS_DATASOURCE_REACTIVE_URL: mysql://database:3306/users
QUARKUS_DATASOURCE_REACTIVE_URL: postgresql://users:userspassword@database:5432/users
QUARKUS_DATASOURCE_USERNAME: users
QUARKUS_DATASOURCE_PASSWORD: userspassword
depends_on:
- database

volumes:
mysql_data:
postgres_data:
```

Run with:
Expand Down
Loading
Loading