instruction
stringlengths
25
121
input
stringclasses
1 value
output
stringlengths
0
296k
Describe the contents of the file app/layout.tsx.
import './globals.css' import NextTopLoader from 'nextjs-toploader'; import { Providers } from './Providers'; export default function RootLayout({ children, }: { children: React.ReactNode }) { return ( <html lang="en"> <body> <NextTopLoader/> <Providers> {children} ...
Describe the contents of the file app/page.tsx.
"use client"; import { Button } from "@/components/ui/button"; import { ArrowRight, Bitcoin, Wallet, BarChart2, Lock, Zap, Globe, Menu, X, ChevronRight, } from "lucide-react"; import Link from "next/link"; import Image from "next/image"; import { useRouter } from "next/navigation"; import { motion,...
Describe the contents of the file app/favicon.ico.
<Error reading file: 'utf-8' codec can't decode byte 0x96 in position 18: invalid start byte>
Describe the folder app/auth/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/test/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(pages)/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/utils/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/api/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/auth/signin/.
This is a directory. It may contain files or subdirectories.
Describe the contents of the file app/auth/signin/page.tsx.
"use client"; import React, { useEffect } from 'react'; import { motion } from 'framer-motion'; import { signIn, useSession } from 'next-auth/react'; import { FcGoogle } from 'react-icons/fc'; import { Button } from "@/components/ui/button"; import { useRouter } from 'next/navigation'; export default function GoogleS...
Describe the contents of the file app/test/page.tsx.
'use client' export default function Home() { return ( <main className="flex min-h-screen flex-col items-center justify-between p-24"> <h1>Welcome to Your App</h1> </main> ) }
Describe the contents of the file app/(pages)/layout.tsx.
'use client' import { useEffect, useState } from 'react' import { Appbar } from '@/components/core/Appbar' import SideNavbar from '@/components/core/sideNavBar' import { Toast } from '@/components/ui/toast' export default function RootLayout({ children, }: { children: React.ReactNode }) { const [isOpen, setIsOp...
Describe the folder app/(pages)/orders/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(pages)/profile/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(pages)/markets/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(pages)/trades/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(pages)/trade/.
This is a directory. It may contain files or subdirectories.
Describe the contents of the file app/(pages)/orders/page.tsx.
'use client' import { useState, useEffect } from 'react' import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Badge } from "@/components/ui/badge" import { CheckCircle, XCircle, TrendingUp, TrendingDown, Package2, Clock } from 'lucide-react' import { Skeleton } from "@/components/ui...
Describe the contents of the file app/(pages)/profile/page.tsx.
import { getServerSession } from "next-auth/next" import { redirect } from "next/navigation" import { prisma } from "@/lib/prisma" import ProfileForm from "@/components/account/ProfilePage" export default async function ProfilePage() { const session = await getServerSession() if (!session || !session.user?.emai...
Describe the contents of the file app/(pages)/markets/page.tsx.
import CryptoList from "@/components/trade/markets/cryptoPage" export default function CryptoDashboard() { return ( <div className="relative flex h-screen overflow-hidden"> <main className="flex-1 overflow-hidden p-4 "> <CryptoList /> </main> </div> ) }
Describe the contents of the file app/(pages)/trades/page.tsx.
'use client' import { useState, useEffect, useCallback } from 'react' import { useSession } from 'next-auth/react' import axios from 'axios' import { useToast } from "@/components/ui/use-toast" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Table, TableBody, TableCell, TableHe...
Describe the folder app/(pages)/trade/[market]/.
This is a directory. It may contain files or subdirectories.
Describe the contents of the file app/(pages)/trade/[market]/page.tsx.
"use client"; import { useState, useEffect } from "react"; import useWebSocket from "react-use-websocket"; import { Card } from "@/components/ui/card"; import { Ask } from "@/components/trade/markets/AskTable"; import { Bid } from "@/components/trade/markets/BidTable"; import { useParams } from "next/navigation"; impo...
Describe the folder app/(server)/actions/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/.
This is a directory. It may contain files or subdirectories.
Describe the contents of the file app/(server)/actions/getBalance.ts.
'use server' import { authOptions } from "@/lib/auth"; import { prisma } from "@/lib/prisma"; import { getServerSession } from "next-auth"; export async function getBalance() { const session = await getServerSession(authOptions); if (!session?.user?.email) { return 0; } const user = await prisma.user.find...
Describe the contents of the file app/(server)/actions/changeUserProfile.ts.
'use server' import { prisma } from '@/lib/prisma' import { revalidatePath } from 'next/cache' export async function updateUserProfile(userId: string, formData: FormData) { const name = formData.get('name') as string const email = formData.get('email') as string const image = formData.get('image') as string ...
Describe the contents of the file app/(server)/api/route.ts.
import { NextResponse} from "next/server"; export async function GET(request: Request) { return NextResponse.json({ message: "Server is Running", }); }
Describe the folder app/(server)/api/orders/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/sell-crypto/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/buy-crypto/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/holdings/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/get-profile/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/create-order/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/verify-payment/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/(server)/api/update-profile/.
This is a directory. It may contain files or subdirectories.
Describe the contents of the file app/(server)/api/orders/route.ts.
import { NextRequest, NextResponse } from "next/server"; import { PrismaClient } from "@prisma/client"; import { getServerSession } from "next-auth"; import { authOptions } from "@/lib/auth"; const prisma = new PrismaClient(); export async function GET(request: NextRequest) { try { const session = await getServ...
Describe the contents of the file app/(server)/api/sell-crypto/route.ts.
import { NextRequest, NextResponse } from "next/server"; import { prisma } from "@/lib/prisma"; import { getServerSession } from "next-auth"; import { authOptions } from "@/lib/auth"; export async function POST(request: NextRequest) { const session = await getServerSession(authOptions); const emailId = session?.us...
Describe the contents of the file app/(server)/api/buy-crypto/route.ts.
import { NextRequest, NextResponse } from "next/server"; import { prisma } from "@/lib/prisma"; import { getServerSession } from "next-auth"; import { authOptions } from "@/lib/auth"; export async function POST(request: NextRequest) { const session = await getServerSession(authOptions); const emailId = session?.us...
Describe the contents of the file app/(server)/api/holdings/route.ts.
import { NextResponse } from 'next/server' import { getServerSession } from "next-auth/next" import { authOptions } from "@/lib/auth" import { prisma } from "@/lib/prisma" export async function GET() { const session = await getServerSession(authOptions) if (!session || !session.user?.email) { return NextRespo...
Describe the contents of the file app/(server)/api/get-profile/route.ts.
import { prisma } from "@/lib/prisma"; import { getServerSession } from "next-auth"; export async function GET(req: Request) { const session = await getServerSession(); const email = session?.user?.email; if (!email) { return new Response(JSON.stringify({ message: "User not authenticated" }), { status...
Describe the contents of the file app/(server)/api/create-order/route.ts.
import { NextResponse } from 'next/server' import { getServerSession } from 'next-auth/next' import { authOptions } from '@/lib/auth' import { prisma } from '@/lib/prisma' import Razorpay from 'razorpay' const razorpay = new Razorpay({ key_id: process.env.RAZORPAY_KEY_ID!, key_secret: process.env.RAZORPAY_KEY_SECR...
Describe the contents of the file app/(server)/api/verify-payment/route..ts.
import { NextResponse } from 'next/server' import { prisma } from '@/lib/prisma' import crypto from 'crypto' export async function POST(req: Request) { try { const { razorpay_order_id, razorpay_payment_id, razorpay_signature } = await req.json() const body = razorpay_order_id + "|" + razorpay_payment_id ...
Describe the contents of the file app/(server)/api/update-profile/route.ts.
import { getServerSession } from "next-auth/next" import { NextResponse } from "next/server" import { prisma } from "@/lib/prisma" export async function PUT(req: Request) { const session = await getServerSession() if (!session || !session.user?.email) { return NextResponse.json({ error: "Not authenticated" }, ...
Describe the contents of the file app/utils/Query.ts.
// import { useQuery } from "@tanstack/react-query"; // import axios from "axios"; // export function useGetCrypto(){ // const { data , isLoading } = useQuery({ // queryKey: ["market-trades"], // queryFn: async () => { // const response = await axios.get(Market_URL); // return response...
Describe the contents of the file app/utils/Algorithms.ts.
export function formatNumber(number: number): string { const thresholds: [number, string][] = [ [1e12, 'T'], [1e9, 'B'], [1e6, 'M'], [1e3, 'K'], ]; const isNegative = number < 0; number = Math.abs(number); for (const [threshold, suffix] of thresholds) {...
Describe the contents of the file app/utils/ChartManager.ts.
import { ColorType, createChart as createLightWeightChart, CrosshairMode, ISeriesApi, UTCTimestamp, } from "lightweight-charts"; export class ChartManager { private candleSeries: ISeriesApi<"Candlestick">; private lastUpdateTime: number = 0; private chart: any; private currentBar: { open: number ...
Describe the contents of the file app/utils/nothing.ts.
Describe the contents of the file app/utils/ServerProps.ts.
import axios from "axios"; const Market_URL = "https://price-indexer.workers.madlads.com/?ids=solana,usd-coin,pyth-network,jito-governance-token,tether,bonk,helium,helium-mobile,bitcoin,ethereum,dogwifcoin,jupiter-exchange-solana,parcl,render-token,sharky-fi,tensor,wormhole,wen-4,cat-in-a-dogs-world,book-of-meme,raydi...
Describe the contents of the file app/utils/SignalingManager.ts.
import { TickerProps } from "./types"; export const BASE_URL = "wss://ws.backpack.exchange/" export class SignalingManager { private ws: WebSocket; private static instance: SignalingManager; private bufferedMessages: any[] = []; private callbacks: any = {}; private id: number; private initiali...
Describe the contents of the file app/utils/types.ts.
import zod from "zod" export interface KLine { close: string; end: string; high: string; low: string; open: string; quoteVolume: string; start: string; trades: string; volume: string; } export interface Trade { "id": number, "isBuyerMaker": boolean, "price": string, ...
Describe the contents of the file app/utils/wsClient.ts.
Describe the folder app/api/auth/.
This is a directory. It may contain files or subdirectories.
Describe the folder app/api/auth/[...nextauth]/.
This is a directory. It may contain files or subdirectories.
Describe the contents of the file app/api/auth/[...nextauth]/route.ts.
import { authOptions } from "@/lib/auth" import NextAuth from "next-auth" const handler = NextAuth(authOptions) export { handler as GET, handler as POST }