Sign inSign up

mecdcme/regedit-api-gateway

By mecdcme

•Updated about 5 years ago

Image
0

461

mecdcme/regedit-api-gateway repository overview

Build Status Docker hub Quality Gate Status

⁠RegEdit API Gateway Service (ZUUL+Eureka+JWT)

A EUREKA server that acts as a central authentication unit, ZUUL proxy server for redirection..

⁠What you’ll need

In order to build the application, your environment should fulfill the following requirements:

  • A favorite text editor or IDE;
  • JDK 11+;
  • Maven 3.0+;
  • Mysql Server 8.0+ or PostgreSQL 9.6+ ;

⁠How to build

Download and unzip the source code in your developing folder RegEditAPI_PATH.

Before building the application you must create and popolulate the RegEdit database.

You can create a MySQL database using the script regedit-api-gateway-create-mysql.sql stored in the RegEditAPI_PATH/db⁠ folder. Also you can create a PostgreSQL database using the script regedit-api-gateway-create-postgres.sql stored in the RegEditAPI_PATH/db⁠ folder.

Then yo can load the metadata and the test data, using the script regedit-api-gateway-init.sql stored in the RegEditAPI_PATH/db⁠ folder.

The script will populate the USER/ROLES tables with the user:

Username: [email protected]
Password: istat

As a first step, configure the database connection in the 'application.yml' file, located in the path [RegEditAPI_PATH]/src/main/resources:

Postgres connection

spring.datasource.url=jdbc:postgresql://localhost:5432/postgres?currentSchema=regedit_gateway&charset=UTF-8
spring.datasource.username=db_username
spring.datasource.password=db_password
spring.datasource.driverClassName=org.postgresql.Driver

MySQL connection

spring.datasource.url=jdbc:mysql://localhost:3306/regedit_gateway?useSSL=false&useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
spring.datasource.username=db_username
spring.datasource.password=db_password
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver

Now you can perform your first build of the application using Maven comand:

[RegEditAPI_PATH]> mvn package

If the build process ends successfully, you are ready to run the application: The application is built using the open source framework Spring Boot, which generates an executable jar (that can be run from the command line). Spring Boot creates a stand-alone Spring based Applications, with an embedded Tomcat, that you can "just run".

[RegEditAPI_PATH]> java –jar target/regedit-api-gateway.jar

or using Maven comand:

[RegEditAPI_PATH]> mvn spring-boot:run 

⁠Docker compose

You can run the RegEdit API Gateway as Docker containers using docker compose:

[RegEditAPI_PATH]> docker-compose up

⁠Test the application

You can test the application and explore the available services, linking to API documentation by Swagger tools:

http://localhost:8080/swagger-ui/index.html/⁠

and EUREKA services at:

http://localhost:8080/⁠

⁠License

RegEdit Service is EUPL-licensed

Tag summary

Content type

Image

Digest

Size

139.6 MB

Last updated

about 5 years ago

docker pull mecdcme/regedit-api-gateway