Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into feature/46-coordinator-first-phase-implement…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
MeloLawson authored Dec 18, 2023
2 parents 4be9023 + 624b8a7 commit a3d7998
Show file tree
Hide file tree
Showing 78 changed files with 3,495 additions and 10 deletions.
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/java:1-17-bookworm",

"features": {
"ghcr.io/devcontainers/features/java:1": {
"version": "none",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "cd Server && mvn compile"

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
28 changes: 28 additions & 0 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Server
on:
pull_request:
branches:
- main
paths:
- 'Server/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: Server
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Java 17 with Maven
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Build with Maven
run: ./mvnw compile -q
- name: Run tests with Maven
run: ./mvnw test -q
24 changes: 24 additions & 0 deletions .github/workflows/terminal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Terminal
on:
pull_request:
branches:
- main
paths:
- 'terminal/**'

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: terminal
steps:
- uses: actions/checkout@v2
- name: Setup Flutter
uses: subosito/flutter-action@v1
with:
flutter-version: '3.16.1'
- name: Analyze project
run: flutter analyze
- name: Run tests
run: flutter test
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,37 @@
Original repository: https://github.com/MelvinCou/cash-manager

## Initialization of the back project (CashManagerServer)

This part of the project is organized as modules, that can be launch independently

### Launch one module

- Go the folder Server with the command cd Server
- command mvn clean install => to load the dependencies and create the jar files that represents each module
- if the module contains a compose.yaml file, you will need to create at its root a .env.local file that follow this template :
1. Go the `Server` folder

```sh
cd Server
```

2. Load the dependencies and create the jar files that represents each module

POSTGRES_DB=*******
```sh
mvn clean install
```

POSTGRES_PASSWORD=******
3. if the module contains a compose.yaml file, copy the `.env.local.exemple` file to `.env.local` in the `Server` folder and fill it with the correct data. Also edit the file `src/resources/application.properties` of the module.

POSTGRES_USER=*******
```sh
cp .env.local.exemple .env.local
```

(don't forget to launch your docker engine if it's not already running)
> [!Note]
> Don't forget to launch your docker engine if it's not already running
- command mvn --projects com.cashmanager.server:[module] spring-boot:run => to run a particular module
4. Run a particular module

Be careful ! If you're not using the last command, but the running tool of your IDE, uncomment the second line in the application.properties of the corresponding module.
```sh
mvn --projects :[module] spring-boot:run
```

### Use of API_GATEWAY and EUREKA_SERVER and MEDIATOR
To manage the microservices of the application, you need to first launch the module eureka_server (see the command above).
Expand Down
8 changes: 8 additions & 0 deletions Server/.env.local.exemple
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Bank credentials
POSTGRES_DB=bank_db
POSTGRES_PASSWORD=bank_password
POSTGRES_USER=bank_user
# Shop credentials
SHOP_DB=shop_db
SHOP_PASSWORD=shop_password
SHOP_USER=shop_user
13 changes: 13 additions & 0 deletions Server/.jpb/jpb-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DatabaseMigrationSettings" lastSelectedDirectory="bank/database/src/main/resources/db/migration" />
<component name="PersistenceUnitSettings">
<persistence-units>
<persistence-unit moduleName="database" name="Default">
<packages>
<package value="com.cashmanager.server.database" />
</packages>
</persistence-unit>
</persistence-units>
</component>
</project>
36 changes: 36 additions & 0 deletions Server/bank/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/


.env.local
Binary file added Server/bank/.mvn/wrapper/maven-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions Server/bank/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
33 changes: 33 additions & 0 deletions Server/bank/account/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/

### VS Code ###
.vscode/
Binary file not shown.
2 changes: 2 additions & 0 deletions Server/bank/account/.mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.5/apache-maven-3.9.5-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
12 changes: 12 additions & 0 deletions Server/bank/account/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
services:
postgres:
image: 'postgres:16.1-alpine'
volumes:
- 'db:/var/lib/postgres/data'
- '../../init-shop-db.sh:/docker-entrypoint-initdb.d/init-shop-db.sh'
env_file:
- ../../.env.local
ports:
- '5432:5432'
volumes:
db:
Loading

0 comments on commit a3d7998

Please sign in to comment.