Skip to content

Commit

Permalink
Merge pull request #317 from adorsys/datasafe_frontend_update
Browse files Browse the repository at this point in the history
frontend update
  • Loading branch information
AssahBismarkabah committed Apr 22, 2024
2 parents 2d0cfcb + e2aac16 commit 2de02a8
Show file tree
Hide file tree
Showing 36 changed files with 1,511 additions and 1,017 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ hs_err_pid*
# node.js / frontend
node_modules/
dist/
cache/

/frontend/datasafe-ui/package-lock.json
/datasafe-rest-impl/ROOT_BUCKET/
5 changes: 5 additions & 0 deletions datasafe-encryption/datasafe-encryption-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,24 +98,29 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<!-- Avoiding declaring that in parent POM due to issues with Spring -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion datasafe-rest-impl/1.createDockerimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ npm install
ng build --deploy-url /static/ --base-href /static/
mv dist ../../datasafe-rest-impl/target/dist
cd ../../datasafe-rest-impl
docker build . -t datasafe-rest-test:latest --build-arg JAR_FILE=datasafe-rest-impl-*.jar
docker build . -t datasafe-rest-test:latest --build-arg JAR_FILE=datasafe-rest-impl.jar
26 changes: 24 additions & 2 deletions datasafe-rest-impl/DEMO.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,29 @@ To **run** demo:

## Building and running demo

### Building
### Run it with Docker Compose
The easiest way to run Datasafe Rest Application is using Docker Compose. By default, it works with filesystem with root
directory `datasafe-rest-impl/ROOT_BUCKET`.
Build it with:
``` bash
# build backend
mvn clean package

# build frontend
cd frontend/datasafe-ui
npm i
ng build --deploy-url /static/ --base-href /static/
mv dist ../../datasafe-rest-impl/target/dist

# build image and start datasafe in docker
docker compose up datasafe
```

Frontend is available at http://localhost:8080/static/index.html

### Alternatively you can use shell scripts to build and run datasafe with different types of storages

#### Building

- Build from sources

Expand All @@ -34,7 +56,7 @@ cd datasafe-rest-impl
docker pull adorsys/datasafe && docker tag adorsys/datasafe datasafe-rest-test:latest
```

### Running
#### Running

Run using local filesystem, all data will be stored in `target/ROOT_BUCKET` folder:
```bash
Expand Down
2 changes: 1 addition & 1 deletion datasafe-rest-impl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openjdk:8-jre-alpine
FROM ibm-semeru-runtimes:open-21-jre

ARG JAR_FILE
ENV JAR_FILE ${JAR_FILE}
Expand Down
31 changes: 31 additions & 0 deletions datasafe-rest-impl/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
datasafe:
build:
args:
JAR_FILE: "datasafe-rest-impl.jar"
# image: adorsys/datasafe
environment:
EXPOSE_API_CREDS: true
DEFAULT_USER: username
DEFAULT_PASSWORD: password
USE_FILESYSTEM: file:///usr/app/ROOT_BUCKET
ports:
- 8080:8080
volumes:
- "./ROOT_BUCKET:/usr/app/ROOT_BUCKET"
db:
image: mysql:5.7
restart: always
environment:
MYSQL_DATABASE: 'test_db'
MYSQL_USER: 'test'
MYSQL_PASSWORD: 'test'
MYSQL_ROOT_PASSWORD: 'password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- my-db:/var/lib/mysql
volumes:
my-db:
40 changes: 0 additions & 40 deletions datasafe-rest-impl/datasafe-deployment.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions datasafe-rest-impl/datasafe-image.yaml

This file was deleted.

Loading

0 comments on commit 2de02a8

Please sign in to comment.