diff --git a/.gitignore b/.gitignore index 364ed84..290274a 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ lerna-debug.log* node_modules venv_bankapp +^ dist dist-ssr *.local diff --git a/scripts/setupScript.ps1 b/scripts/setupScript.ps1 new file mode 100644 index 0000000..b3565cf --- /dev/null +++ b/scripts/setupScript.ps1 @@ -0,0 +1,76 @@ +# PowerShell script equivalent to the provided Bash script + +# Setup + +Set-Location .. + +# Check for Dependencies +if (-not (Get-Command "node" -ErrorAction SilentlyContinue)) { + Write-Host "`n Node.js is not installed. Please install Node.js and npm." + exit 1 +} + +if (-not (Get-Command "python3" -ErrorAction SilentlyContinue)) { + Write-Host "`n Python 3 is not installed. Please install Python 3." + exit 1 +} + +# Running JavaScript microservices + +function Run-Javascript-Microservice { + param ( + [string]$service_name, + [string]$service_alias + ) + + $current_dir = Get-Location + + Write-Host "Running $service_name microservice..." + + Start-Process PowerShell -ArgumentList @" + Set-Location '$current_dir\$service_name' + npm install + npm run $service_alias +"@ + + Start-Sleep -Seconds 2 + + Write-Host "$service_name is running...`n" +} + +Run-Javascript-Microservice -service_name "ui" -service_alias "ui" +Run-Javascript-Microservice -service_name "customer-auth" -service_alias "auth" +Run-Javascript-Microservice -service_name "atm-locator" -service_alias "atm" + +# Running Python microservices + +function Run-Python-Microservice { + param ( + [string]$service_name, + [string]$service_alias + ) + + $current_dir = Get-Location + + Write-Host "Running $service_name microservice..." + + Start-Process PowerShell -ArgumentList @" + Set-Location '$current_dir\$service_name' + Remove-Item -Recurse venv_bankapp -ErrorAction SilentlyContinue + python -m venv venv_bankapp + .\venv_bankapp\Scripts\Activate + pip install -r requirements.txt + python '$service_alias.py' +"@ + + Start-Sleep -Seconds 2 + + Write-Host "$service_name is running...`n" +} + +Run-Python-Microservice -service_name "dashboard" -service_alias "dashboard" +Run-Python-Microservice -service_name "accounts" -service_alias "accounts" +Run-Python-Microservice -service_name "transactions" -service_alias "transaction" +Run-Python-Microservice -service_name "loan" -service_alias "loan" + +Write-Host "Setup completed successfully!" diff --git a/scripts/testscript.sh b/scripts/testscript.sh new file mode 100644 index 0000000..bed3c8b --- /dev/null +++ b/scripts/testscript.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +####################################################################################### +## Setup + +cd .. + +# Check for Dependencies +if ! command -v node &>/dev/null; then + echo "Node.js is not installed. Please install Node.js and npm." + exit 1 +fi + +# if ! command -v python3 &>/dev/null; then +# echo "Python 3 is not installed. Please install Python 3." +# exit 1 +# fi + +####################################################################################### +## Running Javascript microservices + +run_javascript_microservice() { + local service_name="$1" + local service_alias="$2" + local current_dir="$(pwd)" + + echo "Running $service_name microservice..." + + ( + cd "$current_dir/$service_name" && + start bash -c "npm install && npm run $service_alias" & + ) + sleep 2 + + echo "$service_name is running ..." + echo +} + +run_javascript_microservice "ui" "ui" +run_javascript_microservice "customer-auth" "auth" +run_javascript_microservice "atm-locator" "atm" + +####################################################################################### +# Running Python microservices + +# conda config --set auto_activate_base false &>/dev/null +# brew update &>/dev/null +# brew upgrade python3 &>/dev/null + +# run_python_microservice() { +# local service_name="$1" +# local service_alias="$2" +# local current_dir="$(pwd)" + +# echo "Running $service_name microservice ..." + +# ( +# cd "$current_dir/$service_name" && +# start bash -c "rm -rf venv_bankapp && python3 -m venv venv_bankapp && source venv_bankapp/bin/activate && pip3 install -r requirements.txt && python3 $service_alias.py" & +# ) +# sleep 2 + +# echo "$service_name is running ..." +# echo +# } + +# run_python_microservice "dashboard" "dashboard" +# run_python_microservice "accounts" "accounts" +# run_python_microservice "transactions" "transaction" +# run_python_microservice "loan" "loan" + +echo "Setup completed successfully!" \ No newline at end of file diff --git a/ui/src/components/FormContainer.jsx b/ui/src/components/FormContainer.jsx index d357009..adb7f66 100644 --- a/ui/src/components/FormContainer.jsx +++ b/ui/src/components/FormContainer.jsx @@ -47,7 +47,7 @@ const FormContainer = ({ children, position }) => { ) : ( - + =570?"40px":"15px"}}> {children} diff --git a/ui/src/components/Hero.jsx b/ui/src/components/Hero.jsx index 54dda89..1b9eb1e 100644 --- a/ui/src/components/Hero.jsx +++ b/ui/src/components/Hero.jsx @@ -17,7 +17,7 @@ const Hero = () => { return (
- + =570?"75%":"100%",padding:window.innerWidth>=570?"5%":"6%"}}>

