Skip to content

Commit

Permalink
Merge pull request #102 from JimTheCat/CU-8697bjvqr_EPIC---API-v5---i…
Browse files Browse the repository at this point in the history
…ntegration-with-OCI-Object-Storage_Kinga-Traczyk

feature: "Add gitignore and  .README OCI Object Storage information "
  • Loading branch information
KinTrae authored Jan 11, 2025
2 parents 3a24e1a + fab0f8f commit 8228b1f
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 10 deletions.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ Engineering Thesis
## Database
For production environment, you need to have an oracle database.
If you didn't create oracle database yet, run script `database/install.sql`.
(run the application to instatiate mock users via SecurityConfig)
For mock data, run script `database/scripts/510_insert_mock_data.sql` on your database - as it is not included in `install.sql` script.

(run the application to instantiate mock users via SecurityConfig)

## Profiles
`swagger` - to run application with Swagger
`dev` - to run application with H2 database (for offline development)
`mock-oci`- to run application with mock connection to oci object storage (for offline development)

## Swagger
To run swagger use `swagger` profile.
Expand All @@ -21,11 +20,22 @@ To develop application offline please use `dev` profile - it uses h2 database in
<img alt="img.png" height="300" src="img.png" width="500"/>
No other configurations are needed.

## Offline development with mock OCI
To develop application offline with mock connection to OCI object storage please use `mock-oci` profile.
With this profile, you can test file upload/download without connecting to OCI object storage - the method will return a mock url and save it to database.
Of course, it will not save the file to OCI object storage and the mock url will not work on frontend side.

## Environment variables
`DB_URL` - database url
`DB_USERNAME` - database username
`DB_PASSWORD` - database password
`JWT_SECRET` - secret key for JWT token
`JWT_EXPIRATION_MS` - expiration time for JWT token in milliseconds

With production environment, you need to set all of these variables.
With production environment, you need to set all of these variables.

## OCI object storage connection
To connect to OCI object storage you need to add `config` and `private-key` files to `resources` directory.
![img_1.png](img_1.png)
On creation of the API key in Oracle Cloud User Settings, you will get contents of the `config` and generate a `private-key`.
Of course, you need to have an account in Oracle Cloud and have created a bucket for object storage there first.
48 changes: 48 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/target/
!.mvn/wrapper/maven-wrapper.jar

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

### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar

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

### Some additional ignores (sort later)
*.DS_Store
*.sw?
.#*
*#
*~
bin
build
target
*.sublime-*
/scratch
.gradle
README.html
.exercism

### Oci Configuration
/src/main/resources/config
/src/main/resources/OCI_Object_Storage.pem
Empty file.
6 changes: 0 additions & 6 deletions backend/src/main/resources/config

This file was deleted.

Binary file added img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8228b1f

Please sign in to comment.