generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 0
docs(#1163): add backend README with setup instructions #1179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Abradat
merged 6 commits into
main
from
doc/1163-document-backend-refactoring-and-new-architecture
Feb 10, 2026
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e68d965
docs: add backend README with setup instructions
Abradat e4dd457
docs: update backend/README.md
Abradat ab17d30
docs: update backend/README.md
Abradat b94b419
docs: update backend/README.md
Abradat 8e2bb0e
Merge branch 'main' into doc/1163-document-backend-refactoring-and-ne…
Abradat b3c7108
docs: add local PostgreSQL test data loading docs
Abradat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # Backend Service | ||
|
|
||
| This document provides instructions to run the backend service and configure it for different database environments (Oracle and PostgreSQL). | ||
|
|
||
| --- | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. **Java**: Ensure Java 17 is installed. | ||
| 2. **Maven**: Install Maven (or use the provided `mvnw` wrapper). | ||
| 3. **Databases**: | ||
| - Oracle Database (if using Oracle as the primary database). | ||
| - PostgreSQL Database (Required even when running Oracle as the primary as it is used to save user preferences.) | ||
| 4. **Environment Variables**: | ||
| - `PRIMARY_DB`: Specifies the primary database (`oracle` or `postgres`). | ||
| - `FLYWAY_ENVIRONMENT`: Specifies the Flyway migration environment (`dev`, `prod`). | ||
|
|
||
Abradat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| --- | ||
|
|
||
| ## Running the Backend | ||
|
|
||
| ### 1. Clone the Repository | ||
| ```bash | ||
| git clone <repository-url> | ||
| cd nr-silva/backend | ||
Abradat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ### 2. Set Environment Variables | ||
|
|
||
| #### Example for Oracle: | ||
| ```bash | ||
| export PRIMARY_DB=oracle | ||
| export FLYWAY_ENVIRONMENT=dev | ||
| ``` | ||
|
|
||
| #### Example for PostgreSQL: | ||
| ```bash | ||
| export PRIMARY_DB=postgres | ||
| export FLYWAY_ENVIRONMENT=dev | ||
| ``` | ||
|
|
||
| ### 3. Run the Application | ||
|
|
||
| Using Maven Wrapper: | ||
| ```bash | ||
| ./mvnw spring-boot:run | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### 1. Database Configuration | ||
|
|
||
| The backend uses the `application.yml` file for database configuration. The `server.primary-db` property determines the primary database. | ||
|
|
||
| ```yaml | ||
| server: | ||
| primary-db: ${PRIMARY_DB:oracle} | ||
| ``` | ||
|
|
||
| ### 2. Flyway Migrations | ||
|
|
||
| Flyway migrations are environment-specific and determined by the `FLYWAY_ENVIRONMENT` variable. | ||
|
|
||
| - **Development Migrations**: Located in `src/main/resources/db/migration-dev/`. | ||
| - **Production Migrations**: Located in `src/main/resources/db/migration/`. | ||
Abradat marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## Testing | ||
|
|
||
| ### Run Tests for Oracle: | ||
| ```bash | ||
| ./mvnw clean install -Dflyway-environment=dev -Dserver.primary-db=oracle | ||
| ``` | ||
|
|
||
| ### Run Tests for PostgreSQL: | ||
| ```bash | ||
| ./mvnw clean install -Dflyway-environment=dev -Dserver.primary-db=postgres | ||
| ``` | ||
Abradat marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| --- | ||
|
|
||
| ## Notes | ||
|
|
||
| - Ensure the database is running and accessible before starting the backend. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.