successfully configured nflow

This commit is contained in:
2025-09-10 21:07:53 +02:00
parent 285b03a724
commit eb27468ddb
7 changed files with 64 additions and 7 deletions

38
pom.xml
View File

@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>3.5.0</version> <version>3.3.2</version>
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>zw.qantra</groupId> <groupId>zw.qantra</groupId>
@@ -103,6 +103,11 @@
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>net.kaczmarzyk</groupId> <groupId>net.kaczmarzyk</groupId>
<artifactId>specification-arg-resolver</artifactId> <artifactId>specification-arg-resolver</artifactId>
@@ -133,6 +138,11 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId> <artifactId>spring-boot-starter-validation</artifactId>
</dependency> </dependency>
<dependency>
<groupId>io.nflow</groupId>
<artifactId>nflow-rest-api-spring-web</artifactId>
<version>10.0.1</version>
</dependency>
</dependencies> </dependencies>
@@ -143,6 +153,32 @@
<artifactId>spring-boot-maven-plugin</artifactId> <artifactId>spring-boot-maven-plugin</artifactId>
</plugin> </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>io.nflow</groupId>
<artifactId>nflow-explorer</artifactId>
<version>10.0.1</version>
<type>tar.gz</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.outputDirectory}/static/explorer</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin> <plugin>
<groupId>org.liquibase</groupId> <groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId> <artifactId>liquibase-maven-plugin</artifactId>

View File

@@ -1,12 +1,15 @@
package zw.qantra.tm; package zw.qantra.tm;
import io.nflow.rest.config.RestConfiguration;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import com.google.gson.Gson; import com.google.gson.Gson;
import org.springframework.context.annotation.Import;
@SpringBootApplication @SpringBootApplication
@Import(RestConfiguration.class)
public class TmApplication { public class TmApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@@ -29,6 +29,8 @@ public class SecurityConfig {
http http
.csrf(AbstractHttpConfigurer::disable) .csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(auth -> auth .authorizeHttpRequests(auth -> auth
.requestMatchers("/explorer/**").permitAll()
.requestMatchers("/nflow/**").permitAll()
.requestMatchers("/auth/**").permitAll() .requestMatchers("/auth/**").permitAll()
.requestMatchers("/public/**").permitAll() .requestMatchers("/public/**").permitAll()
.anyRequest().authenticated() .anyRequest().authenticated()

View File

@@ -14,6 +14,6 @@ import lombok.Setter;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class Setting extends BaseEntity { public class Setting extends BaseEntity {
private String name; private String settingName;
private String value; private String settingValue;
} }

View File

@@ -1,6 +1,6 @@
spring.application.name=tm spring.application.name=tm
debug=true debug=false
logging.level.root=INFO
logging.level.org.springframework.boot.autoconfigure=INFO logging.level.org.springframework.boot.autoconfigure=INFO
server.port=6950 server.port=6950
@@ -41,3 +41,5 @@ erpnext.income.account=5111 - Sales Income - QPAY
erpnext.cost.center=Main - QPAY erpnext.cost.center=Main - QPAY
erpnext.tax.account=VAT - QPAY erpnext.tax.account=VAT - QPAY
erpnext.tax.rate=15.0 erpnext.tax.rate=15.0
logging.level.root=WARN

View File

@@ -1,6 +1,6 @@
spring.application.name=tm spring.application.name=tm
debug=true debug=true
logging.level.root=INFO
logging.level.org.springframework.boot.autoconfigure=INFO logging.level.org.springframework.boot.autoconfigure=INFO
server.port=6950 server.port=6950
@@ -45,3 +45,5 @@ erpnext.tax.rate=15.0
# JWT Configuration # JWT Configuration
jwt.secret=your-super-secret-jwt-key-here-make-it-very-long-and-secure-in-production jwt.secret=your-super-secret-jwt-key-here-make-it-very-long-and-secure-in-production
jwt.expiration=86400000 jwt.expiration=86400000
logging.level.root=WARN

View File

@@ -0,0 +1,12 @@
var Config = new function() {
this.refreshSeconds = 60;
this.nflowEndpoints = [
{
id: 'localhost',
title: 'local nflow instance',
apiUrl: '/api/nflow/api',
docUrl: '/api/nflow/ui/doc/'
},
];
};