Skip to content

Commit f8ff3a1

Browse files
committed
Enhance financial services configuration and reorganize MERN stack
- Enhanced .env.example with comprehensive environment variables and echo output - Added Spring Boot datasource configuration (URL, username, password) - Moved .env.example to financial/ directory for centralized configuration - Created build_and_run_local.sh script for account service local development - Reorganized mongodb-mern-bank-account by moving all files into mern-stack/ subdirectory - Updated React frontend Accounts.js component - Modified AccountsWithdrawService.java for improved functionality - Improved project structure and development workflow
1 parent 7733cec commit f8ff3a1

File tree

18 files changed

+80
-28
lines changed

18 files changed

+80
-28
lines changed

financial/.env.example

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,45 @@
1-
# Oracle REST Data Services (ORDS) Base URL
2-
# Replace with your own ORDS endpoint
3-
REACT_APP_ORDS_BASE_URL=https://imydbpe-financialdb.adb.eu-frankfurt-1.oraclecloudapps.com/ords
1+
# Application Configuration
2+
export REACT_APP_BACKEND_URL=https://oracleai-financial.org/accounts
3+
export REACT_APP_MICROTX_TRANSFER_SERVICE_URL=https://oracleai-financial.org/accounts
4+
export REACT_APP_MICROTX_ACCOUNT_SERVICE_URL=https://oracleai-financial.org/accounts
5+
export REACT_APP_MERN_BACKEND_SERVICE_URL=https://oracleai-financial.org/accounts
6+
export REACT_APP_MERN_MONGODB_SERVICE_URL=https://oracleai-financial.org/accounts
7+
export REACT_APP_MERN_MONGODB_JSONDUALITY_ORACLE_SERVICE_URL=https://oracleai-financial.org/accounts
8+
export REACT_APP_MERN_SQL_ORACLE_SERVICE_URL=https://oracleai-financial.org/accounts
9+
export REACT_APP_JAVA_ACCOUNTDETAIL_SERVICE_URL=https://oracleai-financial.org/accounts
10+
export REACT_APP_GRAPH_LAUNDERING_SERVICE_URL=https://oracleai-financial.org/accounts
11+
export REACT_APP_TRUECACHE_STOCK_SERVICE_URL=https://oracleai-financial.org/accounts
12+
export REACT_APP_SHARDING_SPATIAL_CC_SERVICE_URL=https://oracleai-financial.org/accounts
13+
export REACT_APP_STOCK_SERVICE_URL=https://oracleai-financial.org/accounts
14+
export REACT_APP_KAFKA_TXEVENTQ_SERVICE_URL=https://oracleai-financial.org/accounts
15+
export REACT_APP_AIAGENT_VECTOR_ADVISOR_SERVICE_URL=https://oracleai-financial.org/accounts
16+
export REACT_APP_SPEECH_SELECTAI_QUERY_SERVICE_URL=https://oracleai-financial.org/accounts
17+
export REACT_APP_ORDS_BASE_URL=https://oracleai-financial.org/accounts
418