Welcome to Martian Bank @@ -29,17 +29,25 @@ const Hero = () => { solutions, enjoy top-notch security measures, and fuel your Martian ventures with our competitive loans and investment opportunities.

-
+
+
=570?"":"10px",marginLeft:window.innerWidth>=570?"":"14%"}}> - + +
+
=570?"":"10px",marginLeft:window.innerWidth>=570?"":"12%"}}> + + +
diff --git a/ui/src/screens/AccInfoScreen.jsx b/ui/src/screens/AccInfoScreen.jsx index 0298d16..09c00ae 100644 --- a/ui/src/screens/AccInfoScreen.jsx +++ b/ui/src/screens/AccInfoScreen.jsx @@ -48,14 +48,14 @@ const AccInfoScreen = () => { }; return ( - + =570?"1.5vh":"0.1vh"}}>

=570?"2vh":"0vh", + paddingBottom: window.innerWidth>=570?"2vh":"0.1vh", + marginBottom: window.innerWidth>=570?"3vh":"0.1vh", }} > Account Information diff --git a/ui/src/screens/ApplyLoanScreen.jsx b/ui/src/screens/ApplyLoanScreen.jsx index 3b30c44..d3a55e9 100644 --- a/ui/src/screens/ApplyLoanScreen.jsx +++ b/ui/src/screens/ApplyLoanScreen.jsx @@ -169,13 +169,13 @@ const ApplyLoan = () => { }, []); return ( - +

=570?"2vh":"0vh", + paddingBottom:window.innerWidth>=570?"2vh":"0vh", }} > Loan Application @@ -183,8 +183,8 @@ const ApplyLoan = () => { {isLoading ? ( ) : ( -
- + + =570?"4px":"0vh"}}> Name diff --git a/ui/src/screens/AtmScreen.jsx b/ui/src/screens/AtmScreen.jsx index 45bf338..abaa73e 100644 --- a/ui/src/screens/AtmScreen.jsx +++ b/ui/src/screens/AtmScreen.jsx @@ -151,6 +151,7 @@ const AtmScreen = () => { label="Open Now" className="py-2 px-5" name="optionGroup" + style={{color:"white"}} checked={isOpenNow} onChange={() => { setIsOpenNow(true); @@ -163,6 +164,7 @@ const AtmScreen = () => { label="Inter planet ATMs" className="py-1 px-5" name="optionGroup" + style={{color:"white"}} checked={isInterPlanetary} onChange={() => { setIsInterPlanetary(true); @@ -177,9 +179,9 @@ const AtmScreen = () => { {atmsList && atmsList.length > 0 ? (
-
Showing results for {finalLocation}:
+
Showing results for {finalLocation}:
- +
{atmsList.map((atm, index) => ( { bg={atm.isOpen ? "success" : "danger"} style={{ position: "absolute", - top: "1rem", - right: "1rem", + top:window.innerWidth >= 570 ? "1rem":"3.7rem", + right: "0.5rem", fontSize: "15px", }} > @@ -201,9 +203,9 @@ const AtmScreen = () => {
= 570 ? "2.5vh":"2.2vh", marginTop: "0" }} > - + logo { )} = 570 ?"52px":"30px" }} > {atm.address.street + ", " + @@ -272,25 +274,26 @@ const AtmScreen = () => {
{isInterPlanetary ? ( - -
+ +
Map= 570 ?"100%":"100%", width: window.innerWidth >= 570 ?"100%":"100%" }} />
) : ( - -
+ +
= 570 ?"100%":"100%"}} > {atmsList.map((atm, index) => ( diff --git a/ui/src/screens/LoanScreen.jsx b/ui/src/screens/LoanScreen.jsx index a659904..267160c 100644 --- a/ui/src/screens/LoanScreen.jsx +++ b/ui/src/screens/LoanScreen.jsx @@ -119,8 +119,11 @@ const LoanScreen = () => { bg="success" style={{ position: "absolute", - top: "1rem", + top:window.innerWidth>=570?"1rem":"1.3rem" , right: "1rem", + width:window.innerWidth>=570?"60px":"60px", + height:window.innerWidth>=570?"15px":"15px", + fontSize:window.innerWidth>=570?"8px":"8px", }} > Eligible @@ -137,8 +140,11 @@ const LoanScreen = () => { bg="success" style={{ position: "absolute", - top: "1rem", + top:window.innerWidth>=570?"1rem":"1.3rem" , right: "1rem", + width:window.innerWidth>=570?"60px":"60px", + height:window.innerWidth>=570?"15px":"15px", + fontSize:window.innerWidth>=570?"8px":"8px", }} > Eligible diff --git a/ui/src/screens/LoginScreen.jsx b/ui/src/screens/LoginScreen.jsx index e6e062d..0130ce6 100644 --- a/ui/src/screens/LoginScreen.jsx +++ b/ui/src/screens/LoginScreen.jsx @@ -78,9 +78,9 @@ const LoginScreen = () => { return ( - + = 570 ? '2vh' : '0vh' }}> - + =570?"3rem":"1rem"}}>

{ - + = 570 ? '2vh' : '0vh' }}> - + =570?"3rem":"1rem"}}>

$100 bonus on us!

Open an eligible account with qualifying electronic deposits and diff --git a/ui/src/screens/NewAccScreen.jsx b/ui/src/screens/NewAccScreen.jsx index f066bcd..27c629f 100644 --- a/ui/src/screens/NewAccScreen.jsx +++ b/ui/src/screens/NewAccScreen.jsx @@ -104,9 +104,9 @@ const NewAccScreen = () => { {/* Left Column */} - + =570?"3rem":"2.5rem"}}> - + =570?"3rem":"0.5rem"}}>

{ {/* Right Column */} - + =570?"2vh":"0vh" ,padding:window.innerWidth>=570?"3rem":"0.0rem"}}> - + =570?"3rem":"0.5rem"}}>

$100 bonus on us!

Open an eligible account with qualifying electronic deposits diff --git a/ui/src/screens/ProfileScreen.jsx b/ui/src/screens/ProfileScreen.jsx index 19bdc92..d9e5b2c 100644 --- a/ui/src/screens/ProfileScreen.jsx +++ b/ui/src/screens/ProfileScreen.jsx @@ -72,13 +72,13 @@ const ProfileScreen = () => { } }; return ( - +

=570?"1.5vh":"0.1vh", + paddingBottom: window.innerWidth>=570?"1.5vh":"0.1vh", }} > UPDATE   DETAILS diff --git a/ui/src/screens/RegisterScreen.jsx b/ui/src/screens/RegisterScreen.jsx index 24f8743..52fa8ab 100644 --- a/ui/src/screens/RegisterScreen.jsx +++ b/ui/src/screens/RegisterScreen.jsx @@ -36,6 +36,7 @@ const RegisterScreen = () => { }, [navigate, userInfo]); const submitHandler = async (e) => { + console.log("helloo"); e.preventDefault(); if (password !== confirmPassword) { @@ -77,9 +78,9 @@ const RegisterScreen = () => { return ( - + = 570 ? '2vh' : '0vh' }}> - + =570?"3rem":"1rem"}}>

{ > - @@ -161,9 +162,9 @@ const RegisterScreen = () => { - + = 570 ? '2vh' : '0vh' }}> - + =570?"3rem":"1rem"}}>

