Skip to content

MichiBaum/Microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microservices

SonarCloud
Bugs Code Smells Coverage Duplicated Lines (%) Lines of Code Maintainability Rating Security Rating Technical Debt Vulnerabilities

Actions Badges:
Automatic Dependency Submission Build and Publish OSV-Scanner PR Scan SonarQube Analysis

This project is all about microservices. Frontend is currently build with Angular. There are microservices build with spring, spring cloud and so forth.

Alt

Modules

There are these microservices:

And these libraries:

And these databases:

  • Authentication DB
  • Usermanagement DB
  • Chess DB
  • Fitness DB

Actions

Labeler

There is a github action, witch sets automatic labels on Pull requests.

OSV Scanner

This scanner scans the dependencies and creates a vulnerability report.

Maven

Release plugin

The Maven Release Plugin automates the process of releasing project versions by updating version numbers and creating tags in the version control system. Use the command mvn release:update-versions to update the version information in your project's pom.xml files.

Docker

Container

Up

docker compose up -d

Down

docker compose down

Logs

# Follow
docker compose logs -f

# Single container 
docker compose logs ´name´

Stats

docker stats

Docker database backup

Replace 'PASSWORD' with password defined in .env.
Replace path '/data/db-backup' if different location is needed.

# Save sql file
docker exec microservices-chess-db-1 mysqldump -u root -pPASSWORD chess > someFilename.sql

# Save gzip
docker exec microservices-chess-db-1 mysqldump -u root -pPASSWORD chess | gzip -c > /data/db-backup/chess_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz

# All databases, replace password and save path
docker exec microservices-chess-db-1 mysqldump -u root -pPASSWORD chess | gzip -c > /data/db-backup/chess_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-music-db-1 mysqldump -u root -pPASSWORD music | gzip -c > /data/db-backup/music_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-fitness-db-1 mysqldump -u root -pPASSWORD fitness | gzip -c > /data/db-backup/fitness_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-usermanagement-db-1 mysqldump -u root -pPASSWORD usermanagement | gzip -c > /data/db-backup/usermanagement_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz
docker exec microservices-authentication-db-1 mysqldump -u root -pPASSWORD authentication | gzip -c > /data/db-backup/authentication_$(date -d "today" +"%Y-%m-%d_%H-%M").sql.gz

# Add to crontab (escape % with \%)
crontab -e

# List cronjobs
crontab -l

Change HOSTS file (for dev on local machine)

Remember to take Backup before editing your hosts file, mistakes there can block your internet access or cause other network-related issues.

Windows

In C:\Windows\System32\drivers\etc find file hosts and add those lines:

# Microservices
127.0.0.1 chess.michibaum.ch
127.0.0.1 gateway.michibaum.ch
127.0.0.1 registry.michibaum.ch
127.0.0.1 admin.michibaum.ch
127.0.0.1 usermanagement.michibaum.ch
127.0.0.1 authentication.michibaum.ch
127.0.0.1 fitness.michibaum.ch
127.0.0.1 music.michibaum.ch
127.0.0.1 michibaum.ch

Linux

File: /etc/hosts

Scan docker files

docker scan YourDockerHubUsername/DockerHubRepository:TagName --dependency-tree

Local dev db

docker run --name microservices -e MARIADB_ROOT_PASSWORD=someRootPass -p 3306:3306 -d mariadb:10.11

After that create the databases in the container.

create schema `authentication-db`;
create schema `chess-db`;
create schema `fitness-db`;
create schema `music-db`;
create schema `usermanagement-db`;

The tables are created trough flyway.

License

GitHub license

Collaborators

MichiBaum
Michael Baumberger

Contributors

severinnauer
Severin
MichiBaum
Michael Baumberger

Sponsors