Uweheuerbackend: Difference between revisions
| Line 19: | Line 19: | ||
* http://192.168.178.72:8080/admin/import | * http://192.168.178.72:8080/admin/import | ||
* PHPMyAdmin http://192.168.178.72:8081/ | * PHPMyAdmin http://192.168.178.72:8081/ | ||
* Frontend http://192.168.178.72/ | |||
===By Windows Powershell=== | ===By Windows Powershell=== | ||
Revision as of 18:23, 5 February 2023
Architecture and Implementation
Environment Variables
- see
C:\Uwes\owncloud\documents\Software_Development\MyDevelopments\uweheuer.drawiosheet 'Backend Environment Variables'
APIs
Local Dev
- http://localhost:8080/menus/
- http://localhost:8080/actuator/health
- http://localhost:8080/actuator/env
- http://localhost:8080/actuator/info
- http://localhost:8080/admin/import
Local Docker
Raspberry Docker
- http://192.168.178.72:8080/actuator/health
- http://192.168.178.72:8080/admin/import
- PHPMyAdmin http://192.168.178.72:8081/
- Frontend http://192.168.178.72/
By Windows Powershell
curl.exe -X POST localhost:8080/menus -H “Content-type:application/json” -d '{ \"name\": \"test by curl\" }'
Installation
Raspberry
- Git installation
- Maven installation
- Java installation
- Login via gh auth login
- Clone repositories
uwe@raspberrypi4:~/SoftwareProjects/eclipse-workspace $ git clone https://github.com/UweHeuer/uweheuer-backend.git uwe@raspberrypi4:~/SoftwareProjects/eclipse-workspace $ gh repo clone UweHeuer/uweheuer-frontend
Build
- build by Maven
- setup on computer see here
- steering of target environments by profiles in
pom.xml:- local_dev (default)
- heroku
Development Laptop
- jar-file
mvn -DskipTests package
Raspberry
- get updates from repository
uwe@raspberrypi4:~/SoftwareProjects/eclipse-workspace/uweheuer-backend $ git pull
- jar-file
uwe@raspberrypi4:~/SoftwareProjects/eclipse-workspace/uweheuer-backend $ mvn -DskipTests package
Docker
- build image
<PROJECT_PATH> docker build --tag uweheuerbackend .
Run
Local from Command Line
C:\Uwes\SoftwareProjects\eclipse-workspace\uweheuer-backend>mvn spring-boot:run -Dspring-boot.run.arguments="--spring.datasource.password=mHalloo0@1m --spring.datasource.username=root --uweheuer.bookmarks.import.dbuser=root --uweheuer.bookmarks.import.dbpwd=mHalloo0@1m --uweheuer.bookmarks.parole=jakobthimo123456"
Local from Eclipse
Docker Compose
- run all containers
docker compose --env-file .compose.env up -d // using an local env file, run in background
- stop all containers
docker compose --env-file .compose.env down
Implementation
Spring Boot Standard Diagnosis Actuator
- adding Spring Boot Actuator by adding to pom.xml:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>
- adding to application.properties all endpoints
management.endpoints.web.exposure.include=*