-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from ducheharsh/harsh/backend
dockerizing user-app
- Loading branch information
Showing
7 changed files
with
79 additions
and
73 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,47 +1,57 @@ | ||
"use client" | ||
"use client"; | ||
|
||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card" | ||
import { Button } from "@repo/ui/button" | ||
import { Input } from "./ui/input" | ||
import { Select } from "./ui/select" | ||
import { useState } from "react" | ||
import { CreateP2PTransaction } from "../app/lib/actions/P2pTxnsAction" | ||
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card"; | ||
import { Button } from "@repo/ui/button"; | ||
import { Input } from "./ui/input"; | ||
import { useState } from "react"; | ||
import { CreateP2PTransaction } from "../app/lib/actions/P2pTxnsAction"; | ||
|
||
export default function P2pTransfer() { | ||
const [amount, setAmount] = useState(0) | ||
const [peerPhn, setPeerPhn] = useState("") | ||
return( <Card className='mt-6 w-[30vw] h-fit'> | ||
<CardHeader> | ||
const [amount, setAmount] = useState(0); | ||
const [peerPhn, setPeerPhn] = useState(""); | ||
return ( | ||
<Card className="mt-6 w-[30vw] h-fit"> | ||
<CardHeader> | ||
<CardTitle>Send amount</CardTitle> | ||
</CardHeader> | ||
<CardContent> | ||
|
||
<div className='flex flex-col ' > | ||
<h1>Phone No.</h1> | ||
<Input type='number' onChange={(e)=>{ | ||
setPeerPhn(e.target.value) | ||
}} placeholder='Peers phone no. ' /> | ||
<div className="mt-3"> | ||
<h1 >Amount</h1> | ||
<Input type='number' onChange={(e)=>{ | ||
setAmount(Number(e.target.value)) | ||
}} placeholder='Enter Amount' /> | ||
</div> | ||
<CardContent> | ||
<div className="flex flex-col "> | ||
<h1>Phone No.</h1> | ||
<Input | ||
type="number" | ||
onChange={(e) => { | ||
setPeerPhn(e.target.value); | ||
}} | ||
placeholder="Peers phone no. " | ||
/> | ||
<div className="mt-3"> | ||
<h1>Amount</h1> | ||
<Input | ||
type="number" | ||
onChange={(e) => { | ||
setAmount(Number(e.target.value)); | ||
}} | ||
placeholder="Enter Amount" | ||
/> | ||
</div> | ||
</div> | ||
|
||
<div className='flex flex-col mt-6' > | ||
|
||
<div className="mt-6"> | ||
<Button onClick={async()=>{ | ||
const sendMoney = await CreateP2PTransaction({amount, peerPhone:peerPhn}) | ||
alert(sendMoney?.message) | ||
}}> | ||
Send Money | ||
</Button> | ||
<div className="flex flex-col mt-6"> | ||
<div className="mt-6"> | ||
<Button | ||
onClick={async () => { | ||
const sendMoney = await CreateP2PTransaction({ | ||
amount, | ||
peerPhone: peerPhn, | ||
}); | ||
alert(sendMoney?.message); | ||
}} | ||
> | ||
Send Money | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
</CardContent> | ||
</CardContent> | ||
</Card> | ||
) | ||
} | ||
); | ||
} |
This file contains 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,18 @@ | ||
FROM node:20.12.0-alpine3.19 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package.json package-lock.json turbo.json tsconfig.json ./ | ||
|
||
COPY apps ./apps | ||
COPY packages ./packages | ||
|
||
# Install dependencies | ||
RUN npm install | ||
# Can you add a script to the global package.json that does this? | ||
RUN npm run db:generate | ||
|
||
# Can you filter the build down to just one app? | ||
RUN npm run build | ||
|
||
CMD ["npm", "run", "start-user-app"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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