$100 bonus on us!

Open an eligible account with qualifying electronic deposits and diff --git a/ui/src/slices/apiUrls.js b/ui/src/slices/apiUrls.js index 823a627..e635766 100644 --- a/ui/src/slices/apiUrls.js +++ b/ui/src/slices/apiUrls.js @@ -1,5 +1,5 @@ -const VITE_USERS_URL = 'http://localhost:8000/api/users/'; -const VITE_ATM_URL = 'http://localhost:8001/api/atm/'; +const VITE_USERS_URL = 'http://localhost:8001/api/users/'; +const VITE_ATM_URL = 'http://localhost:8002/api/atm/'; const VITE_ACCOUNTS_URL = 'http://127.0.0.1:5000/account/'; const VITE_TRANSFER_URL = 'http://127.0.0.1:5000/transaction/'; const VITE_LOAN_URL = 'http://127.0.0.1:5000/loan/'; diff --git a/ui/src/slices/authSlice.js b/ui/src/slices/authSlice.js index 7a3af31..0a18a93 100644 --- a/ui/src/slices/authSlice.js +++ b/ui/src/slices/authSlice.js @@ -20,6 +20,7 @@ const authSlice = createSlice({ setCredentials: (state, action) => { state.userInfo = action.payload; localStorage.setItem('userInfo', JSON.stringify(action.payload)); + console.log('setCredentials: ', action.payload); }, logout: (state) => { state.userInfo = null;