Skip to content

Commit

Permalink
Changed Spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
SWAGATSWAROOP committed Jun 19, 2024
1 parent b5444d8 commit 46a93a7
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 43 deletions.
97 changes: 54 additions & 43 deletions frontend-next/app/Components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,143 +11,154 @@ export default function Nav() {
<>
<HomeNavbar />
<div className="flex flex-col text-black">
<div className="flex min-h-screen items-center bg-sky-100 border-2 border-[#fe8d88]">
<div className="flex min-h-screen items-center border-2 border-[#fe8d88] bg-sky-100">
<div className="flex flex-col items-center md:flex-row lg:mt-5">
<section className="flex-1 md:mr-10 lg:mr-20 md:ml-10 lg:ml-20">
<section className="flex-1 md:ml-10 md:mr-10 lg:ml-20 lg:mr-20">
<div className="flex flex-col justify-center gap-6 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-900 to-indigo-900 px-6 py-10 md:px-10">
<p className="text-center text-5xl font-serif font-bold text-white md:text-6xl md:leading-tight">
<p className="text-center font-serif text-5xl font-bold text-white md:text-6xl md:leading-tight">
Analyze your portfolio
</p>
<p className="text-center text-2xl font-semibold font-serif text-white md:text-4xl md:leading-relaxed">
<p className="text-center font-serif text-2xl font-semibold text-white md:text-4xl md:leading-relaxed">
AI driven insights that help users anticipate market trends
</p>
<Link
href="/trade"
className="inline-flex items-center justify-center gap-3 rounded-full font-serif bg-green-500 px-6 py-3 text-lg font-semibold text-white transition-all duration-300 hover:bg-green-600 hover:shadow-lg hover:text-black md:text-xl"
className="inline-flex items-center justify-center gap-3 rounded-full bg-green-500 px-6 py-3 font-serif text-lg font-semibold text-white transition-all duration-300 hover:bg-green-600 hover:text-black hover:shadow-lg md:text-xl"
>
<span>Get Started</span>
<ArrowBigRightIcon className="w-6 h-6" />
<ArrowBigRightIcon className="h-6 w-6" />
</Link>
</div>
</section>

<div className="flex justify-center md:w-1/3 md:justify-end">
<div className="m-5 md:m-10 lg:m-10">
<Image src="/portfolioanalyze.png" alt="Portfolio Analyze" width={620} height={640} />
<Image
src="/portfolioanalyze.png"
alt="Portfolio Analyze"
width={620}
height={640}
/>
</div>
</div>
</div>
</div>


<div className="flex min-h-screen items-center bg-indigo-400">
<div className="flex flex-col items-center md:flex-row-reverse lg:mt-5">
<section className="flex-1 md:mr-10 lg:mr-20">
<div className="flex flex-col justify-center gap-6 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-900 to-indigo-900 px-6 py-10 md:px-10">
<p className="text-center text-5xl font-serif font-bold text-white md:text-6xl md:leading-tight">
<p className="text-center font-serif text-5xl font-bold text-white md:text-6xl md:leading-tight">
Price Prediction
</p>
<p className="text-center text-2xl font-semibold font-serif text-white md:text-4xl md:leading-relaxed">
Predict future crypto prices using advanced machine learning techniques
<p className="text-center font-serif text-2xl font-semibold text-white md:text-4xl md:leading-relaxed">
Predict future crypto prices using advanced machine learning
techniques
</p>
<Link
href="/trade"
className="inline-flex items-center justify-center gap-3 rounded-full font-serif bg-yellow-500 px-6 py-3 text-lg font-semibold text-white transition-all duration-300 hover:bg-yellow-400 hover:shadow-lg hover:text-black md:text-xl"
className="inline-flex items-center justify-center gap-3 rounded-full bg-yellow-500 px-6 py-3 font-serif text-lg font-semibold text-white transition-all duration-300 hover:bg-yellow-400 hover:text-black hover:shadow-lg md:text-xl"
>
<span>See Pridictions</span>
<ArrowBigRightIcon className="w-6 h-6" />
<span>See Predictions</span>
<ArrowBigRightIcon className="h-6 w-6" />
</Link>
</div>
</section>
<div className="flex justify-center md:w-1/3 md:justify-start">
<div className="md:m-5">
<Image src="/pricepredict.png" alt="Price Prediction" width={620} height={640} />
<Image
src="/pricepredict.png"
alt="Price Prediction"
width={620}
height={640}
/>
</div>
</div>
</div>
</div>
<div className="flex min-h-screen items-center justify-center bg-violet-200 border-2 border-[#e67b76]">
<div className="flex min-h-screen items-center justify-center border-2 border-[#e67b76] bg-violet-200">
<div className="flex flex-col items-center md:flex-row lg:mt-5">
<section className="flex-1 md:mr-10 lg:mr-20 md:ml-10 lg:ml-20">
<section className="flex-1 md:ml-10 md:mr-10 lg:ml-20 lg:mr-20">
<div className="flex flex-col justify-center gap-6 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-900 to-indigo-900 px-6 py-10 md:px-10">
<p className="text-center text-5xl font-serif font-bold text-white md:text-6xl md:leading-tight">
<p className="text-center font-serif text-5xl font-bold text-white md:text-6xl md:leading-tight">
Market Analysis
</p>
<p className="text-center text-2xl font-semibold font-serif text-white md:text-4xl md:leading-relaxed">
<p className="text-center font-serif text-2xl font-semibold text-white md:text-4xl md:leading-relaxed">
View real-time cryptocurrency data & trends
</p>
<Link
href="https://crypto-sand-ten.vercel.app/"
className="inline-flex items-center justify-center gap-3 rounded-full bg-green-500 px-6 py-3 font-serif text-lg font-semibold text-white transition-all duration-300 hover:bg-green-600 hover:shadow-lg hover:text-black md:text-xl"
className="inline-flex items-center justify-center gap-3 rounded-full bg-green-500 px-6 py-3 font-serif text-lg font-semibold text-white transition-all duration-300 hover:bg-green-600 hover:text-black hover:shadow-lg md:text-xl"
>
<span>Real Time crypto Updates</span>
<ArrowBigRightIcon className="w-6 h-6" />
<ArrowBigRightIcon className="h-6 w-6" />
</Link>
</div>
</section>
<div className="flex justify-center md:w-1/3 md:justify-end">
<div className="m-5 md:m-10 lg:m-10">
<Image src="/marketanalysis.png" alt="Market Analysis" width={620} height={640} />
<Image
src="/marketanalysis.png"
alt="Market Analysis"
width={620}
height={640}
/>
</div>
</div>
</div>
</div>



<div className="flex min-h-screen items-center bg-sky-100">
<div className="flex flex-col items-center md:flex-row-reverse lg:mt-5 lg:mx-auto">
<section className="flex-1 md:mr-10 lg:mr-20 md:ml-10 lg:ml-20">
<div className="flex flex-col items-center md:flex-row-reverse lg:mx-auto lg:mt-5">
<section className="flex-1 md:ml-10 md:mr-10 lg:ml-20 lg:mr-20">
<div className="flex flex-col justify-center gap-6 rounded-lg bg-gradient-to-r from-indigo-600 via-purple-900 to-indigo-900 px-6 py-10 md:px-10">
<p className="text-center text-5xl font-serif font-bold text-white md:text-6xl md:leading-tight">
<p className="text-center font-serif text-5xl font-bold text-white md:text-6xl md:leading-tight">
Secure Transactions
</p>
<p className="text-center text-2xl font-semibold font-serif text-white md:text-4xl md:leading-relaxed">
<p className="text-center font-serif text-2xl font-semibold text-white md:text-4xl md:leading-relaxed">
Blockchain integration for decentralized storage
</p>
<Link
href="/trade"
className="inline-flex items-center justify-center gap-3 rounded-full font-serif bg-yellow-500 px-6 py-3 text-lg font-semibold text-white transition-all duration-300 hover:bg-yellow-400 hover:shadow-lg hover:text-black md:text-xl w-auto"
className="inline-flex w-auto items-center justify-center gap-3 rounded-full bg-yellow-500 px-6 py-3 font-serif text-lg font-semibold text-white transition-all duration-300 hover:bg-yellow-400 hover:text-black hover:shadow-lg md:text-xl"
>
<span>Let&apos;s Go</span>
<ArrowBigRightIcon className="w-6 h-6" />
<ArrowBigRightIcon className="h-6 w-6" />
</Link>

</div>
</section>
<div className="flex justify-center md:w-1/3 md:justify-start">
<div className="m-5 md:m-10 lg:m-10">
<Image src="/blockchain.png" alt="Secure Transactions" width={620} height={640} />
<Image
src="/blockchain.png"
alt="Secure Transactions"
width={620}
height={640}
/>
</div>
</div>
</div>
</div>

</div>



<div className="flex flex-col justify-center items-center my-20">
<div className="my-20 flex flex-col items-center justify-center">
<div className="text-center">
<div className="text-white text-[50px] font-pacifico pb-5">
<div className="pb-5 font-pacifico text-[50px] text-white">
Then what are you waiting for
</div>
<div className="text-white text-3xl font-anton tracking-2xl pb-10">
<div className="tracking-2xl pb-10 font-anton text-3xl text-white">
Start Trading with CRYPTOxAI
</div>
<Link
href="/signup"
className="inline-flex items-center justify-center gap-3 rounded-full bg-yellow-500 px-6 py-3 text-lg font-semibold text-white transition-all duration-300 hover:bg-yellow-400 hover:shadow-lg hover:text-black md:text-xl"
className="inline-flex items-center justify-center gap-3 rounded-full bg-yellow-500 px-6 py-3 text-lg font-semibold text-white transition-all duration-300 hover:bg-yellow-400 hover:text-black hover:shadow-lg md:text-xl"
>
<span>Let&apos;s Go</span>
<ArrowBigRightIcon className="w-6 h-6" />
<ArrowBigRightIcon className="h-6 w-6" />
</Link>
</div>
</div>




<footer className="mt-4 bg-gradient-to-r from-indigo-900 from-30% to-purple-900 py-8 pb-4 text-white">
<div className="px- container mx-auto grid grid-cols-1 gap-8 md:grid-cols-3">
<div>
Expand Down
65 changes: 65 additions & 0 deletions frontend-next/app/api/buysell/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { NextRequest } from "next/server";
import prisma from "@/db";
import { hash } from "bcrypt";
import * as z from "zod";
import { contract } from "@/lib/constant";

interface BodyType {
Name: string;
username: string;
password: string;
}

const UserSchema = z.object({
Name: z.string().min(1, "Required"),
username: z
.string()
.min(1, {
message: "email is Required",
})
.email("Invalid email"),
password: z
.string()
.min(8, { message: "password must contain atleat 8 character" }),
});

export async function POST(req: NextRequest) {
try {
const body = await req.json();
const { Name, username, password }: BodyType = UserSchema.parse(body);

const existingUser = await prisma.user.findUnique({
where: {
username: username,
},
});

if (existingUser) {
return Response.json({ error: "User already exists" }, { status: 400 });
}

const hashedPassword = await hash(password, 10);

const newUser = await prisma.user.create({
data: {
Name,
username,
password: hashedPassword,
},
});

const createUser = await contract.createUser(Name, username);
await createUser.wait();
return Response.json({
user: newUser,
message: "Signed up Successfully",
status: 201,
});
} catch (error) {
console.error("Error occurred while creating user:", error);
return Response.json(
{ error: "An error occurred while creating user" },
{ status: 500 },
);
}
}

0 comments on commit 46a93a7

Please sign in to comment.