sisvietnamvn
This application was generated using JHipster 9.1.0, you can find documentation and help at https://www.jhipster.tech/documentation-archive/v9.1.0.
Project Structure
Node is required for generation and recommended for development. package.json is always generated for a better development experience with prettier, commit hooks, scripts and so on.
In the project root, JHipster generates configuration files for tools like git, prettier, eslint, husky, and others that are well known and you can find references in the web.
/src/* structure follows default Java structure.
.yo-rc.json- Yeoman configuration file JHipster configuration is stored in this file atgenerator-jhipsterkey. You may findgenerator-jhipster-*for specific blueprints configuration..yo-resolve(optional) - Yeoman conflict resolver Allows to use a specific action when conflicts are found skipping prompts for files that matches a pattern. Each line should match[pattern] [action]with pattern been a Minimatch pattern and action been one of skip (default if omitted) or force. Lines starting with#are considered comments and are ignored..jhipster/*.json- JHipster entity configuration files/src/main/docker- Docker configurations for the application and services that the application depends on
Database Configuration
Development Database (H2 Console)
- Profile:
dev - Database Type: H2 (File-based, embedded)
- JDBC URL:
jdbc:h2:file:./build/h2db/db/sisvietnamvn - Username:
sisvietnamvn - Password: (leave blank)
- Console Access: http://localhost:8080/h2-console (requires app running in dev profile)
- Config File: application-dev.yml
Production Database
- Profile:
prod - Database Type: Oracle Database
- JDBC URL:
jdbc:oracle:thin:@localhost:1521:xe - Username:
sisvietnamvn - Config File: application-prod.yml
Schema Management
- Tool: Liquibase
- Changelog Folder: src/main/resources/config/liquibase/
Development
To start your application in the dev profile, run:
./gradlew
For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][].
Building for production
Packaging as jar
To build the final jar and optimize the sisvietnamvn application for production, run:
./gradlew -Pprod clean bootJar
To ensure everything worked, run:
java -jar build/libs/*.jar
Refer to [Using JHipster in production][] for more details.
Packaging as war
To package your application as a war in order to deploy it to an application server, run:
./gradlew -Pprod -Pwar clean bootWar
JHipster Control Center
JHipster Control Center can help you manage and control your application(s). You can start a local control center server (accessible on http://localhost:7419) with:
docker compose -f src/main/docker/jhipster-control-center.yml up
Testing
Spring Boot tests
To launch your application's tests, run:
./gradlew test integrationTest jacocoTestReport
Others
Code quality using Sonar
Sonar is used to analyse code quality. You can start a local Sonar server (accessible on http://localhost:9001) with:
docker compose -f src/main/docker/sonar.yml up -d
Note: we have turned off forced authentication redirect for UI in src/main/docker/sonar.yml for out of the box experience while trying out SonarQube, for real use cases turn it back on.
You can run a Sonar analysis with using the sonar-scanner or by using the gradle plugin.
Then, run a Sonar analysis:
./gradlew -Pprod clean check jacocoTestReport sonarqube -Dsonar.login=admin -Dsonar.password=admin
Additionally, Instead of passing sonar.password and sonar.login as CLI arguments, these parameters can be configured from sonar-project.properties as shown below:
sonar.login=admin
sonar.password=admin
For more information, refer to the [Code quality page][].
Docker Compose support
JHipster generates a number of Docker Compose configuration files in the src/main/docker/ folder to launch required third party services.
For example, to start required services in Docker containers, run:
docker compose -f src/main/docker/services.yml up -d
To stop and remove the containers, run:
docker compose -f src/main/docker/services.yml down
Spring Docker Compose Integration is enabled by default. It's possible to disable it in application.yml:
spring:
...
docker:
compose:
enabled: false
You can also fully dockerize your application and all the services that it depends on. To achieve this, first build a Docker image of your app by running:
npm run java:docker
Or build an arm64 Docker image when using an arm64 processor OS, i.e., Apple Silicon chips (M*), running:
npm run java:docker:arm64
Then run:
docker compose -f src/main/docker/app.yml up -d
For more information refer to Docker and Docker-Compose, this page also contains information on the Docker Compose sub-generator (jhipster docker-compose), which is able to generate Docker configurations for one or several JHipster applications.
Continuous Integration (optional)
To configure CI for your project, run the ci-cd sub-generator (jhipster ci-cd), this will let you generate configuration files for a number of Continuous Integration systems. Consult the Setting up Continuous Integration page for more information.
References
- JHipster Homepage and latest documentation
- JHipster 9.1.0 archive
- Using JHipster in development
- Using Docker and Docker-Compose
- Using JHipster in production
- Running tests page
- Code quality page
- Setting up Continuous Integration
- Node.js
- NPM
Deployment Guide (Ubuntu server + aaPanel + Executable JAR)
1. Build the JAR file (on Windows)
Spring Boot applications come with a built-in web server, meaning you can package your entire application into a single executable .jar file!
Run the following command on your Windows PC to build the production-ready .jar file:
./gradlew -Pprod clean bootJar
Alternatively, you can use the built-in npm script:
npm run java:jar:prod
The generated .jar file will be located at build/libs/sisvietnamvn-1.0.3.jar.
2. Deploy and Run the application (on Ubuntu Server)
You have two main options to run the application on Ubuntu: using aaPanel or using standard systemd.
Option A: Using aaPanel (Recommended)
If you are using aaPanel, it is highly recommended to use its built-in Java Project manager to easily run the JAR file.
- Install Java 21: Make sure Java 21 is installed on your Ubuntu server via aaPanel.
- Upload the JAR: Upload the
sisvietnamvn-1.0.3.jarfile to a folder on your server (e.g.,/www/wwwroot/sisvietnam.vn/). - Add Java Project: In aaPanel, go to Website -> Java Project -> Add Java project.
- Configure Project:
- Project Type:
Spring_boot - Project jar: Select the
sisvietnamvn-1.0.3.jarfile you just uploaded. - Project Port:
8080(or whichever port your app is configured to use). - Run user:
www(orroot) - Click Submit. aaPanel will automatically run your JAR file in the background!
- Project Type:
Option B: Using systemd (Standard Ubuntu)
If you prefer managing the server manually via terminal, you can register the JAR as a systemd service so it runs continuously in the background and starts automatically on boot.
- Upload the JAR: Upload the
sisvietnamvn-1.0.3.jarfile to your server (e.g.,/var/www/sisvietnam/sisvietnamvn.jar). - Create the Service File:
sudo nano /etc/systemd/system/sisvietnam.service - Add Configuration: Paste the following, making sure the
ExecStartpath matches where you put the jar.[Unit] Description=SIS Vietnam Spring Boot Application After=syslog.target network.target [Service] User=root ExecStart=/usr/bin/java -jar /var/www/sisvietnam/sisvietnamvn.jar SuccessExitStatus=143 Restart=always RestartSec=10 [Install] WantedBy=multi-user.target - Start the Service: Run the following commands to reload systemd, enable the service to start on boot, and start it now:
sudo systemctl daemon-reload sudo systemctl enable sisvietnam.service sudo systemctl start sisvietnam.service - Check Status & Logs:
- To check if it's running:
sudo systemctl status sisvietnam.service - To view the live terminal output:
sudo journalctl -u sisvietnam.service -f
- To check if it's running:
3. Configure NGINX Reverse Proxy (aaPanel)
When you set up a Java Project in aaPanel, it can automatically map your domain and set up a reverse proxy. If you need to verify or set it up manually:
- Add Site: Go to aaPanel -> Website -> Add site. Enter your domain (e.g.,
sisvietnam.vn) and select Static for the PHP version. - Setup Reverse Proxy: Click "Settings" for the site -> "Reverse proxy" -> "Add reverse proxy".
- Proxy name:
JavaProxy - Target URL:
http://127.0.0.1:8080 - Sent Domain:
$host
- Proxy name:
- Spring Boot Proxy Trust: Ensure Spring Boot knows it is behind a proxy so it can read client IPs correctly. In
src/main/resources/config/application-prod.yml, verify this exists:server: forward-headers-strategy: framework - SSL: Use aaPanel's built-in SSL manager to apply Let's Encrypt certificates to your NGINX site. You don't need to configure SSL inside Spring Boot itself.
debug mode
.\gradlew.bat bootRun --debug-jvm
Troubleshooting: Oracle DB ORA-01017 during Development
If you encounter an ORA-01017: invalid credential or not authorized error when starting the application using bootRun, ensure the following steps have been taken:
1. Database & User Creation (Oracle 23ai Free)
You need to create a dedicated Pluggable Database (PDB) and a user inside the Oracle Docker container.
- Connect to your LXC container host (e.g.
192.168.1.15). - Open a
sqlplussession inside the Oracle container:docker exec -it sisvietnam-oracle-sisvietnam-oracle-1 sqlplus sys/Oracle123 as sysdba - Run the following SQL to create the PDB and User:
CREATE PLUGGABLE DATABASE sisvietnam ADMIN USER pdbadmin IDENTIFIED BY Oracle123 FILE_NAME_CONVERT = ('/opt/oracle/oradata/FREE/pdbseed/', '/opt/oracle/oradata/FREE/sisvietnam/'); ALTER PLUGGABLE DATABASE sisvietnam OPEN; ALTER PLUGGABLE DATABASE sisvietnam SAVE STATE; ALTER SESSION SET CONTAINER = sisvietnam; CREATE USER sisvietnam IDENTIFIED BY "sisvietnam"; GRANT DBA TO sisvietnam; GRANT ALL PRIVILEGES TO sisvietnam;
2. Configure Spring Boot
Update your application-dev.yml to point to the newly created sisvietnam PDB:
spring:
datasource:
url: jdbc:oracle:thin:@192.168.1.15:1521/sisvietnam
username: sisvietnam
password: "sisvietnam"
3. Check for Overriding Profiles (Important!)
By default, the JHipster setup might enable the secret-samples profile. This profile aggressively overrides the database username and blanks out the password. Check src/main/resources/config/application-secret-samples.yml. If you encounter an ORA-01017, ensure that the dev section in the secret-samples profile correctly mirrors your real credentials:
spring:
config:
activate:
on-profile: dev
datasource:
username: sisvietnam
password: sisvietnam
Admin Pages & Block Editor Management
We have implemented a WordPress-like static pages management feature at /manage/pages. This includes an interactive block-based editor powered by Editor.js.
1. How to Run and Access
- Start your Oracle database or ensure it is accessible.
- Run the application in development mode:
./gradlew bootRun - Open your browser and navigate to the Page Management dashboard: http://localhost:8080/manage/pages
- Navigate to the Posts Management dashboards:
- All Posts: http://localhost:8080/manage/posts
- Categories: http://localhost:8080/manage/categories
- Tags: http://localhost:8080/manage/tags
2. Form Fields & Features
When creating or editing a page (/manage/pages/new or /manage/pages/{id}/edit):
- Title: Name of the page (e.g.
About Us,Giới thiệu). - Slug: The URL path. If left blank, it is automatically generated from the Title, supporting clean Vietnamese character conversions (e.g.
Bệnh viện S.I.S Cần Thơ->benh-vien-s-i-s-can-tho). - Status: Status of the page (
DRAFT,PUBLISHED,ARCHIVED). - Display Order: Controls sorting of page links (lower numbers appear first).
- Meta Description: A short summary used for SEO metadata in
<meta name="description">. - Page Content (Block Editor): Interactive wysiwyg editor utilizing Editor.js.
3. Using the Block Editor
- Add a Block: Press
Enterto create a new paragraph, or click the+icon (or pressTabon an empty line) to pick a block type:- Heading: Formatted HTML headers (H2, H3, H4).
- List: Bulleted or numbered lists (supports nested lists via
Tab). - Quote: Stylized blockquotes with a caption field.
- Table: Simple tables with columns and rows.
- Code: Formatted code block.
- Warning: Notice or alert box with title & message.
- Delimiter: Horizontal dividers.
- Inline Styling: Highlight any text in a paragraph to apply Bold, Italic, Links, Underlines,
Inline Code, or Highlighter. - Reorder & Actions: Hover over any block and use the handle menu (
⋮⋮) to drag-and-drop, move up/down, convert to another block type, or delete.
4. How the Plugin System Works (Extensibility)
If you want to create new custom block types (e.g., custom slider, doctor list, video embed) in the future:
- Create your plugin script file inside
src/main/resources/static/js/manage/editor-plugins/(e.g.video-embed-plugin.js). - Implement your custom block class or wrap an existing Editor.js tool.
- Register your tool globally by adding it to
window.SISEditorPlugins:window.SISEditorPlugins = window.SISEditorPlugins || {}; window.SISEditorPlugins['videoEmbed'] = { class: VideoEmbedToolClass, inlineToolbar: true, config: { placeholder: 'Enter video URL...' } }; - In
src/main/resources/templates/manage/pages/form.html, load the script in the<section layout:fragment="scripts">tag before the main configuration script:<script th:src="@{/js/manage/editor-plugins/video-embed-plugin.js}"></script> - The initialization logic in editor-config.js will automatically scan
window.SISEditorPluginsand register them.