diff --git a/frontend/app/layout.tsx b/frontend/app/layout.tsx index f7fa87e..95af746 100644 --- a/frontend/app/layout.tsx +++ b/frontend/app/layout.tsx @@ -1,20 +1,13 @@ import type { Metadata } from "next"; -import { Geist, Geist_Mono } from "next/font/google"; +import { Inter } from "next/font/google"; import "./globals.css"; +import { Web3Provider } from "@/contexts/Web3Provider"; -const geistSans = Geist({ - variable: "--font-geist-sans", - subsets: ["latin"], -}); - -const geistMono = Geist_Mono({ - variable: "--font-geist-mono", - subsets: ["latin"], -}); +const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "Create Next App", - description: "Generated by create next app", + title: "ChainReCovenant - On-Chain Legal Agreements", + description: "Create and execute legal-style agreements on-chain with automated enforcement", }; export default function RootLayout({ @@ -24,10 +17,10 @@ export default function RootLayout({ }>) { return ( - - {children} + + + {children} + ); diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index 295f8fd..ac3a6fd 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx @@ -1,65 +1,206 @@ -import Image from "next/image"; +'use client'; + +import { useAppKit } from '@reown/appkit/react'; +import { useAccount, useReadContract } from 'wagmi'; +import { CONTRACT_ADDRESSES } from '@/config/contracts'; +import { CHAINRECOVENANT_ABI } from '@/config/abi'; +import Link from 'next/link'; export default function Home() { + const { open } = useAppKit(); + const { address, isConnected } = useAccount(); + + // Read total agreements from contract + const { data: totalAgreements } = useReadContract({ + address: CONTRACT_ADDRESSES.ChainReCovenant as `0x${string}`, + abi: CHAINRECOVENANT_ABI, + functionName: 'getTotalAgreements', + }); + + // Read user agreements if connected + const { data: userAgreements } = useReadContract({ + address: CONTRACT_ADDRESSES.ChainReCovenant as `0x${string}`, + abi: CHAINRECOVENANT_ABI, + functionName: 'getUserAgreements', + args: address ? [address] : undefined, + query: { + enabled: !!address, + }, + }); + return ( -
-
- Next.js logo -
-

- To get started, edit the page.tsx file. -

-

- Looking for a starting point or more instructions? Head over to{" "} - - Templates - {" "} - or the{" "} - + {/* Header */} +

+
+
+ 📜 +

+ ChainReCovenant +

+
+ +
+
+ + {/* Hero Section */} +
+

+ Legal Agreements on the Blockchain +

+

+ Create, sign, and enforce legal-style agreements with automated term enforcement. + Trustless, transparent, and immutable. +

+ +
+ {isConnected ? ( + <> + + Create Agreement + + + View My Agreements + + + ) : ( + + )}
-
- - Vercel logomark - Deploy Now - - - Documentation - +
+ + {/* Stats Section */} +
+
+
+
+
+ {totalAgreements?.toString() || '0'} +
+
Total Agreements
+
+ +
+
🤝
+
+ {isConnected ? (userAgreements?.length.toString() || '0') : '0'} +
+
Your Agreements
+
+ +
+
+
+ Base +
+
Deployed on Base
+
+
+
+ + {/* Features */} +
+

Key Features

+
+ + + + + + +
+
+ + {/* Contract Info */} +
+
+

Deployed on Base Mainnet

+
+
+ ChainReCovenant: + + {CONTRACT_ADDRESSES.ChainReCovenant} + + + View on BaseScan ↗ + +
+
+
+
+ + {/* Footer */} +
+ +
+ ); +} + +function FeatureCard({ icon, title, description }: { icon: string; title: string; description: string }) { + return ( +
+
{icon}
+

{title}

+

{description}

); } diff --git a/frontend/next.config.ts b/frontend/next.config.ts index e9ffa30..1dd5b79 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,7 +1,13 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + // Enable Turbopack (Next.js 16 default) + turbopack: {}, + + // TypeScript config + typescript: { + ignoreBuildErrors: false, + }, }; export default nextConfig; diff --git a/frontend/package.json b/frontend/package.json index 55911de..4461c69 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,10 +9,17 @@ "lint": "eslint" }, "dependencies": { + "@coinbase/wallet-sdk": "^4.3.7", + "@gemini-wallet/core": "^0.3.2", + "@metamask/sdk": "^0.33.1", "@reown/appkit": "^1.8.14", "@reown/appkit-adapter-wagmi": "^1.8.14", + "@safe-global/safe-apps-provider": "^0.18.6", + "@safe-global/safe-apps-sdk": "^9.1.0", "@tanstack/react-query": "^5.90.12", + "@walletconnect/ethereum-provider": "^2.21.10", "next": "16.0.7", + "porto": "^0.2.37", "react": "19.2.0", "react-dom": "19.2.0", "viem": "^2.41.2", @@ -25,6 +32,7 @@ "@types/react-dom": "^19", "eslint": "^9", "eslint-config-next": "16.0.7", + "ignore-loader": "^0.1.2", "tailwindcss": "^4", "typescript": "^5" }