5-
# Other potential environment variables for the financial app
6-
# REACT_APP_MICROTX_ACCOUNT_SERVICE_URL=http://localhost:8080/api
7-
# REACT_APP_MICROTX_TRANSFER_SERVICE_URL=http://localhost:8081/api/transfer
19+
# Database Configuration for Spring Boot Services
20+
export SPRING_DATASOURCE_URL=jdbc:oracle:thin:@financialdb_high?TNS_ADMIN=/Users/pparkins/Downloads/Wallet_financialdb
21+
export SPRING_DATASOURCE_USERNAME=financial
22+
export SPRING_DATASOURCE_PASSWORD=Welcome12345
23+
24+
# Display all set environment variables
25+
echo "=== Environment Variables Set ==="
26+
echo "REACT_APP_BACKEND_URL: $REACT_APP_BACKEND_URL"
27+
echo "REACT_APP_MICROTX_TRANSFER_SERVICE_URL: $REACT_APP_MICROTX_TRANSFER_SERVICE_URL"
28+
echo "REACT_APP_MICROTX_ACCOUNT_SERVICE_URL: $REACT_APP_MICROTX_ACCOUNT_SERVICE_URL"
29+
echo "REACT_APP_MERN_BACKEND_SERVICE_URL: $REACT_APP_MERN_BACKEND_SERVICE_URL"
30+
echo "REACT_APP_MERN_MONGODB_SERVICE_URL: $REACT_APP_MERN_MONGODB_SERVICE_URL"
31+
echo "REACT_APP_MERN_MONGODB_JSONDUALITY_ORACLE_SERVICE_URL: $REACT_APP_MERN_MONGODB_JSONDUALITY_ORACLE_SERVICE_URL"
32+
echo "REACT_APP_MERN_SQL_ORACLE_SERVICE_URL: $REACT_APP_MERN_SQL_ORACLE_SERVICE_URL"
33+
echo "REACT_APP_JAVA_ACCOUNTDETAIL_SERVICE_URL: $REACT_APP_JAVA_ACCOUNTDETAIL_SERVICE_URL"
34+
echo "REACT_APP_GRAPH_LAUNDERING_SERVICE_URL: $REACT_APP_GRAPH_LAUNDERING_SERVICE_URL"
35+
echo "REACT_APP_TRUECACHE_STOCK_SERVICE_URL: $REACT_APP_TRUECACHE_STOCK_SERVICE_URL"
36+
echo "REACT_APP_SHARDING_SPATIAL_CC_SERVICE_URL: $REACT_APP_SHARDING_SPATIAL_CC_SERVICE_URL"
37+
echo "REACT_APP_STOCK_SERVICE_URL: $REACT_APP_STOCK_SERVICE_URL"
38+
echo "REACT_APP_KAFKA_TXEVENTQ_SERVICE_URL: $REACT_APP_KAFKA_TXEVENTQ_SERVICE_URL"
39+
echo "REACT_APP_AIAGENT_VECTOR_ADVISOR_SERVICE_URL: $REACT_APP_AIAGENT_VECTOR_ADVISOR_SERVICE_URL"
40+
echo "REACT_APP_SPEECH_SELECTAI_QUERY_SERVICE_URL: $REACT_APP_SPEECH_SELECTAI_QUERY_SERVICE_URL"
41+
echo "REACT_APP_ORDS_BASE_URL: $REACT_APP_ORDS_BASE_URL"
42+
echo "SPRING_DATASOURCE_URL: $SPRING_DATASOURCE_URL"
43+
echo "SPRING_DATASOURCE_USERNAME: $SPRING_DATASOURCE_USERNAME"
44+
echo "SPRING_DATASOURCE_PASSWORD: $SPRING_DATASOURCE_PASSWORD"
45+
echo "=== All environment variables have been set successfully! ==="
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/bash
2+
3+
echo "=== Building and Running Account Service Locally ==="
4+
5+
# Step 1: Source environment variables from financial/.env
6+
echo "1. Sourcing environment variables from ../../.env"
7+
if [ -f "../../.env" ]; then
8+
source ../../.env
9+
echo " Environment variables loaded successfully!"
10+
else
11+
echo " Warning: ../../.env file not found, using default configuration"
12+
fi
13+
14+
# Step 2: Clean and package with Maven
15+
echo ""
16+
echo "2. Building project with Maven..."
17+
mvn clean package -DskipTests
18+
19+
# Check if build was successful
20+
if [ $? -ne 0 ]; then
21+
echo " Build failed! Exiting..."
22+
exit 1
23+
fi
24+
25+
echo " Build completed successfully!"
26+
27+
# Step 3: Run the generated JAR
28+
echo ""
29+
echo "3. Starting Account Service..."
30+
echo " Running: java -jar target/account-1.0.0-SNAPSHOT.jar"
31+
echo ""
32+
33+
java -jar target/account-1.0.0-SNAPSHOT.jar

financial/microtx-saga-lockless-bank-transfer/account/src/main/java/oracle/examples/cloudbank/services/AccountsWithdrawService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public ResponseEntity<?> compensateWork(@RequestHeader(LRA_HTTP_CONTEXT_HEADER)
132132
// https://docs.oracle.com/en/database/oracle/transaction-manager-for-microservices/24.2/tmmma/com/oracle/microtx/lra/lockfree/MicroTxLockFreeReservation.html
133133
// https://docs.oracle.com/en/database/oracle/transaction-manager-for-microservices/24.4/tmmdg/verify.html
134134
// https://www.youtube.com/watch?v=mBijkqoAibE
135-
microTxLockFreeReservation.
135+
microTxLockFreeReservation.compensate(connection);
136136
} catch (Exception e) {
137137
log.warning("Failed to retrieve the underlying connection: " + e.getMessage());
138138
}
File renamed without changes.

0 commit comments

Comments
 (0)