Skip to content
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

Issue 44 resolved #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ lerna-debug.log*

node_modules
venv_bankapp
^
vatsalshah041 marked this conversation as resolved.
Show resolved Hide resolved
dist
dist-ssr
*.local
Expand Down
76 changes: 76 additions & 0 deletions scripts/setupScript.ps1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a part of #42 and someone else is working on it.

Original file line number Diff line number Diff line change
@@ -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!"
72 changes: 72 additions & 0 deletions scripts/testscript.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this script? It is the same as run_local.sh right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there are some changes in this so kept I this file

Original file line number Diff line number Diff line change
@@ -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!"
2 changes: 1 addition & 1 deletion ui/src/components/FormContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const FormContainer = ({ children, position }) => {
</>
) : (
<Row className="justify-content-md-center mt-5">
<Col md={6} className="card p-5">
<Col md={6} className="card " style={{padding:window.innerWidth>=570?"40px":"15px"}}>
{children}
</Col>
</Row>
Expand Down
14 changes: 11 additions & 3 deletions ui/src/components/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Hero = () => {
return (
<div className="py-5">
<Container className="d-flex justify-content-center">
<Card className="p-5 d-flex flex-column align-items-center hero-card w-75">
<Card className=" d-flex flex-column align-items-center hero-card " style={{width:window.innerWidth>=570?"75%":"100%",padding:window.innerWidth>=570?"5%":"6%"}}>
<h1 className="text-center mb-4">
<span style={{ fontSize: "4vh", fontWeight: "bold" }}>
Welcome to Martian Bank
Expand All @@ -29,17 +29,25 @@ const Hero = () => {
solutions, enjoy top-notch security measures, and fuel your Martian
ventures with our competitive loans and investment opportunities.
</p>
<div className="d-flex mt-4 mb-4">
<div className="d-flex flex-column flex-sm-row mt-4 mb-4">
<div style={{marginBottom:window.innerWidth>=570?"":"10px",marginLeft:window.innerWidth>=570?"":"14%"}}>
<LinkContainer to="/login">
<Button variant="dark" className="me-5 px-5 py-2">

<Button variant="dark" className="me-5 px-5 py-2" >
<span style={{ fontSize: "2vh" }}>Login</span>
</Button>

</LinkContainer>
</div>
<div style={{marginTop:window.innerWidth>=570?"":"10px",marginLeft:window.innerWidth>=570?"":"12%"}}>
<LinkContainer to="/register">

<Button variant="dark" className="me-5 px-5 py-2">
<span style={{ fontSize: "2vh" }}>Signup</span>
</Button>

</LinkContainer>
</div>
</div>
<div className="d-flex justify-content-around mt-5">
<Row>
Expand Down
8 changes: 4 additions & 4 deletions ui/src/screens/AccInfoScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ const AccInfoScreen = () => {
};

return (
<FormContainer>
<FormContainer style={{padding:window.innerWidth>=570?"1.5vh":"0.1vh"}}>
<h4
className="bg-light mx-3"
style={{
textAlign: "center",
paddingTop: "2vh",
paddingBottom: "2vh",
marginBottom: "3vh",
paddingTop: window.innerWidth>=570?"2vh":"0vh",
paddingBottom: window.innerWidth>=570?"2vh":"0.1vh",
marginBottom: window.innerWidth>=570?"3vh":"0.1vh",
}}
>
Account Information
Expand Down
10 changes: 5 additions & 5 deletions ui/src/screens/ApplyLoanScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,22 @@ const ApplyLoan = () => {
}, []);

return (
<FormContainer>
<FormContainer style={{padding:"0rem"}}>
<h4
className="bg-light mx-3"
style={{
textAlign: "center",
paddingTop: "2vh",
paddingBottom: "2vh",
paddingTop: window.innerWidth>=570?"2vh":"0vh",
paddingBottom:window.innerWidth>=570?"2vh":"0vh",
}}
>
Loan Application
</h4>
{isLoading ? (
<Loader />
) : (
<Form noValidate validated={validated} onSubmit={submitHandler}>
<Row className="mt-4">
<Form noValidate validated={validated} onSubmit={submitHandler} style={{padding:0}}>
<Row className="" style={{marginTop:window.innerWidth>=570?"4px":"0vh"}}>
<Col md={6}>
<Form.Group className="my-3" controlId="name">
<Form.Label>Name</Form.Label>
Expand Down
27 changes: 15 additions & 12 deletions ui/src/screens/AtmScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const AtmScreen = () => {
label="Open Now"
className="py-2 px-5"
name="optionGroup"
style={{color:"white"}}
checked={isOpenNow}
onChange={() => {
setIsOpenNow(true);
Expand All @@ -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);
Expand All @@ -177,9 +179,9 @@ const AtmScreen = () => {

{atmsList && atmsList.length > 0 ? (
<div className="mt-2">
<h5 className="mb-4">Showing results for {finalLocation}:</h5>
<h5 className="mb-4" style={{color:"white"}}>Showing results for {finalLocation}:</h5>
<Row>
<Col md={6}>
<Col md={6} xs={12}>
<div className="card-container">
{atmsList.map((atm, index) => (
<Card
Expand All @@ -191,8 +193,8 @@ const AtmScreen = () => {
bg={atm.isOpen ? "success" : "danger"}
style={{
position: "absolute",
top: "1rem",
right: "1rem",
top:window.innerWidth >= 570 ? "1rem":"3.7rem",
right: "0.5rem",
fontSize: "15px",
}}
>
Expand All @@ -201,9 +203,9 @@ const AtmScreen = () => {
<div className="flex-grow-1">
<Card.Body style={{ marginTop: "0" }}>
<Card.Title
style={{ fontSize: "2.5vh", marginTop: "0" }}
style={{ fontSize:window.innerWidth >= 570 ? "2.5vh":"2.2vh", marginTop: "0" }}
>
<span style={{ marginRight: "7px" }}>
<span style={{ marginRight: "5px" }}>
<img
src="./src/assets/coin-front.png"
alt="logo"
Expand All @@ -225,7 +227,7 @@ const AtmScreen = () => {
)}
</Card.Title>
<Card.Text
style={{ fontSize: "1.5vh", marginLeft: "52px" }}
style={{ fontSize: "1.5vh", marginLeft: window.innerWidth >= 570 ?"52px":"30px" }}
>
{atm.address.street +
", " +
Expand Down Expand Up @@ -272,25 +274,26 @@ const AtmScreen = () => {
</div>
</Col>
{isInterPlanetary ? (
<Col md={6}>
<div className="map-container">
<Col md={6} xs={12} >
<div className="map-container" >
<img
src={mapImg}
// src="https://via.placeholder.com/400x400"
alt="Map"
className="rounded"
style={{ height: "57vh", width: "67vh" }}
style={{ height: window.innerWidth >= 570 ?"100%":"100%", width: window.innerWidth >= 570 ?"100%":"100%" }}
/>
</div>
</Col>
) : (
<Col md={6}>
<div className="map-container">
<Col md={6} xs={12} >
<div className="map-container" style={{width:"100%"}}>
<MapContainer
center={[37.77175, -81.1901]}
zoom={15}
scrollWheelZoom={false}
className="rounded"
style={{width:window.innerWidth >= 570 ?"100%":"100%"}}
>
<TileLayer url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png" />
{atmsList.map((atm, index) => (
Expand Down
10 changes: 8 additions & 2 deletions ui/src/screens/LoanScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions ui/src/screens/LoginScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ const LoginScreen = () => {
return (
<Container>
<Row className="bg-white rounded" style={{ marginTop: "5vh" }}>
<Col md={5} className="rounded p-5" style={{ margin: "2vh" }}>
<Col md={5} xs={12}className="rounded p-5" style={{ margin: window.innerWidth >= 570 ? '2vh' : '0vh' }}>
<Row>
<Col md={12} className="rounded card border p-5">
<Col md={12} xs={12} className="rounded card border" style={{padding:window.innerWidth>=570?"3rem":"1rem"}}>
<h4
className="bg-light mx-3"
style={{
Expand Down Expand Up @@ -147,9 +147,9 @@ const LoginScreen = () => {
</Row>
</Col>

<Col md={6} className="rounded p-5" style={{ margin: "2vh" }}>
<Col md={6} className="rounded p-5" style={{ margin: window.innerWidth >= 570 ? '2vh' : '0vh' }}>
<Row>
<Col md={12} className="p-5">
<Col md={12} className="" style={{padding:window.innerWidth>=570?"3rem":"1rem"}}>
<h1 className="text-center">$100 bonus on us!</h1>
<p className="text-center">
Open an eligible account with qualifying electronic deposits and
Expand Down
Loading